How to calculate scratch card probability A scratch ticket has 15 cells. 

How do you calculate the probability of scratching 6 winning images before scratching 9 losing images?

I'm trying to build a simple online game and struggling with the probabilities :(
I assume that we know beforehand that the card will have exactly 6 winning images amongst the 15 on the card.

There are 6 winning images in the 15 images. When choosing the first image to reveal, there is a $\frac{6}{15}$ probability of it being a winning one.

There are now 5 winning images left in the remaining 14 images. When choosing the second image to reveal, there is a $\frac{5}{14}$ probability of it being a winning one.  

There are now 4 winning images left in the remaining 13 images. etc.

The probability of going through all 6 reveals successfully is therefore $\frac{6}{15}\cdot \frac{5}{14}\cdot \frac{4}{13}\cdot \frac{3}{12}\cdot \frac{2}{11}\cdot \frac{1}{10}$.
Direct enumeration is another possibility. All possible drawings are obtained by the following Mathematica codes:

ticket = Join[Table[w, 6], Table[l, 9]];
ords = Permutations[ticket];
Length[ords] (* output 5005 *)


The count is $5005$. 

Drawing 6 w's before the 9 l's requires that the first 14 scratches contain 6 w's. The number of drawings which satisfy this is

Length[ Select[ #[[1 ;; 14]] &amp; /@ ords, Count[#, w]==6 &amp;]]


and this gives $3003$. The required probability is $3003/5005$.