Probability of picking all items in a set

bravid

New member
Joined
Jan 14, 2016
Messages
4
10000000000Hello

I'd like to understand the process of how to calculate the probability of the following problem....

I have a digital picture frame that shows 2 pictures per day (morning and afternoon). It has a selection of 10 pictures and doesn't remember any previous choices i.e. it could show the same picture many times. Over the course of 5 days, what is the probability of seeing all 10 photos.

My working so far has been to start with 2 chances and 2 photos. So that means 4 possible combinations of photos with 2 combinations that mean I see both i.e.

1, 2 <- Winner (I see both photos)
2, 2
2, 1 <- Winner (I see both photos)
1, 1

So that suggests I have a 50% chance of seeing both photos in 1 day (4 possible outcomes, 2 winning outcomes = 2/4 = 0.5).

If I scale that up to 3 photos with 3 chances (i.e. morning, afternoon, morning of the next day) I have 27 (3^3) possible combinations and 6 (3 factorial) winners - which gives 6/27 = 22% chance

So my thinking here is that if I scale the number of photos with the number of chances I should arrive at the correct probability. So for 5 days with 2 photos per day that's 10 chances, and 10 photos.

So on that basis it's 10^10 = 10000000000 possible combinations, and 3628800 winning outcomes (10 factorial), which gives 0.036288% (3628800 / 10000000000)

Is that the right way to approach this or am I completely on the wrong track? If I am on the right track I'm not quite sure why!

The other way I was looking at it was to say for any one change of picture there is an equal chance of picking any of the 10 photos i.e.

1 / 10 = 0.1 = 10%

So if I take 10 chances and multiply the probabilities I get

0.1*0.1*0.1*0.1*0.1*0.1*0.1*0.1*0.1*0.1 = 0.0000000001

But that feels like it's telling me what is the chance of picking the same photo each time, and I don't know how to translate that into the chance of picking all photos.

Any ideas?


Cheers

David
 
Seems to me this is same as:
10 cards labelled 1 to 10

shuffle
pick 2: replace and shuffle
pick 2: replace and shuffle
pick 2: replace and shuffle
pick 2: replace and shuffle
pick 2

Probability that all 10 numbers appeared ?

yep that's definitely a simpler way of explaining it! :)
 
yes

Hi Denis

not sure what happened to my last reply but yes that is a much simpler way of describing what I'm trying to figure out :)

Am I on the right track?

David
 
From the Perl program: Two rows to each result: 1st row is percentage of number n distinct numbers were chosen; 2nd row a check number (should total to 100%) and total number of sets (shuffle, pick 2, 5 times). Example: row 1: 0% of the time only 1 number was chosen, 0% of the time only 2 numbers were chosen, 0.060% of the time only 3 numbers were chosen, 1.910% of the time only 4 numbers were chosen, ..., 0.04% of the time all 10 numbers were chosen; row 2 total is 100.000% and 10000 trials were run [so, in example, 4 times all ten numbers were chosen].

0.000 0.000 0.060 1.910 13.260 34.480 35.030 13.830 1.390 0.040
100.000 10000
0.000 0.000 0.055 1.891 13.327 34.409 35.218 13.673 1.391 0.036
100.000 11000
0.000 0.000 0.050 1.792 13.292 34.450 35.367 13.567 1.450 0.033
100.000 12000
0.000 0.000 0.062 1.785 13.177 34.408 35.492 13.577 1.462 0.038
100.000 13000
0.000 0.000 0.057 1.786 13.179 34.421 35.521 13.514 1.479 0.043
100.000 14000
0.000 0.000 0.060 1.787 13.200 34.273 35.720 13.427 1.493 0.040
100.000 15000
0.000 0.000 0.056 1.800 13.244 34.331 35.644 13.413 1.469 0.044
100.000 16000
0.000 0.000 0.053 1.788 13.153 34.376 35.641 13.465 1.482 0.041
100.000 17000
0.000 0.006 0.056 1.800 13.044 34.378 35.700 13.461 1.517 0.039
100.000 18000
0.000 0.005 0.058 1.811 12.911 34.421 35.700 13.511 1.547 0.037
100.000 19000
0.000 0.005 0.060 1.835 12.835 34.365 35.795 13.515 1.555 0.035
100.000 20000
 
