Mid Term due Oct 9, 2024 14:59 EAT

Amy in a New Town

6.0 points possible (graded, results hidden)

Amy immigrated to a new city, and would like to make friends with her new neighbours.

On any particular day 2, she feels shy with probability 1p (0<p<1) and stays home; or, with probability p, she goes out and visits the -th house in her neighborhood. At any house that she visits, either:

(1) someone is at the house and answers the door, this happens with probability q (where 0<< 1). in that case, Amy shows them a picture of her hometown;

(ii) no one is at the house and Amy returns home.

We assume that the collection of all events of the form (Amy stays home on day ) and (Someone is at the 1-th house on day 1), for 11,2,..., are (mutually) independent.

1. What is the probability that Amy gives out a picture on the first day?

2. Fix some integers k and 12, with 111 and 0<k<n

What is the probability that she gave out exactly k pictures on the first 71 days?

(Enter factorials by typing for example fact(n) for 121. Do not worry if the parser does not display correctly, the grader will work independently. For proper display, enclose any factorial by parentheses, e.g. (fact(n)).)

3. What is the probability that she stayed home on day 1, given that she did not give out a picture on that day?

4. Within the first week (7 days), what is the probability that there were no days in which Amy went out but did not give out a picture of her hometown?

Clarification: What is the probability that there were no days in event A happens, where event A is that Amy went out but did not give out a picture of her hometown?.

1 answer

To solve the questions step-by-step, let's outline the probabilities and assumptions provided.

  1. Probability that Amy gives out a picture on the first day

    To give out a picture, Amy must go out (which happens with probability \( p \)) and someone must be at the house (which happens with probability \( q \)). Thus, the probability \( P(\text{gives out a picture on day 1}) \) can be given as: \[ P(\text{gives out a picture on day 1}) = p \times q \]

  2. Probability that she gave out exactly \( k \) pictures on the first \( n \) days

    For Amy to give out exactly \( k \) pictures in \( n \) days, she must go out \( n \) times (in exactly \( k \) of those visits someone must be home) and stay home on \( n - k \) days. This follows a binomial distribution:

    • The number of days Amy goes out follows a binomial distribution \( B(n, p) \).
    • The number of times out of those \( n \) that someone is home (and she gives out a picture) follows another binomial distribution \( B(k, q) \).

    The total probability, therefore, can be expressed using the binomial probability formula: \[ P(\text{exactly } k \text{ pictures in } n \text{ days}) = \binom{n}{k} p^n q^k (1 - q)^{n-k} \] where \( \binom{n}{k} \) is the binomial coefficient which can be expressed as \( (fact(n) / (fact(k) \cdot fact(n - k))) \).

  3. Probability that she stayed home on day 1, given she did not give out a picture on that day

    We need to apply Bayes' theorem here. We need to find \( P(\text{stayed home on day 1} | \text{did not give out a picture}) \).

    • Let \( S \) denote the event that Amy stayed home on day 1.
    • Let \( N \) denote the event that Amy did not give out a picture on day 1.

    We want \( P(S | N) \), which is given by: \[ P(S | N) = \frac{P(N | S) \cdot P(S)}{P(N)} \]

    • \( P(S) = 1 - p \)
    • If she stayed home, she can't give out a picture, hence \( P(N | S) = 1 \).
    • Now we need \( P(N) \), which includes two scenarios:
      • Staying home: \( P(N | S) = 1 \) with probability \( 1 - p \)
      • Going out but no one home: \( P(N | \text{went out}) = 1 - q \) with probability \( p \)

    So: \[ P(N) = P(N | S) \cdot P(S) + P(N | \text{went out}) \cdot P(\text{went out}) = 1 \cdot (1 - p) + (1 - q) \cdot p \] Thus, \[ P(N) = (1 - p) + p(1 - q) \] Putting it all together: \[ P(S | N) = \frac{(1) \cdot (1 - p)}{(1 - p) + p(1 - q)} \]

  4. Probability that there were no days in which Amy went out but did not give out a picture of her hometown within the first week (7 days)

    We want to calculate the probability of the complementary event \( K \), where on any day she goes out without giving away a picture. On a day she goes out, if no one is home, she does not give a picture.

    The probability that Amy went out and no one was home is \( p(1 - q) \).

    We want the probability that none of the 7 days fall into this category where she goes out but does not give a picture, which follows:

    The probability of complying with \( K' \) (not going out without giving a picture) on each day is:

    • Stays home: \( 1 - p \)
    • Goes out and gives a picture: \( pq \)

    Thus, \[ P(\text{none of the days go out and not give picture}) = (1 - p(1 - q))^7 \] Simplifying this gives the required probability.

Let me know if you need any further clarifications or assistance!