Blackjack with Artificial Intelligence (CS 473)

Things can certainly change quickly. By the way, now that the website design is complete, I can get to work creating a new version of the trainer. CVData software , to accurately sim any game and counting system, or the book Blackjack Attack for a ton of pre-figured stats on many games. Your method would do just as well in roulette. But you always have the best chance by playing correctly. Thanks for letting me know!

Your Answer

I am successful with player interaction! My main issue though, is I've sat here for about an hour or so thinking of how AI works and how I could use it, and I've not been able to think of anything that could work.

So I was wondering if anyone had any ideas, or was able to guide me in a direction. I do not have any code for a start of an AI, since I can't think of how to start one or work with one. That is why I'm hoping for some kind of direction. Now I will post my classes that I think is all relevant. I did leave out the Game class.

The Game Class is just for validation and checking Cards and all that amazing stuff. As someone has commented: The bank uses a fixed algorithm for all it's actions. These actions are usually? Find out your self. For the player you should definitively implement what blackjack players call "Basic Strategy". I guess a google search will give you lots of hits.

Now here is what I would have studied: Having the bank fixed strategy and the players "basic strategy" implemented, you can start doing Monte Carlo simulations to find the expectation of the game.

Try to get the MC simulation code as fast as possible since, you probably want to do a lot of MC simulations. Now try to slightly modify the deck. Try for example to remove all 5s from the deck. Then do the same MC simulation, and see if this alters the expectation. Would you like to play BJ with a deck without 5s? Now, modify the deck again.

Try to remove half of all the 10s in the deck That's half of all cards with the value How does that alter the players expectation? Now modify the deck again. Try to remove half of the non values cards.

How does that affect the expectation? Keep on modifying the deck a tiny bit, and try to get an understanding of how a small bias in the distribution of remaining cards affect the expectation. You should use this understanding to adjust the stake of the game. Maybe you can train a neural net or some other estimating algorithm to estimate the expectation of the game based on the known remaining cards in the deck? You have to keep track of the cards remaining in the shoe. Maybe you can even connect the MC simulation tool to the training algorithm to give you a kind of reinforcement learning algorithm.

This is actually starting to sound like real geek fun! Or maybe you can get the MC-simulator to be so fast that get a good answer of the expectation on the fly. When you have found a good way to estimate the expectation of the game, given the remaining cards in the shoe and "basic "strategy" , which is fast enough, you may be able to implement a reinforcement learning algorithm for the money management. You will want to create a heuristic function that scores all possible moves an A. This heuristic function takes in all available data that a player has access to, and the higher the score, the better the move.

It should take into account the probabilities of getting the specific card needed, vs. In general you should not rely primarily on an imperative language to create your Blackjack player unless you are just going to focus on search as a primary and probably only strategy. Instead please take a look at Clips production rules or Drools in order to quickly create a prototype.

There is an initial learning curve there. Basically production rules, logic programming, neural nets and genetic algorithms are general purpose approaches that incorporate search in the execution or learning phase. So why use these over just search? After all search algorithms are very powerful. Because production rules, logic programming, neural nets and genetic algorithms are more powerful than just applying a search algorithm and enable you to focus on your problem representation.

Another thing to consider is that in Blackjack you will want to incorporate probability as well and maybe card counting! This also depends on how many high cards have been played. This software seems really biased. Did anyone have the same issue? Or the software is rigged? I am surprised at so many comments that sound so professional, but how naive so many players are.

The odds are against you from the start and yes you can practice and count cards all you like, but lady luck always, always wins. If you play long enough the chance of you losing actually becomes less likely than you getting hit by a car or dying on your way to the casino.

Am I ready to take on the casino? I started at I won 23 lost I did lost most of my bigger bets but I got some double downs and I as well won my smaller ones to build up to the back and forth with the same until I got a few momentum. I never went back to base and was down over at a time.

I lost most of my bigger bets. I lost the most double downs I had lost so far. I lost majority of my bigger bets and I lost most of the double downs. I as well only went to max bet I as well had a few blackjacks and the dealer had some blackjacks. You played 49 hands. I won 14 hands and lost I as well lost my double downs so that is why I was down so much money just on a short sample.

