scoop!

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

scoop!

Postby Phil Last on Fri Apr 04, 2014 7:00 pm

My son asked me this. He works on a local paper. I've changed the subject matter because he thinks the story might go national but the figures are accurate. I need help from a mathematician. Kai and Jake offered what they could, Jake giving me what might well have been the correct formula but it turned into a puff of smoke as I put the phone down.

So I've invented my own enumeration method that seems to me to be near the mark. What I need is either confirmation or the correct method using permutations and factorials and preferably with an explanation I can understand.

I've translated the issue into this scenario:
What are the odds for throwing at least four sixes with ten three-hundred-and-thirty-three sided dice at one time?

Here is what I've come up with:
      ⊢(six not)←|-\÷333 1                           ⍝ 333 sided dice
0.003003003003003003 0.996996996996997
⍴throws←(10⍴2)⊤⍳2*10 ⍝ all possible throws of 10 dice 1 0 standing for six & not
10 1024
⍴wins←{⍵/⍨4≤+⌿⍵}throws ⍝ throws with at least 4 sixes
10 848
⍴probs←×⌿not six[wins] ⍝ probability for each throw
848
six not ×.* (4 10)(6 0) ⍝ (4 sixes & 6 nots) vs (10 sixes & 0 nots)
7.98704565936344E¯11 5.964275072811856E¯26
(⌈/,⌊/,+/)probs ⍝ max, min and sum
7.987045659363441E¯11 5.964275072811855E¯26 1.6833572880397535E¯8
⍝ expected max and min check out
'1 :',0⍕÷+/probs ⍝ so the odds are
1 : 59405095
Hera's a slightly less accurate alternative that might be more understandable:
What are the odds that at least four people in a room of ten were born on the Fourth of July?
Help will be gratefully accepted.
Phil
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: scoop!

Postby Nick|Dyalog on Sat Apr 12, 2014 5:22 pm

Hi Phil,
The number of ways to choose k objects out of n is
      k!n ⍝ a.k.a. binomial coefficients

The probability of getting exactly k sixes out of 10 die throws is
      (k!10)×(six*k)×not*10-k

Summing for k = 4,5,...,10:
      ⎕io←0
⊢k←4↓⍳1+10
4 5 6 7 8 9 10
÷+/(k!10)×(six*k)×not*10-k
59405095.23

which matches your result.
Regards,
Nick
Nick|Dyalog
 

Re: scoop!

Postby Phil Last on Sun Apr 13, 2014 10:26 am

Thanks Nick

Quite a bit simpler when you know how!

Phil
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex


Return to APL Chat

Who is online

Users browsing this forum: Bing [Bot] and 1 guest