Donuts
Donuts
  • Threads: 24
  • Posts: 171
Joined: Oct 17, 2014
March 25th, 2017 at 3:45:53 PM permalink
Looking for some help on two probability questions. I think I have the correct answers but I'm not sure.

1)
You have 100 people and pick 1 new person per day to go see a movie. (New meaning after someone is selected they cannot be selected again)
What is the average number of days it takes for someone to go see a movie with you?

My answer (may be wrong)
(100+1)/2 = 50.5 Days

2)
You have 100 people and pick 1 random person per day to go see a movie. (The same person can now be picked any number of times)
What is the average number of days it takes for someone to go see a movie with you for the first time?

My answer (may be wrong)
n = days
P0 (Didn't see movie) = (99/100)^n
P1 (Saw movie) = 1 - (99/100)^n

Set n = 50% (average)
1 - (99/100)^n = .5
n ~ 69 Days
Last edited by: Donuts on Mar 25, 2017
Doc
Doc
  • Threads: 46
  • Posts: 7287
Joined: Feb 27, 2010
March 25th, 2017 at 4:00:35 PM permalink
Don't think I agree with your answer to problem #2. Recognize that after 30 days have elapsed, this person may have already been to the movie with you five different times. How are you taking that into consideration in your calculations? Does your method calculate probability of having gone one or more times? What is the probability that day n is the very first time they went with you?
Donuts
Donuts
  • Threads: 24
  • Posts: 171
Joined: Oct 17, 2014
March 25th, 2017 at 4:13:25 PM permalink
Should have clarified that I wanted to calculate the time it takes for the first visit to the movie.

My thought was take the probability of the person not getting picked n days in a row and set that equal to 50%. (i.e. they couldn't have possibly seen the movie with me before)

There's a good chance my logic is flawed or my math is wrong though.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6742
Joined: Jun 22, 2011
March 25th, 2017 at 5:01:14 PM permalink
For #2, I get 100, and this appears to be confirmed by simulation, although I am not entirely sure why just yet.

The first person chosen will have waited one day.
Once the (N-1)th person is chosen, there is a 1 - (N/100) chance of a "new" person being chosen 1 day later, (N/100) x (1 - N/100) of the next new person being chosen 2 days later, (N/100)2 x (1 - N/100) of the next new person being chosen 3 days later, and so on.
Let p = (N-1)/100 and q = 1 - p; the number of days between new person (N-1) and new person N is:
p (q x 1 + p q x 2 + p2 q x 3 + p3 q x 4 + ...)
= q (1 + 2 p + 3 p2 + 4 p3 + ...)
= q (1 + p + p2 + p3 + ...)2
= q / (1 - p)2
= q / q2
= 1 / q
= 1 / (1 - (N-1)/100)
= 100 / (101 - N)

Remember that the average number of days for the Nth new person to be chosen = the average for the (N-1)th + 100 / (101 - N)
Calculate the averages for N = 1, 2, 3, ..., 100, and divide by 100; the result = 100.
Donuts
Donuts
  • Threads: 24
  • Posts: 171
Joined: Oct 17, 2014
March 25th, 2017 at 5:24:53 PM permalink
Quote: ThatDonGuy

For #2, I get 100, and this appears to be confirmed by simulation, although I am not entirely sure why just yet.

The first person chosen will have waited one day.
Once the (N-1)th person is chosen, there is a 1 - (N/100) chance of a "new" person being chosen 1 day later, (N/100) x (1 - N/100) of the next new person being chosen 2 days later, (N/100)2 x (1 - N/100) of the next new person being chosen 3 days later, and so on.
Let p = (N-1)/100 and q = 1 - p; the number of days between new person (N-1) and new person N is:
p (q x 1 + p q x 2 + p2 q x 3 + p3 q x 4 + ...)
= q (1 + 2 p + 3 p2 + 4 p3 + ...)
= q (1 + p + p2 + p3 + ...)2
= q / (1 - p)2
= q / q2
= 1 / q
= 1 / (1 - (N-1)/100)
= 100 / (101 - N)

Remember that the average number of days for the Nth new person to be chosen = the average for the (N-1)th + 100 / (101 - N)
Calculate the averages for N = 1, 2, 3, ..., 100, and divide by 100; the result = 100.



This makes sense.
Trying to figure out what I calculated in my initial post then or if it's just wrong.

Also wondering how your math might change if we change the numbers slightly.
What happens if instead of picking 1/100 each day we pick 10/1000?
Can we just use 1- 10N/1000 instead or will that fail to factor in the possibility of some (not all) of the people may have been selected before.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6742
Joined: Jun 22, 2011
March 25th, 2017 at 5:47:21 PM permalink
Quote: Donuts

Also wondering how your math might change if we change the numbers slightly.
What happens if instead of picking 1/100 each day we pick 10/1000?
Can we just use 1- 10N/1000 instead or will that fail to factor in the possibility of some (not all) of the people may have been selected before.


Do you mean, have 1000 people, and choose 10 per day?
That changes the second problem, as you have to take into account the possibility that 0, 1, 2, ..., 10 people who have not been chosen before will be chosen.
Donuts
Donuts
  • Threads: 24
  • Posts: 171
Joined: Oct 17, 2014
March 25th, 2017 at 5:50:42 PM permalink
Quote: ThatDonGuy

Do you mean, have 1000 people, and choose 10 per day?
That changes the second problem, as you have to take into account the possibility that 0, 1, 2, ..., 10 people who have not been chosen before will be chosen.



Right.

For context I was asked both of these questions during an interview.
My probability knowledge is pretty sub par but I'd assume they would only ask the second question if there was some relatively easy solution that could fit into a 30 minute window.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6742
Joined: Jun 22, 2011
March 25th, 2017 at 6:03:42 PM permalink
Quote: ThatDonGuy

Calculate the averages for N = 1, 2, 3, ..., 100, and divide by 100; the result = 100.


Here's why:
Let Dn be the average number of days before the Nth person is chosen
D1 = 1
D2 = 1 + 100/99
D3 = 1 + 100/99 + 100/98
...
D100 = 1 + 100/99 + 100/98 + ... + 100/2 + 100/1
Sum these; the 1 term appears 100 times, the 100/99 term appears 99 times, the 100/98 term appears 98 times, and so on
The average = (1 x 100 + 100/99 x 99 + 100/98 x 98 + ... + 100/2 x 2 + 100/1 x 1) / 100
= (100 + 100 + 100 + ... + 100) / 100
= 100

Also, I did a simulation on the 1000 persons, 10 per day problem, and I do get 100 days or somewhere close to it.
Note that once all but one of the persons are chosen, there is a 1% chance of choosing the last person each day, just as there is with the 100 persons, 1 per day problem.
  • Jump to: