Note that there are some explanatory texts on larger screens.

plurals
  1. POprobability n choose k
    primarykey
    data
    text
    <p>I tried to solve this TopCoder problem: <a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=10863&amp;rd=14150" rel="nofollow">http://community.topcoder.com/stat?c=problem_statement&amp;pm=10863&amp;rd=14150</a></p> <p>But, my solution is not good, and I don't understand why.</p> <p>I understood the solution given there (down page: look for LotteryPyaterochka): <a href="http://apps.topcoder.com/wiki/display/tc/SRM+466" rel="nofollow">http://apps.topcoder.com/wiki/display/tc/SRM+466</a></p> <p>So, to sum up my problem:</p> <p>We are playing a special kind of lottery:</p> <p>Each ticket in this lottery is a rectangular grid with N rows and 5 columns, where each cell contains an integer between 1 and 5*N, inclusive. All integers within a single ticket are distinct. </p> <p>The lottery organizers randomly choose 5 distinct integers, each between 1 and 5*N, inclusive. Each possible subset of 5 integers has the same probability of being chosen. These integers are called the winning numbers. A ticket is considered a winner if and only if it has a row which contains at least 3 winning numbers.</p> <p>We want to know the number of winning ticket (thus, having at least 3 winning number in the same row)</p> <p>So, I stuck in the following step:</p> <p>number of ways of choosing the 5 numbers which appear in the 'winning row'.</p> <p>The topCoder solution says: </p> <blockquote> <p>(#ways of choosing the 5 numbers which appear in the 'winning row') = </p> <p>(#ways of choosing the x winning numbers which appear in the 'winning row') * (#ways of choosing 5-x 'non-winning numbers') = </p> <p>(5 choose x) * ((5N-5) choose (5-x))</p> <p>Since the number of winning numbers in this row is at least 3, x can be 3 or 4 or 5. So, we have (#ways of choosing the 5 numbers which appear in the 'winning row') = </p> <p>(5 choose 3) * ((5N-5) choose 2) + (5 choose 4) * ((5N-5) choose 1) + (5 choose 5) * ((5N-5) choose 0))</p> </blockquote> <p>And what I say:</p> <blockquote> <p>(#ways of choosing the 5 numbers which appear in the 'winning row') = </p> <p>(3 number among the 5 winning number) * (2 numbers to complete the row to choose among the 5N-5 non winning number + 2 winning number non chosen before) =</p> <p>(5N choose 3) * ((5N-3)choose 2)</p> </blockquote> <p>For N = 10 my method give: (5 choose 3)*(47 choose 2) = 10810</p> <p>And the topcoder method give: ((5 choose 3)<em>(45 choose 2) + (5 choose 4)</em>(45 choose 1) + (5 choose 5)*(45 choose 0)) = 10126</p> <p>Why is my method wrong ?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload