I'm facing the following predicament:
I can calculate the total stake by using the binomial coefficients to get the number of lines for any specific bet, for example if I had horses and a DBL: A B C D E
5! / 2!(5-2)! that would get me 10 lines for my cross doubles.
The issue arises when I have 2 horses from the same race, in which case it'd become something similar to:
A A B C D
This type of bet would have 9 lines rather than 10.
In which case calculating it using the same formula will give me the wrong result.
I'm not particularly good at combinatorics, this is for a personal programming project that I'm working on - I'm attempting to make a calculator for the stake based on the number of selections.
Any pointers or advice on how to proceed would be helpful, as at this point I'm mostly guessing and not getting anywhere.