Welcome Guest
Log In | Register )
You last visited December 8, 2016, 3:03 pm
All times shown are
Eastern Time (GMT-5:00)

Combinations and Statistics Help

Topic closed. 3 replies. Last post 6 years ago by RL-RANDOMLOGIC.

Page 1 of 1
PrintE-mailLink
Developer's avatar - logo2 small.jpg
Somerset
United Kingdom
Member #9710
December 17, 2004
184 Posts
Offline
Posted: January 20, 2011, 9:51 am - IP Logged

Hi, I am a software developer , many of you have proberbly used or herd of my software at some point, I am currently writing a true lottery odds calculator as an addition to the software..

I need some help, I spent over 7 hours yesterday on this and just can't seem to work out whats going wrong.

When I click on 6 / 49 I get the following output from the software

Match 6 of 6 from 49 :  = 13,983,816.0000000000 to 1
Match 5 of 6 from 49 :  = 54,200.8372093024 to 1
Match 4 of 6 from 49 :  = 1,032.3968992248 to 1
Match 3 of 6 from 49 :  = 56.6559273965 to 1
Match 2 of 6 from 49 :  = 7.5541236529 to 1
Match 1 of 6 from 49 :  = 2.4211934785 to 1
Match 0 of 6 from 49 :  = 2.2937622428 to 1

The above answers are obtained from the follow equation

i = 3
Pick = 6
Pool = 49

 Hits = Pick - i

             F3 = FNFactorial#(Pick) / (FNFactorial#(i) * FNFactorial#(Pick - i)) 
             F2 = FNFactorial#(Pool - Pick) / (FNFactorial#(Pick - Hits) * FNFactorial#((Pool - Pick) - (Pick - Hits))) 
             F1 = FNFactorial#Pick / (FNFactorial#(Pick) * FNFactorial#((Pool - Pick)))

 Result = 1 / ( (F3 * F2)  /  F1 ) = 56.6559273965 to 1

My question is
How do I arrange the equation to take into account the following.

Draw with 1 bonus number from main pool
Draw with 2 bonus numbers from main pool

Draw with 1 bonus number from unique pool
Draw with 2 bonus numbers from unique pool

Any help would be much appriciated plus I will give a free key to my software http://www.lsa-lottery-software.com to the person that solves this for me using the above format.

Regards Jamie

It has been said every software has a bug in it, it has also been said that every program can be reduced by one line of code.