I am nobody in the gambling the world and seen as a fool but under new supervision I have decided to put more research and depth into blackjack. Now I have so much negative experience putting my money on the tables and watching it exchanged for plastic cheques.

Seeing my pile grow from its existing and watching it dwindle upon consecutive losses. What I do have to offer is some data and thoughts to think about for anyone who choses to read my comment.

You should read this: It becomes literally impossible for you to win if you play enough hands because of the law of large numbers. Which is this http: I absolutely agree but at the same time you are not looking at the overall negative play on the game itself and how to use it to your advantage.

I have won 7 hands out of I am of course down money and actually. I am as well at the mark of betting. Each of your bets have a Regardless of how you wager it. Your method would do just as well in roulette. Raising your bet or lowering it based on whether you win or lose is bullhonkey. Hopefully Tum can have the new developers take a look. In the meantime, have you tried another browser? This sounds like a memory allocation issue, and another browser may behave differently.

My question is , when playing against 6 decks, with late surrender offered, dealer must stand on soft 17, what is your surrender strategy, including a pair of 8s. I made a mistake. I would have only posted one time and just played more hands but I was getting beaten so bad I thought I might run out of chips if I go through another down swing when a hot deck comes.

That spread is definitely sufficient to beat this game. I no longer have a copy of Blackjack Attack handy to look up the effect. If you want insurance, you put an insurance bet in its bet circle before you click on the continue arrow.

Since I sold the BlackjackInfo site in , I am not involved in the development of the new version of the trainer. Your best bet may be posting on the message forums, where your comments are more likely to be noticed.

It used to tell me I should split a pair of 7s against a Every so often I see some ridiculous error in it. We are actually looking to revamp the trainer at some stage in the future too so your feedback and suggestions are appreciated! Wish you would modify the program to allow you to select a counting method from a few popular ones and them display the true count somewhere on the screen. I use KO while playing this and it would be helpful if I knew how accurate I was counting. Am I looking like I have an edge over the game or is this sample size too small to be meaningful?

If so, you are doing very good. But it would be best to make a judgement after more hands have been played, such as 10K to 20K. I stopped playing because once you start playing enough hands the program starts to get slow. Thank you for providing such a nice training game, it is very informative and a valuable training tool. I do find the screen difficult to see as the contrast seems to be on the weak side.

Other than that one minor issue your game is excellent. Hi i have just started playing blackjack and i am doing fair your basic strategy game is a wonder. I am new to this Blackjack world, but have played around the world. Right now I live in Germany so I have many casinos in many countries to play.

The casinos in Europe they use the same basic rules though they are smaller compared to U. Reminds me of the old days when people dressed up or like a James Bond movie, really cool to see. I forgot to mention I have noticed on a second hit it sends two cards not one, The game also freezes up and at times gets really slow after so many hands.

I have enjoyed your Blackjack Trainer and I have learned enough to say it has helped me become a better player. You probably already know this, but as good as the Trainer is, it has a few fawls. Such as when a high card appears just about every time like clockwork it equals This makes the Trainer seem to have somewhat unrealistic outcomes.

I would like this because I was playing the App and stayed on 16 vs a dealer 10 in a high true count and it said my play was wrong. I think this would be a cool addition. Can someone post the correct basic strategy deviatons for a hard 10? Someone please correct me if I am wrong.

I noticed the trainer looked different and saw that it had been updated. No, you are likely being confused by the way it pays the bet and then rebets the same amount. I know that my question may be silly, but I am looking for simple methods to win, the casino give us a lot of possibilities and it confuses.

The worst blackjack rule give more opportunities than other games. Which rules are best? Winning balance always goes the line of sinusoid. Thought you should know. See notes from others as well. This new version has bugs. Playing 6D, H17, LS. I made sure the new site owners are aware of these comments. So with Ace,7 vs a dealer 5, you would double. With 3,4,Ace you would stand, because doubling is not allowed after you hit. Same situation on the I-pad version and the I-Mac desktop version, inability to hit the second hand after splitting..

Sometimes when I split aces I only receive one card on the first ace and no card on the second ace. Just wondering if anyone else is getting errors such as these. Now that the message boards are reopened, these kinds of questions will get faster and more accurate answers there. I too find the white border glaring and gives me a headache. Needs to be toned down or different color softer on the eyes. Your trainer is the best out there that I have been using these past 30 years. It amazes me to see soo many players play by the seat of their pants having not a clue what they are doing.

CVCX is a slightly less expensive option that handles many simulation questions. While this improvement is small, every little bit helps. For a card counter, surrender is considerably more valuable for several reasons.

The amount of benefit surrender provides for a counter depends on almost everything that can change in the game, penetration, bet spread, etc. If you need an answer, get some software to check your specific conditions. See Blackjack Surrender Explained. What are they doing to this site? What happened to the original strategy page, where you selected the number of decks and dealer hits or stands on soft 17 etc.?

The Strategy Engine is still where it has been for years: I recommend posting this question on the newly re-opened blackjack forums to see if anyone can run a simulation for you with these conditions and betting strategy. In the short run, if you are lucky you will win. If you are unlucky you will lose. But you always have the best chance by playing correctly. Again, I am sure about my counting and the only thing would be a shallow penetration or software that does not use randomly a full deck of cards.

Or where am I wrong? You would only expect to reach the exact expected end count if you saw every card in the deck. The trainer mimics what you will see in a real casino, shuffling after the end of the hand where the 35th card is dealt in the single deck game.

The deck s are normal, and randomly shuffled. Is that because of penetration or??? I really enjoy your practice platform. I was wondering, can we play online and make money or should we avoid that and only play in casinos? Card counting is not much of an option online, although the possibility does exist in the live-dealer games that a few places offer. The bonuses and promotions can also be profitable sometimes, but these days it is tough to get an actual positive play at online casinos.

So it really depends on what you want from the game. All set now, and back to work. Will you post something in this section when the new version is out? I want to wait and get the latest. In the mean time what book or video do you recommend on winning at blackjack? I have only played about 5 times not counting cards at the casinos on the 21 plus 3 card tables and have had some decent luck, especially the 3 card bet and would like to learn a bit more about that betting too.

Thanks for your practice game, it has been helpful. Things can certainly change quickly. BlackjackInfo has a new owner who took over this month. I know the new team has some excellent resources available for blackjack trainer software.

If you are referring to the other product on this page, Casino Verite is not involved in these changes, and the latest version is available as always at the provided Amazon links. Going to Vegas in Sept. I have basic strategy down. If you plan to count, you will need to look a lot harder to find decent regular shuffled games at that level. The first thing to check is make sure that blackjack pays 3: Check TI for some decent low-limit blackjack tables, or look downtown.

The rules are generally going to be 6 deck or 8 deck, dealer hits soft 17, no surrender. Yes, you are right that Flash is dying. My development of the new mobile-friendly HTML5 version has been stalled a bit while my family prepares to move this summer.

And yes, I get about an equal number of complaints about the game being rigged to be too easy and too hard. Ken, I just jumped on the trainer after a few months absence. Started reading the comments and noticed that you will be launching a revised version.

Any idea of the approximate launch date? Looking forward to the new version. Thanks again for a great strategy trainer! I will resume development in August, so I now expect a launch in the fall at the earliest. Assuming the same rules, BS, and betting pattern?

If prior history is repeated, I will be inundated with emails asking why I made the game so much harder to beat, along with an equal number asking why I made it so much easier to beat! That would be called luck. What algorithm is used for card shuffling? I think the trainer play along me. When is using late surrender with the dealer ace trainer first offers surrendering instead of insurance.

And again I continue to win. May be there is a reason to imitate dealers shuffling, instead of mathematical random shuffling. You may be right about the surrender issue, although it is possible that the surrender may only work if the dealer does NOT have blackjack. Is there an iOS app version of this trainer for my iPad?

Please email your response. The new mobile-friendly version is coming along slowly. I now think early Summer is the target. Emailed also as requested. Suggestion for future versions of your Strategy Trainer; ties push, rather than dealer wins all ties….?

The current Strategy Trainer works just fine in this regard. Ties are a push. You are being confused by the way the bankroll is adjusted up when the bet is returned to your bankroll, and then down by the bet being made again. If you happen to look at the wrong moment, you only see the second half of that transaction.

It works as it should. Yes, you can play as many spots as you like at the table in Casino Verite. And you can choose to have other spots played by automated players if you like.

There is no download for the trainer here. If your device is not compatible with Flash, the current version hosted here on this page will not work. How come when you split Aces and then get another Ace the program will not let you split beyond two hands that is a flaw that needs to be corrected asap.

Yes, there is a problem with split Aces in the current version. A completely new trainer is in development and coming along nicely. Ive been playing on your trainer web getting ready to go to the casino. I noticed that amount won many times is not added to the total. I thoutht maybe I was making a mistake but after careful watching of several hundred hands I confirmed that to be the case. Kind of makes me wonder if the rest of the software has a problem. Check it out and let me know what gives.

No, there is no problem with the paying of winning hands in the free game. The confusion comes from the way that your balance increases after the hand, and then immediately decreases again as the next bet is automatically made.

Many people only notice the second part and think their balance is going down after a winning hand. Single deck, S17, DAS, 15 vs According to your B. What it the correct play? Does the discrepancy have to do with hand composition? The correct strategy is hit. I checked the source for the trainer, and it does appear this is a bug. In 2 or more decks S17 LS, you should surrender 15vT. In 1 deck S17 LS, you should hit.

The trainer is inaccurate, only in the one deck version. Thanks for pointing this out. Another option which might be nice for the next version: Those questions are going to depend on your edge and how willing you are to play with an advantage for these long periods. See my other reply for advice on software or books to answer those questions. Your advantage is going to heavily depend on your bet spread, and the bet ramp. CVData software , to accurately sim any game and counting system, or the book Blackjack Attack for a ton of pre-figured stats on many games.

Something I noticed is that the dealer will still hit even if their first two cards have a greater total than mine and its under No sane dealer in real life would hit when they already have a total greater than yours, right? The dealer must follow the strict rules on hitting, and cannot choose to stand on a stiff total just because he would beat you.

For more, see Blackjack Rules. Thanks for the BJ game. The black letters on the green are a little hard for me to see. Hi, can i use the basic srategy playing rng bj like the one playtech offer in many different online casino, will it have the same effect as playing live casino? How about an option to turn off the card total display? I have a LONG way to go yet. It would be stellar if the trainer could be configured to only deal the most difficult combinations for the player.

The strategy engine on hitorsplit. I was wondering what should a player do if he lost the count of the cards dealt and does the count have to always be exact? The count does not have to be exact, but there are a few really dangerous mistakes you can make. If for example, you flip the sign, turning a negative count into a positive count, that would make you bet bigger money into bad situations. Obviously an expensive mistake. If you truly lose all track of where the count is, just flat-bet the minimum until the shuffle.

Thank you very much I was also wondering should a player enter the deck just as it has been shuffled and if not how should a player determine a count when there is only half of the deck to start with? You can start any time during the shuffle. Just think of the cards already in the discard tray as being behind the cut card instead. But everything works just the same.

I was also wondering how should a player go about betting when counting say the minimum bet is 2 and the maximum 10 with the bankroll of at what count would you advise to increase bets from the minimum?

Doubling down gives a chance to double the amount of your bet after seeing your first two cards. You mentioned a hand with a total of 10 in the first two cards. For a full explanation of doubling, see Blackjack Rules: Part 3 — Player Choices. A new question regarding Lucky Lucky. I tried searching it up and apparently the Lucky Lucky LL bet is a profitable game when card counting is taken into consideration apparently 2 deck is best for it. If you are expecting a bunch of face cards to peel off, or blackjacks and the dealer has a 10, you can still win those bets fairly often.

Hello Again, I recently finished my first month of card counting adventures. There have been times where I have bet 20 units and lost 80 units from splits and dd. With your experience, what do you think a general estimated or spread would make hourly in betting units?

Hello thanks for previous answers, new question! I have a relatively small bankroll and comps and match plays really make a huge impact on my future game have not frequented many times yet , but wanted to clarify some thoughts.