Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. I'm Looking For An Algorithm To Optimize Keno Selections

I'm Looking For An Algorithm To Optimize Keno Selections

Scheduled Pinned Locked Moved Algorithms
questiongame-devalgorithmstutorialcode-review
22 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Luc Pattyn

    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. :) 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.

    M Offline
    M Offline
    musefan
    wrote on last edited by
    #12

    Cannot validate it myself but have a 5 just for such a good looking answer :-D

    return 5;

    1 Reply Last reply
    0
    • M musefan

      I agree, the probability of winning at gambling is always less than 50% (usually a lot less) otherwise there would be nowhere to gamble

      return 5;

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #13

      musefan wrote:

      always less than 50%

      not quite. The way roulette works, they win when 0 gets drawn, as it isn't considered part of any combination (red, black, less, more, odd, even, etc), so for any 37 units you play, you can expect 36 to return and 1 to loose. That's about a 3% profit on all the stakes for every turn of the table, not too bad for the casino. :)

      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.

      1 Reply Last reply
      0
      • R Roger Wright

        GlobX wrote:

        you're not actually going to use this with real money are you?

        Sure! I play a little Keno in any case, so why not approach it scientifically? :-D

        Will Rogers never met me.

        A Offline
        A Offline
        agolddog
        wrote on last edited by
        #14

        Because the house edge in Keno is the among the highest in the casino. Better to run over to the roulette wheel and put the same money on red or black. You'll still lose it, but at a much lower rate.

        R 1 Reply Last reply
        0
        • A agolddog

          Because the house edge in Keno is the among the highest in the casino. Better to run over to the roulette wheel and put the same money on red or black. You'll still lose it, but at a much lower rate.

          R Offline
          R Offline
          Roger Wright
          wrote on last edited by
          #15

          Ah, you're just not in the spirit of gambling! :-D Over time, all casino games (except Craps) favor the house. But people do get lucky and nail a large win before losing a like amount. That hope is what keeps the industry alive. I have personally hit 6 of 6 on Keno twice this year, which pays off about 360:1, within the first few minutes of play. From years of playing, and watching players, I've learned that only one strategy works - play for a short time, and if nothing hits, walk away. If you do get a big win early on, walk away with it. That last is the hardest, by the way. It's really tempting sometimes to think that the machine is on a winning streak and more will follow. It does happen, but not often enough to make it worth trying.

          Will Rogers never met me.

          L J 2 Replies Last reply
          0
          • R Roger Wright

            Ah, you're just not in the spirit of gambling! :-D Over time, all casino games (except Craps) favor the house. But people do get lucky and nail a large win before losing a like amount. That hope is what keeps the industry alive. I have personally hit 6 of 6 on Keno twice this year, which pays off about 360:1, within the first few minutes of play. From years of playing, and watching players, I've learned that only one strategy works - play for a short time, and if nothing hits, walk away. If you do get a big win early on, walk away with it. That last is the hardest, by the way. It's really tempting sometimes to think that the machine is on a winning streak and more will follow. It does happen, but not often enough to make it worth trying.

            Will Rogers never met me.

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #16

            I could come up with some formula's for red and black probabilities on the roulette... :-D

            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.

            1 Reply Last reply
            0
            • R Roger Wright

              Ah, you're just not in the spirit of gambling! :-D Over time, all casino games (except Craps) favor the house. But people do get lucky and nail a large win before losing a like amount. That hope is what keeps the industry alive. I have personally hit 6 of 6 on Keno twice this year, which pays off about 360:1, within the first few minutes of play. From years of playing, and watching players, I've learned that only one strategy works - play for a short time, and if nothing hits, walk away. If you do get a big win early on, walk away with it. That last is the hardest, by the way. It's really tempting sometimes to think that the machine is on a winning streak and more will follow. It does happen, but not often enough to make it worth trying.

              Will Rogers never met me.

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #17

              Roger Wright wrote:

              Over time, all casino games (except Craps) favor the house.

              In general all games in which the house pays the players favors the house. Variations of this are because the way in which the odds were calculated was flawed or because the game itself is flawed. Those variations very seldom occur. They often involve odd circumstances. And casual play will not reveal it because such play would quickly expose such problems as the house take would not be following the expected income.

              1 Reply Last reply
              0
              • R Roger Wright

                I used to be pretty good at this stuff, but I just can't get a handle on how to express this properly. Thirty years takes a toll on remembered math, so I hope someone more recently experienced with probability can steer me back on course. In the game of Keno there is a field of 80 numbers, from which 20 are selected for each round. Players pick from n = 3 to 20 numbers and hope that n of them will come up in the next round. In reality, far fewer than n usually pop up, and I'd like to know the probability of each combination occurring. For instance, suppose I pick 6 numbers. How can I calculate the probability that 3 of my numbers will be among the 20 drawn? 5? The simple approach of calculating draws doesn't work, since the classic method I remember determines the probability of all 3 numbers coming up in 3 draws. But given that 20 draws are made regardless of how many I pick changes things considerably. I just can't figure out how to express it. Anyone care to take a crack at it? :-D

                Will Rogers never met me.

                T Offline
                T Offline
                trooper0814
                wrote on last edited by
                #18

                Free Keno Flash game to try your theories :laugh: actually a fun game...... http://a-game.co/Keno/[^][^]

                1 Reply Last reply
                0
                • M musefan

                  I agree, the probability of winning at gambling is always less than 50% (usually a lot less) otherwise there would be nowhere to gamble

                  return 5;

                  K Offline
                  K Offline
                  Kirk Wood
                  wrote on last edited by
                  #19

                  Actually, sometimes a casino relies on people's lack of knowledge. There are two games in which people who play correctly will come out ever so slightly ahead of the house. They are straight video poker and craps. Even so, people routinely go for the big bucks ahead of their odds and loose plenty of money to the house. In theory you can also get ahead of the odds in Blackjack if the house allows it. But they guard against card counting quite well in the large gaming centers. In Keno, the best strategy is to not think you can beat the system. So don't play unless the enjoyment of playing is worth the cost of loosing every time you purchase. I don't see a huge difference between a person who spends say $20 at a theater for two hours of enjoyment and one who spends $20 playing Keno for a couple hours of enjoyment.

                  R 1 Reply Last reply
                  0
                  • K Kirk Wood

                    Actually, sometimes a casino relies on people's lack of knowledge. There are two games in which people who play correctly will come out ever so slightly ahead of the house. They are straight video poker and craps. Even so, people routinely go for the big bucks ahead of their odds and loose plenty of money to the house. In theory you can also get ahead of the odds in Blackjack if the house allows it. But they guard against card counting quite well in the large gaming centers. In Keno, the best strategy is to not think you can beat the system. So don't play unless the enjoyment of playing is worth the cost of loosing every time you purchase. I don't see a huge difference between a person who spends say $20 at a theater for two hours of enjoyment and one who spends $20 playing Keno for a couple hours of enjoyment.

                    R Offline
                    R Offline
                    Roger Wright
                    wrote on last edited by
                    #20

                    Kirk Wood wrote:

                    I don't see a huge difference between a person who spends say $20 at a theater for two hours of enjoyment and one who spends $20 playing Keno for a couple hours of enjoyment.

                    Exactly. Playing Keno is about as interesting as watching a PC run while betting that an alpha particle will take out a bit in the RAM. The odds are similar, too. But my favorite lady loves the game, and luckily prefers to play $.05 at a time, so I can spend hours of "quality time" with her for the price of a movie ticket and popcorn. Once in a while, she hits a big one and it really brings a smile to her face! Last week she hit 6 out of 6 on my birthday, and that was in a bonus round when jackpots are doubled. A win of $300 on a bet of 5 nickels is nothing to sneeze at, and creates a lot of joy for a lady with too little of it in her life. :-D I knew about craps, but I don't play it as it is awfully fast and intimidating to me; I just don't understand the rules, I guess. But I didn't know that straight video poker has a slight edge for the player. I usually play the Double Double Bonus poker, because of the payout for a 4 of a kind with a 'kicker', even though I know the lower hands pay out less than normal. What would be an optimal selection strategy for normal video poker? For example, in DDB poker, pairs are preferred over a single face card, as a pair of face cards pays even money, but 3 of a kind pays 3 to 1. In Deuces Wild, I save 2s and pairs, because Jacks or better pays nothing. Is there a strategy that works best for the stright poker game?

                    Will Rogers never met me.

                    1 Reply Last reply
                    0
                    • R Roger Wright

                      I used to be pretty good at this stuff, but I just can't get a handle on how to express this properly. Thirty years takes a toll on remembered math, so I hope someone more recently experienced with probability can steer me back on course. In the game of Keno there is a field of 80 numbers, from which 20 are selected for each round. Players pick from n = 3 to 20 numbers and hope that n of them will come up in the next round. In reality, far fewer than n usually pop up, and I'd like to know the probability of each combination occurring. For instance, suppose I pick 6 numbers. How can I calculate the probability that 3 of my numbers will be among the 20 drawn? 5? The simple approach of calculating draws doesn't work, since the classic method I remember determines the probability of all 3 numbers coming up in 3 draws. But given that 20 draws are made regardless of how many I pick changes things considerably. I just can't figure out how to express it. Anyone care to take a crack at it? :-D

                      Will Rogers never met me.

                      M Offline
                      M Offline
                      Mwanzia_M
                      wrote on last edited by
                      #21

                      To get the probability of getting 3 numbers correct just take the total number of selected values divided by the total number of balls. This gives 3 divided by 80 , not 20. The probability of getting 6 numbers correct is therefore 6/80. To determine the probability of your lucky numbers appearing in any number of consecutive draws take this following example. Whats the probability of 3 of your numbers appearing in four draws? Its simply got by multiplying individual probabilities by each other. So the answer should be got by getting (3/80)cubed or raised to power three, ie, (3/80)^3 if you have the zeal and will, i can make you a more elaborate c# software showing the workings of probability in action free of charge but it will take a while.

                      R 1 Reply Last reply
                      0
                      • M Mwanzia_M

                        To get the probability of getting 3 numbers correct just take the total number of selected values divided by the total number of balls. This gives 3 divided by 80 , not 20. The probability of getting 6 numbers correct is therefore 6/80. To determine the probability of your lucky numbers appearing in any number of consecutive draws take this following example. Whats the probability of 3 of your numbers appearing in four draws? Its simply got by multiplying individual probabilities by each other. So the answer should be got by getting (3/80)cubed or raised to power three, ie, (3/80)^3 if you have the zeal and will, i can make you a more elaborate c# software showing the workings of probability in action free of charge but it will take a while.

                        R Offline
                        R Offline
                        Roger Wright
                        wrote on last edited by
                        #22

                        Thanks for the kind offer, but no thank you. Your algorithm is seriously flawed, yielding a higher probability of getting 6 right than three. But I appreciate the offer! :-D

                        Will Rogers never met me.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups