Hyper-Geometric Distribution (ID:2028)
Project Creator: |
TroyNewman
FC Member For 6563 Days
Credits 20 Completed Proj. Num. 0 / 1 Total payment USD Avg Daily Online 0.00 h (From 21/5/2007) Available on MSN/Skype No Last Login 3/20/2007 Peers Rating 0.00% ![]() ![]() ![]() |
---|---|
Budget: | Not Sure/Confidential |
Created: | 3/8/2007 9:47:34 AM EST |
Bidding Ends: | 3/22/2007 9:47:34 AM EST ( Expired ) |
Development Cycle: | 14 Days |
Bid Count: | 4
|
Average Bid: | 675.00 |
Project Description:
I require a formula that can be use in a visual basic project to calculate the odds of correctly selecting a given number objects (i.e. 4 correct matches) from a pool of objects (i.e. 54 objects) when a fixed number of objects (i.e. 6) are drawn from a pool based on the number of selections (guesses) you are allowed to make (i.e. 20). Rephrased: There is a pool of 54 objects, numbered from 1 to 54, and 6 of these objects are to be drawn from the pool. If you are allowed to make 20 guesses, what are the odds that 4 of your guesses/selections will be correct? I have modify the hyper-geometric distribution formula where: f = Field......Number of objects in selection pool d = Draw .....Number of objects drawn in the m = MatchesReq......Number of guesses/selections that must match d! (f-d)! -------- ---------- m! (d-m)! ----------------------- f! ---------- d! To read f = Field......Number of balls in selection pool d = Draw .....Number of balls drawn in the game s = Selections.......Number of selections made m MatchesReq......Number of selections that must match s! (f-s)! ------------ ---------------------------- m! (s-m)! (d-m)! ((f-s) - (d-m))! ---------------------------------------------- f! ---------- d!(f-d)! This appears to work fine EXCEPT When the number of selection made is near the number the number of objects in the pool AND The number of matches required is less then the number of objects drawn. When the two above conditions exist, the odds appear go up, instead of down, the less matches are required. I then modified this further to read: d! (f-d)! ------------ ----------------------- m! (d-m)! (s-m)! ((f-d)-(s-m))! -------------------------------------------- f! --------- s! (f-s)! But the same error occurs. The below is examples of results when calculation is run with Excel (using its factorial function). ====================== Field=54 Draw=6 Selections =6 Required Matches=6 Ways to Get Success: 720 / (720 * 1) = 1 Ways to Get failure: 1.24139155925361E+61 / (1 * 1.24139155925361E+61) = 1 Ways total number of ways of selecting objects: 2.30843697339241E+71 / (720 * 1.24139155925361E+61) = 25827165 (1 * 1) / 25827165 = 3.87189224988496E-08 Or Odds Are: 1 in 25827165 CORRECT ====================== Field=54 Draw=6 Selections =25 Required Matches=6 Ways to Get Success: 720 / (720 * 1) = 1 Ways to Get failure: 1.24139155925361E+61 / (1.21645100408832E+17 * 8.8417619937397E+30) = 11541847896480 Ways total number of ways of selecting objects: 2.30843697339241E+71 / (1.5511210043331E+25 * 8.8417619937397E+30) = 1.68319147389775E+15 (1 * 11541847896480) / 1.68319147389775E+15 = 6.85712117454626E-03 Or Odds Are: 1 in 145.833794466403 CORRECT ====================== Field=54 Draw=6 Selections =54 Required Matches=6 Ways to Get Success: 720 / (720 * 1) = 1 Ways to Get failure: 1.24139155925361E+61 / (1.24139155925361E+61 * 1) = 1 Ways total number of ways of selecting objects: 2.30843697339241E+71 / (2.30843697339241E+71 * 1) = 1 (1 * 1) / 1 = 1 Or Odds Are: 1 in 1 CORRECT ====================== Field=54 Draw=6 Selections =6 Required Matches=3 Ways to Get Success: 720 / (6 * 6) = 20 Ways to Get failure: 1.24139155925361E+61 / (6 * 1.1962222086548E+56) = 17296 Ways total number of ways of selecting objects: 2.30843697339241E+71 / (720 * 1.24139155925361E+61) = 25827165 (20 * 17296) / 25827165 = 0.013393649670802 Or Odds Are: 1 in 74.6622484967623 CORRECT ====================== Field=54 Draw=6 Selections =6 Required Matches=1 Ways to Get Success: 720 / (1 * 120) = 6 Ways to Get failure: 1.24139155925361E+61 / (120 * 6.04152630633738E+52) = 1712304 Ways total number of ways of selecting objects: 2.30843697339241E+71 / (720 * 1.24139155925361E+61) = 25827165 (6 * 1712304) / 25827165 = 0.397791395222821 Or Odds Are: 1 in 2.51388042076641 CORRECT ====================== THE BELOW RESULTS DEMONSTRATES THE ERROR THAT IS OCCURING. AS YOU CAN SEE, THE ODDS GO UP THE FEWER MATCHES THAT ARE REQUIRED ====================== Field=54 Draw=6 Selections =51 Required Matches=6 Ways to Get Success: 720 / (720 * 1) = 1 Ways to Get failure: 1.24139155925361E+61 / (1.1962222086548E+56 * 6) = 17296 Ways total number of ways of selecting objects: 2.30843697339241E+71 / (1.55111875328738E+66 * 6) = 24804 (1 * 17296) / 24804 = 0.697306885986131 Or Odds Are: 1 in 1.4340888066605 ====================== Field=54 Draw=6 Selections =51 Required Matches=4 Ways to Get Success: 720 / (24 * 2) = 15 Ways to Get failure: 1.24139155925361E+61 / (2.58623241511168E+59 * 1) = 48 Ways total number of ways of selecting objects: 2.30843697339241E+71 / (1.55111875328738E+66 * 6) = 24804 (15 * 48) / 24804 = 2.90275761973875E-02 Or Odds Are: 1 in 34.45 ====================== Field=54 Draw=6 Selections =51 Required Matches=2 Ways to Get Success: 720 / (2 * 24) = 15 Ways to Get failure: 1.24139155925361E+61 / (6.08281864034268E+62 * 1) = 2.04081632653061E-02 Ways total number of ways of selecting objects: 2.30843697339241E+71 / (1.55111875328738E+66 * 6) = 24804 (15 * 2.04081632653061E-02) / 24804 = 1.23416565465083E-05 Or Odds Are: 1 in 81026.4 ====================== Field=54 Draw=6 Selections =51 Required Matches=1 Ways to Get Success: 720 / (1 * 120) = 6 Ways to Get failure: 1.24139155925361E+61 / (3.04140932017134E+64 * 1) = 4.08163265306122E-04 Ways total number of ways of selecting objects: 2.30843697339241E+71 / (1.55111875328738E+66 * 6) = 24804 (6 * 4.08163265306122E-04) / 24804 = 9.87332523720664E-08 Or Odds Are: 1 in 10128300 ====================== |
|
Job Type | Visual Basic |
Attached Files: | 20070308094548.txt |