There for any program can be reduced to 1 line that dont work.

    RL-RANDOMLOGIC's avatar - usafce

    United States
    Member #59354
    March 13, 2008
    3972 Posts
    Offline
    Posted: January 20, 2011, 10:22 am - IP Logged

    Hi, I am a software developer , many of you have proberbly used or herd of my software at some point, I am currently writing a true lottery odds calculator as an addition to the software..

    I need some help, I spent over 7 hours yesterday on this and just can't seem to work out whats going wrong.

    When I click on 6 / 49 I get the following output from the software

    Match 6 of 6 from 49 :  = 13,983,816.0000000000 to 1
    Match 5 of 6 from 49 :  = 54,200.8372093024 to 1
    Match 4 of 6 from 49 :  = 1,032.3968992248 to 1
    Match 3 of 6 from 49 :  = 56.6559273965 to 1
    Match 2 of 6 from 49 :  = 7.5541236529 to 1
    Match 1 of 6 from 49 :  = 2.4211934785 to 1
    Match 0 of 6 from 49 :  = 2.2937622428 to 1

    The above answers are obtained from the follow equation

    i = 3
    Pick = 6
    Pool = 49

     Hits = Pick - i

                 F3 = FNFactorial#(Pick) / (FNFactorial#(i) * FNFactorial#(Pick - i)) 
                 F2 = FNFactorial#(Pool - Pick) / (FNFactorial#(Pick - Hits) * FNFactorial#((Pool - Pick) - (Pick - Hits))) 
                 F1 = FNFactorial#Pick / (FNFactorial#(Pick) * FNFactorial#((Pool - Pick)))

     Result = 1 / ( (F3 * F2)  /  F1 ) = 56.6559273965 to 1

    My question is
    How do I arrange the equation to take into account the following.

    Draw with 1 bonus number from main pool
    Draw with 2 bonus numbers from main pool

    Draw with 1 bonus number from unique pool
    Draw with 2 bonus numbers from unique pool

    Any help would be much appriciated plus I will give a free key to my software http://www.lsa-lottery-software.com to the person that solves this for me using the above format.

    Regards Jamie

    developer

    try this link

    http://www.durangobill.com/PowerballOdds.html

      RJOh's avatar - chipmunk
      mid-Ohio
      United States
      Member #9
      March 24, 2001
      19828 Posts
      Online
      Posted: January 20, 2011, 3:21 pm - IP Logged

      Hi, I am a software developer , many of you have proberbly used or herd of my software at some point, I am currently writing a true lottery odds calculator as an addition to the software..

      I need some help, I spent over 7 hours yesterday on this and just can't seem to work out whats going wrong.

      When I click on 6 / 49 I get the following output from the software

      Match 6 of 6 from 49 :  = 13,983,816.0000000000 to 1
      Match 5 of 6 from 49 :  = 54,200.8372093024 to 1
      Match 4 of 6 from 49 :  = 1,032.3968992248 to 1
      Match 3 of 6 from 49 :  = 56.6559273965 to 1
      Match 2 of 6 from 49 :  = 7.5541236529 to 1
      Match 1 of 6 from 49 :  = 2.4211934785 to 1
      Match 0 of 6 from 49 :  = 2.2937622428 to 1

      The above answers are obtained from the follow equation

      i = 3
      Pick = 6
      Pool = 49

       Hits = Pick - i

                   F3 = FNFactorial#(Pick) / (FNFactorial#(i) * FNFactorial#(Pick - i)) 
                   F2 = FNFactorial#(Pool - Pick) / (FNFactorial#(Pick - Hits) * FNFactorial#((Pool - Pick) - (Pick - Hits))) 
                   F1 = FNFactorial#Pick / (FNFactorial#(Pick) * FNFactorial#((Pool - Pick)))

       Result = 1 / ( (F3 * F2)  /  F1 ) = 56.6559273965 to 1

      My question is
      How do I arrange the equation to take into account the following.

      Draw with 1 bonus number from main pool
      Draw with 2 bonus numbers from main pool

      Draw with 1 bonus number from unique pool
      Draw with 2 bonus numbers from unique pool

      Any help would be much appriciated plus I will give a free key to my software http://www.lsa-lottery-software.com to the person that solves this for me using the above format.

      Regards Jamie

      Ohio once had a game that picked an extra ball  for its 6/49 game from its main pool.

       combination size             6
       basic pool size              49
       (B) bonus = 7th number drawn
       smallest match no (B) number 3
       largest match with bonus     5
       smallest match with bonus    3
       tickets or chances per draw  1
       possible combos of 6/49 numbers = 13983816
       MATCHES   ODDS              WINNING COMBOS   
        6/6+0  1 : 13983816         1
        5/6+B  1 : 2330636          6
        5/6+0  1 : 55491            252
        4/6+B  1 : 22197            630
        4/6+0  1 : 1083             12915
        3/6+B  1 : 812              17220
        3/6+0  1 : 61               229600
       __________________________________________________
       overall odds are 1 : 53.6             
       260624 winning combos = 1.86 % of possible combos 

      Now with its Classic Lotto, it just has a plain 6/49 with no bonus numbers.

       combination size             6
       basic pool size              49
       (B) bonus numbers            none
       smallest match               3
       tickets or chances per draw  1
       possible combos of 6/49 numbers = 13983816
       MATCHES   ODDS              WINNING COMBOS   
        6/6    1 : 13983816         1
        5/6    1 : 54201            258
        4/6    1 : 1032             13545
        3/6    1 : 57               246820
       _________________________________________________
       overall odds are 1 : 53.6               
       260624 winning combos = 1.86 % of possible combos

      If in the future they decide to add a bonus pool of 29 numbers then it would look like this.

       combination size             6
       basic pool size              49
       (B) Bonus pool size          29
       smallest match no (B) number 3
       largest match with bonus     6
       smallest match with bonus    0
       tickets or chances per draw  1
       possible combos of 6/49 + 1/29 numbers = 405530664
       MATCHES   ODDS              WINNING COMBOS   
        6/6+B  1 : 405530664        1
        6/6+0  1 : 14483238         28
        5/6+B  1 : 1571824          258
        5/6+0  1 : 56137            7224
        4/6+B  1 : 29940            13545
        4/6+0  1 : 1069             379260
        3/6+B  1 : 1643             246820
        3/6+0  1 : 59               6910960
        2/6+B  1 : 219              1851150
        1/6+B  1 : 70               5775588
        0/6+B  1 : 67               6096454
       ____________________________________________________
       overall odds are 1 : 19                 
       21281288 winning combos = 5.24 % of possible combos

       * you don't need to buy more tickets, just buy a winning ticket * 
         
                   Evil Looking       

        RL-RANDOMLOGIC's avatar - usafce

        United States
        Member #59354
        March 13, 2008
        3972 Posts
        Offline
        Posted: January 20, 2011, 4:19 pm - IP Logged

        Hi, I am a software developer , many of you have proberbly used or herd of my software at some point, I am currently writing a true lottery odds calculator as an addition to the software..

        I need some help, I spent over 7 hours yesterday on this and just can't seem to work out whats going wrong.

        When I click on 6 / 49 I get the following output from the software

        Match 6 of 6 from 49 :  = 13,983,816.0000000000 to 1
        Match 5 of 6 from 49 :  = 54,200.8372093024 to 1
        Match 4 of 6 from 49 :  = 1,032.3968992248 to 1
        Match 3 of 6 from 49 :  = 56.6559273965 to 1
        Match 2 of 6 from 49 :  = 7.5541236529 to 1
        Match 1 of 6 from 49 :  = 2.4211934785 to 1
        Match 0 of 6 from 49 :  = 2.2937622428 to 1

        The above answers are obtained from the follow equation

        i = 3
        Pick = 6
        Pool = 49

         Hits = Pick - i

                     F3 = FNFactorial#(Pick) / (FNFactorial#(i) * FNFactorial#(Pick - i)) 
                     F2 = FNFactorial#(Pool - Pick) / (FNFactorial#(Pick - Hits) * FNFactorial#((Pool - Pick) - (Pick - Hits))) 
                     F1 = FNFactorial#Pick / (FNFactorial#(Pick) * FNFactorial#((Pool - Pick)))

         Result = 1 / ( (F3 * F2)  /  F1 ) = 56.6559273965 to 1

        My question is
        How do I arrange the equation to take into account the following.

        Draw with 1 bonus number from main pool
        Draw with 2 bonus numbers from main pool

        Draw with 1 bonus number from unique pool
        Draw with 2 bonus numbers from unique pool

        Any help would be much appriciated plus I will give a free key to my software http://www.lsa-lottery-software.com to the person that solves this for me using the above format.

        Regards Jamie

        Developer

        If I were doing this I would use different code for each.  The first for non-bonus ball games and

        then one for each of the other four.  Just prompt the user for bonus ball infomation and then route

        it to the correct code.  Using one formula to cover all the different options would be a hair puller.

        Below is the code I used for a combo, odds and probability calculator written in qb64 for non bonus

        games. As you can see I was not concerned with the lines of code . The Download link for this calculator

        is below if you want to check it out. I plan to include bonus options at a later date when I get the time

        to finish it.

        http://www.box.net/shared/8req4vjovz

         

        DIM COMBO AS LONG
        DIM cal1 AS LONG
        DIM cal2 AS LONG
        DIM cal3 AS DOUBLE

        SCREEN _NEWIMAGE(480,360, 256):
        _TITLE "RL'S Lottery Calculator Ver. 1.0"
        color 29,29
        1 cls
        color 0, 29
        locate 1, 2: PRINT "lottery Odds Calculator"
        locate 3, 2: INPUT "Enter numbers per set-> ", b
        if b > 6 then locate 4, 2: print "overrange 6 Numbers Max"
        if b > 6 then  _delay 1
        if b > 6 then goto 1
        if b < 2 then goto 1
        locate 4, 2: INPUT "Enter total numbers --> ", a
        if a > 99 then locate 4, 2: print "Overrange 99 Numbers Max"
        if a > 99 then  _delay 1
        if a > 99 then goto 1
        if a <= b then goto 1
        c = a - b


        COMBO = factorial(a) / (factorial(b) * factorial(c))
        locate 6, 2: print "Total Combos ->"; COMBO; ""
        pat$ = "0000000000"
        a1 = a-b
        a2 = b
        a3 = a1 - b
        cal1 = factorial(b) / (factorial(0) * factorial(b))
        cal2 = factorial(a1) / (factorial(a2) * factorial(a3))
        cal3 = (cal1 * cal2) / COMBO
        cal3$ = ltrim$(str$(cal3))
        h1=0
        if instr(cal3$, "-") > 0 then h1 = val(right$(cal3$, 2))
        if h1 > 0 then cal3$ = "." + mid$(pat$, 1, h1-1) + mid$(cal3$, 1, 1) + mid$(cal3$, 3, 8)
        cal4$ = ltrim$(str$(COMBO / (cal1 * cal2)))
        cal4$ = mid$(cal4$, 1, 10)
        locate 8, 2: print "Match 0| Odds = 1 in "; cal4$; ""
        locate 8, 36: print "prob ="; mid$(cal3$, 1, 14); ""

        IF b < 1 then goto endcalc
        a2 = b - 1
        a3 = a1 - a2
        cal1 = factorial(b) / (factorial(1) * factorial(a2))
        cal2 = factorial(a1) / (factorial(a2) * factorial(a3))
        cal3 = (cal1 * cal2) / COMBO
        cal3$ = ltrim$(str$(cal3))
        h1=0
        if instr(cal3$, "-") > 0 then h1 = val(right$(cal3$, 2))
        if h1 > 0 then cal3$ = "." + mid$(pat$, 1, h1-1) + mid$(cal3$, 1, 1) + mid$(cal3$, 3, 8)
        cal4$ = ltrim$(str$(COMBO / (cal1 * cal2)))
        cal4$ = mid$(cal4$, 1, 10)
        locate 10, 2: print "Match 1| Odds = 1 in "; cal4$; ""
        locate 10, 36: print "prob ="; mid$(cal3$, 1, 14); ""

        IF b < 2 then goto endcalc
        a2 = b - 2
        a3 = a1 - a2
        cal1 = factorial(b) / (factorial(2) * factorial(a2))
        cal2 = factorial(a1) / (factorial(a2) * factorial(a3))
        cal3 = (cal1 * cal2) / COMBO
        cal3$ = ltrim$(str$(cal3))
        h1=0
        if instr(cal3$, "-") > 0 then h1 = val(right$(cal3$, 2))
        if h1 > 0 then cal3$ = "." + mid$(pat$, 1, h1-1) + mid$(cal3$, 1, 1) + mid$(cal3$, 3, 8)
        cal4$ = ltrim$(str$(COMBO / (cal1 * cal2)))
        cal4$ = mid$(cal4$, 1, 10)
        locate 12, 2: print "Match 2| Odds = 1 in "; cal4$; ""
        locate 12, 36: print "prob ="; mid$(cal3$, 1, 14); ""

        IF b < 3 then goto endcalc
        a2 = b - 3
        a3 = a1 - a2
        cal1 = factorial(b) / (factorial(3) * factorial(a2))
        cal2 = factorial(a1) / (factorial(a2) * factorial(a3))
        cal3 = (cal1 * cal2) / COMBO
        cal3$ = ltrim$(str$(cal3))
        h1=0
        if instr(cal3$, "-") > 0 then h1 = val(right$(cal3$, 2))
        if h1 > 0 then cal3$ = "." + mid$(pat$, 1, h1-1) + mid$(cal3$, 1, 1) + mid$(cal3$, 3, 8)
        cal4$ = ltrim$(str$(COMBO / (cal1 * cal2)))
        cal4$ = mid$(cal4$, 1, 10)
        locate 14, 2: print "Match 3| Odds = 1 in "; cal4$; ""
        locate 14, 36: print "prob ="; mid$(cal3$, 1, 14); ""

        IF b < 4 then goto endcalc
        a2 = b - 4
        a3 = a1 - a2
        cal1 = factorial(b) / (factorial(4) * factorial(a2))
        cal2 = factorial(a1) / (factorial(a2) * factorial(a3))
        cal3 = (cal1 * cal2) / COMBO
        cal3$ = ltrim$(str$(cal3))
        h1=0
        if instr(cal3$, "-") > 0 then h1 = val(right$(cal3$, 2))
        if h1 > 0 then cal3$ = "." + mid$(pat$, 1, h1-1) + mid$(cal3$, 1, 1) + mid$(cal3$, 3, 8)
        cal4$ = ltrim$(str$(COMBO / (cal1 * cal2)))
        cal4$ = mid$(cal4$, 1, 10)
        locate 16, 2: print "Match 4| Odds = 1 in "; cal4$; ""
        locate 16, 36: print "prob ="; mid$(cal3$, 1, 14); ""

        IF b < 5 then goto endcalc
        a2 = b - 5
        a3 = a1 - a2
        cal1 = factorial(b) / (factorial(5) * factorial(a2))
        cal2 = factorial(a1) / (factorial(a2) * factorial(a3))
        cal3 = (cal1 * cal2) / COMBO
        cal3$ = ltrim$(str$(cal3))
        h1=0
        if instr(cal3$, "-") > 0 then h1 = val(right$(cal3$, 2))
        if h1 > 0 then cal3$ = "." + mid$(pat$, 1, h1-1) + mid$(cal3$, 1, 1) + mid$(cal3$, 3, 8)
        cal4$ = ltrim$(str$(COMBO / (cal1 * cal2)))
        cal4$ = mid$(cal4$, 1, 10)
        locate 18, 2: print "Match 5| Odds = 1 in "; cal4$; ""
        locate 18, 36: print "prob ="; mid$(cal3$, 1, 14); ""

        IF b < 6 then goto endcalc
        a2 = b - 6
        a3 = a1 - a2
        cal1 = factorial(b) / (factorial(6) * factorial(a2))
        cal2 = factorial(a1) / (factorial(a2) * factorial(a3))
        cal3 = (cal1 * cal2) / COMBO
        cal3$ = ltrim$(str$(cal3))
        h1=0
        if instr(cal3$, "-") > 0 then h1 = val(right$(cal3$, 2))
        if h1 > 0 then cal3$ = "." + mid$(pat$, 1, h1-1) + mid$(cal3$, 1, 1) + mid$(cal3$, 3, 8)
        cal4$ = ltrim$(str$(COMBO / (cal1 * cal2)))
        cal4$ = mid$(cal4$, 1, 10)
        locate 20, 2: print "Match 6| Odds = 1 in "; cal4$; ""
        locate 20, 36: print "prob ="; mid$(cal3$, 1, 14); ""

        endcalc:

        END1:
        Locate 22, 2: print "press n for next. e to exit";
        do
        _LIMIT 200
        k1$ = right$(inkey$, 1)
        if k1$ ="n" or k1$ = "N" then goto 1
        if k1$ ="e" or k1$ = "E"  then exit do
        loop
        system

        'function code by Galleon
        FUNCTION Factorial# (n AS DOUBLE)
        CONST maxNToCache = 99
        STATIC resultCache() AS DOUBLE STATIC firstCall AS INTEGER
        IF firstCall = 0 THEN
        firstCall = -1
        REDIM resultCache(maxNToCache) AS DOUBLE
        resultCache(0) = 1
        resultCache(1) = 1
        resultCache(2) = 2
        END IF
        IF n <= maxNToCache THEN
        IF resultCache(n) <> 0 THEN
        Factorial = resultCache(n)
        EXIT FUNCTION
        END IF
        END IF
        resultCache(n) = INT(n) * Factorial(INT(n) - 1)
        Factorial = resultCache(n)
        END FUNCTION