WHAT's all that, Ishuda?
The results of a simulation run?
Yes. I'm pretty sure I programmed it correctly. If you (or anyone) cares to check it out: It has to be in at least three parts for some reason
PART 1 of 3 (?)
Code:
  use strict;
  use warnings;
#
# Ten 'items' (numbers, carrots, whatever).  Mix them up pick 2.  
# Do this 5 times.  What is the probability that all ten were chosen?
#
#   my $my_number
#  The items in the list
   my @my_digits = (0,1,2,3,4,5,6,7,8,9); 
#  The results of the 5 shuffles; item of the shuffled my_digits picked,
#  my_choices increased by one.    
    my @my_choices;
#  The results of how many items were chosen, i.e. if 5 unique items were chosen
#  in the 5 shuffles, results[5] is incremented.
    my @results=(0,0,0,0,0,0,0,0,0,0,0);
#  Total number of 5 set trials
    my $total_run = 0;
#  Other variables
    my $i = 0;
    my $j = 0;
    my $k = 0;
    my $m = 0;
    my $s = 0;
    my $t = 0;
    my $i_set = 0;
    my $icount = 0;
for($m=0; $m<20; $m++){
#  begin trial set loop
   for($total_run=0; $total_run<1000; $total_run++){
    $icount++;
 
Last edited:
WHAT's all that, Ishuda?
The results of a simulation run?
PART 2 of 3(?)
Code:
    #
    # Initialize
      for($i=0; $i<10; $i++){
       $my_choices[$i]=0;
      }
    #
    # Single set loop
      for($i_set=0; $i_set<5; $i_set++){
       # Shuffle loop
         for($i=0; $i<1000; $i++){
         $j=int(rand(10));    
         $k=int(rand(10));    
         $t=$my_digits[$j];
         $my_digits[$j] = $my_digits[$k];
         $my_digits[$k] = $t;
        }
       #
       # Pick 2 
         $j=int(rand(10));    
         $i=int(rand(10));    
         $my_choices[$my_digits[$j]]+=1;
         $my_choices[$my_digits[$i]]+=1;
      }
 
Guess it was something in this third piece of code it won't let me post. I'll play around with it for a while and see what I can do.
Code:
      #
      # Update results
        $j=0;
        for($i=0; $i<10; $i++){
         $j++ if($my_choices[$i] ne 0);
        }
        $results[$j]++;
   }#end trial set loop

DUMB! What I'm not allowed to post is the output code, i.e. the code that produced the output which I partially showed. So several lines follow the above [actually 10 lines] which are a comment, the output code and the final closing for the $m loop.
 
Last edited:
I have a digital picture frame that shows 2 pictures per day (morning and afternoon). It has a selection of 10 pictures and doesn't remember any previous choices i.e. it could show the same picture many times. Over the course of 5 days, what is the probability of seeing all 10 photos.
This is a simple counting problem.

Ans: \(\displaystyle \dfrac{10!}{\;10^{10}}\) calculated here.
 
This is a simple counting problem.

Ans: \(\displaystyle \dfrac{10!}{\;10^{10}}\) calculated here.

Which is, to two significant figures, 0.00036 or 0.036%. The results of my program gave 0.037% for 19000 tries and 0.035% for 20000 tries. So I guess the program was correct.
 
I disagree with both of you, Ishuda and Pka.

Your result of .00036288 is the probability
that in a 1 to 10 loop of 10 variables, the 10
variables will be different, which is 3,628,800
out of the 10^10 loops. In other words, you
are reshuffling after every draw instead of
after every 2nd draw.

I am willing to "bet the farm!" that this is
the solution:
8/10 * 7/9 * 6/10 * 5/9 * 4/10 * 3/9 * 2/10 * 1/9
which equals 56/91125 or ~.00061454

Prove me wrong and I'll eat my hat :cool:

Of course, this is the problem to be solved (agreed to by the OP):
We have a deck of 10 cards labelled 1 to 10.
shuffle the deck
pick 2 cards: replace and shuffle the deck
pick 2 cards: replace and shuffle the deck
pick 2 cards: replace and shuffle the deck
pick 2 cards: replace and shuffle the deck
pick 2 cards.
What is the probability that all 10 numbers appeared ?

Of course, "pick" means draw at random and "replace"
means put back in deck.
Denis,
Look at the code in my program. Specifically
Code:
       # Shuffle loop
         for($i=0; $i<1000; $i++){
         $j=int(rand(10));    
         $k=int(rand(10));    
         $t=$my_digits[$j];
         $my_digits[$j] = $my_digits[$k];
         $my_digits[$k] = $t;
        }
       #
       # Pick 2 
         $j=int(rand(10));    
         $i=int(rand(10));    
         $my_choices[$my_digits[$j]]+=1;
         $my_choices[$my_digits[$i]]+=1;
 
I can only follow the 1st 3 lines:
loop i from 0 to 999
j = random integer from 1 to 10
k = random integer from 1 to 10

Can you recode in structured English?

Anyway, if results are not 56/91125, then it's wrong :rolleyes:
Specifically you are talking about the shuffle: There are 10 slots numbered 0 to 9. Randomly choose two of them and interchange them. Do this 1000 times:

The next two lines of code (after the shuffle) randomly choose two slots [cards] between 0 and 9. Thinking of it, admittedly this is chosen with replacement so that, theoretically, it would be possible to choose the same number [card] twice. When I fix that [put in a 'while loop' checking for $i equal to $j] the result change to 0.067%, 0.068%, and 0.065% for the last three sets of 18000 trials, 19000 trials, and 20000 trials. Is that close enough to your 0.061%?
 
I disagree with both of you, Ishuda and Pka.
In other words, you
are reshuffling after every draw instead of
after every 2nd draw. Of course, "pick" means draw at random and "replace"
means put back in deck.
Computer simulations are not completely random. Some logicians still do not accept computer aided proof: The proof of the four color problem is an example.

You might think of a forced air picker like used in the latest power-ball game. Only we have balls \(\displaystyle 0,1,2,3,4,5,6,7,8,\,\& \,,9\) and each time one ball pops out, the number noted and ball is replaced. Study after study has shown this to be as near random as possible.

Letting that machine pick ten numbers, gives \(\displaystyle 10^{10}\) possible outcomes, strings of digits of length ten.

The string of all ten digits can be arranged in \(\displaystyle 10!\) ways. Those are the only ways all ten pictures will be seen at the rate two a day over five days.
 
I'd like to understand the process of how to calculate the probability of the following problem....
I have a digital picture frame that shows 2 pictures per day (morning and afternoon). It has a selection of 10 pictures and doesn't remember any previous choices i.e. it could show the same picture many times. Over the course of 5 days, what is the probability of seeing all 10 photos.
However, 10! / 10^10 is NOT the solution to the problem we're working with.

Denis, I cannot imagine what problem you think I have solved. The one in blue above is the original posting with underlining added. That is the problem I solved. If you are dealing with any different wording then that belongs in a separate thread.
 
First off thank you everyone for your help and explanations.

The devil is in the detail and I've confused matters by not seeing the subtlety in Denis' proposition. I am actually looking for pick 1 card, shuffle then pick another - not pick 2 cards, shuffle then pick 2 more. So it looks like the answer is 10! / 10^10.

Thank you all again and sorry for the confusion
 
Top