Click here to Skip to main content
15,897,891 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Stuck on an a* pathfinding algorithm Pin
Espen Harlinn4-Jan-11 8:27
professionalEspen Harlinn4-Jan-11 8:27 
AnswerRe: Stuck on an a* pathfinding algorithm Pin
ely_bob10-Jan-11 9:55
professionalely_bob10-Jan-11 9:55 
QuestionI'm Looking For An Algorithm To Optimize Keno Selections Pin
Roger Wright20-Dec-10 15:23
professionalRoger Wright20-Dec-10 15:23 
AnswerRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
GlobX20-Dec-10 16:07
GlobX20-Dec-10 16:07 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Roger Wright20-Dec-10 16:48
professionalRoger Wright20-Dec-10 16:48 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
GlobX20-Dec-10 16:58
GlobX20-Dec-10 16:58 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Roger Wright20-Dec-10 17:53
professionalRoger Wright20-Dec-10 17:53 
AnswerRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Luc Pattyn20-Dec-10 16:58
sitebuilderLuc Pattyn20-Dec-10 16:58 
Hi Roger,

the easiest way to tackle this is by reversing the chronology:

assume there are 80 numbers (1 to 80). Now let them first pick 20 "good" numbers out of those 80; it could be they pick numbers 1 to 20, and leave 60 "bad" numbers numbered 21 to 80; or any other combination, it does not really matter.

Then you pick N arbitrary numbers out of the range 1-80, each of them obviously has probability 20/80 or 1/4 of being good and 60/80 or 3/4 of being bad.

What you pick is represented by the expression (g+b)^N with g=1/4, b=3/4, and N the number of numbers you pick.
The expression equals 1 because g+b=1; however expanding the power series (using binomial coefficients), you get separate terms each representing a specific number G of good picks and B bad picks.

The probability that corresponds with a specific value of G and B equals COMB(G,N)*(g^G)*(b^B)
where COMB(G,N)=N!/G!/(N-G)!

Note: COMB is symmetric, i.e. COMB(G,N) = COMB(B,N)

As an example:

we continue with g=1/4, b=3/4
assume you pick 2, hence N=2

three possible outcomes:
2 good, 0 bad; hence G=2, B=0; probability = COMB(2,2)*(0.25^2)*(0.75^0) = 1 * 1/16 * 1 = 1/16
1 good, 1 bad: G=1, B=1; prob= COMB(1,2)*(0.25^1)*(0.75^1) = 2 * 1/4 * 3/4 = 6/16
0 good, 2 bad: G=0, B=2; prob= COMB(0,2)*(0.25^0)*(0.75^2) = 1 * 1 * 9/16 = 9/16
check: the sum of all three is 16/16 or 1.

Smile | :)

PS: by looking at it in this way, there is no order, hence no 80,79,78... concerns!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Roger Wright20-Dec-10 17:51
professionalRoger Wright20-Dec-10 17:51 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
GlobX20-Dec-10 19:30
GlobX20-Dec-10 19:30 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Roger Wright22-Dec-10 4:03
professionalRoger Wright22-Dec-10 4:03 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
agolddog23-Dec-10 4:06
agolddog23-Dec-10 4:06 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Roger Wright23-Dec-10 5:05
professionalRoger Wright23-Dec-10 5:05 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Luc Pattyn23-Dec-10 5:39
sitebuilderLuc Pattyn23-Dec-10 5:39 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
jschell23-Dec-10 8:25
jschell23-Dec-10 8:25 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
musefan22-Dec-10 4:36
musefan22-Dec-10 4:36 
AnswerRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
cp987620-Dec-10 18:52
cp987620-Dec-10 18:52 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
musefan22-Dec-10 4:34
musefan22-Dec-10 4:34 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Luc Pattyn22-Dec-10 4:47
sitebuilderLuc Pattyn22-Dec-10 4:47 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Kirk Wood24-Dec-10 4:29
Kirk Wood24-Dec-10 4:29 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Roger Wright3-Jan-11 18:37
professionalRoger Wright3-Jan-11 18:37 
AnswerRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
trooper081423-Dec-10 20:28
trooper081423-Dec-10 20:28 
AnswerRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Mwanzia_M21-Jan-11 3:05
Mwanzia_M21-Jan-11 3:05 
GeneralRe: I'm Looking For An Algorithm To Optimize Keno Selections Pin
Roger Wright21-Jan-11 17:06
professionalRoger Wright21-Jan-11 17:06 
QuestionOpenSource Audio DSP Algorithms/Filters? Pin
Yuval Naveh10-Dec-10 7:40
Yuval Naveh10-Dec-10 7:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.