Question

Algorithm to solve rush-21 game as quickly as possible :)

Asked by: AshuraKnight

I need an algorithm to solve this game as efficient as possible.
--------------------------------------------------------------------------

The game is here : http://www.gamecolony.com/blackjack_game_online.shtml

Please read the rules first.

And this is some method that can be used
========================================================================
11's complement method

    * Use an Ace or any two cards that add up to eleven, and throw a 10 or face card with it.
    * There are a total of 16 cards that are worth 10: four tens, four jacks, four queens, and four kings.
    * There are a total of 16 11-pairs: four 9-2 pairs, four 8-3 pairs, four 7-4 pairs, and four 6-5 pairs.
    * There are, of course four single card 11's, the aces.
    * This strategy culminates with four unused 11s with a total remainder of 44 points unused.
    * You can only score 16 21's using this method.

Revised 11's complement method.

    * Try to score a 21 with 5-5-5-6.
    * Make all other 21's with the 11's complement method.
    * You will have have four unused cards left over, with 23 points unused.
    * You can only score 17 21s using this method.

Perfect play method

    * Try to score a 21 with 6-6-9.
    * Then make a 17th 10 with 5-5.
    * Play the rest of the game with the 11's complement method.
    * You will have a single card, a 2, left over.
    * You score the maximum of 18 21's using this method.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-05-31 at 08:07:26ID22604795
Tags

game

,

algorithm

,

21

,

solve

,

Puzzle Games

Topics

Computer Games

,

Algorithms

Participating Experts
2
Points
500
Comments
12

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Card Shuffling algorithm
    Is there a standard Card Shuffling algorithm that is guaranteed to give a good shuffle?
  2. black jack
    how to write a text mode black jack programe using standard C ?
  3. Algorithm or Source for (k) Queens on NxN board
    Looking for any algorithm or source(preferably Lisp/Scheme) that solves the problem for placing K number of Queens on an NxN board, where K<=N. Also, if the algorithm includes barriers that is even better. dale
  4. game ranking algorithm
    I have developed a multi-player game system. Now I need to add ranking support to the system. Basically it's a two player game and the result can be win/lose/draw. I want to rank the players according to their results like level 1, level 2, level 3, ... etc. But there are a n...
  5. Polygon algorithms
    Hi experts Computational Geometry is not my strong point, so I need a bit of help .. algorithms (in Delphi) would be cool. I need to know whether a 2D polygon is "simple" (assuming I know the vertices). I have seen several definitions of a simple polygon( and ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: ozoPosted on 2007-05-31 at 09:24:17ID: 19189501

Are you ignoring the Gold Card and 7-7-7 rules?

 

by: AshuraKnightPosted on 2007-05-31 at 16:46:46ID: 19192235

only the 7 7 7 rules
btw gold card is black jack = jack spade and jack clover.

 

by: ozoPosted on 2007-06-03 at 09:09:56ID: 19204156

What if you get a card that can't be played under any of the above methods?
You may want to try to minimize the probability of that happening, assuming that cards are drawn at random from the remaining distribution of cards.
Given the remaining distribution of cards, you could find the number of ways of completing the columns.
But the as efficient as possible criterion may conflict with the as quickly as possible criterion

 

by: AshuraKnightPosted on 2007-06-03 at 18:18:30ID: 19205528

If the card can't be played --> discard it :)
Well because this game sort of depends on luck, I might just stick to finish this game as quickly as possible :)

 

by: ozoPosted on 2007-06-04 at 13:57:00ID: 19212010

thenn how about discarding everything?

 

by: AshuraKnightPosted on 2007-06-04 at 15:20:47ID: 19212649

then you might as well not play it :D

 

by: NovaDenizenPosted on 2007-06-09 at 17:52:59ID: 19250746

From a game theory perspective, what's your goal?

Are you wanting to play hundreds of games in the hopes of eventually getting a perfect one, regardless of what it does to your average score?
Are you wanting to maximize your average number of points scored?
Are you wanting to maximize your chance of scoring over a certain level?
Are you wanting to keep your worst-case score as high as possible?

Or are you trying for a complex combination of the above goals?

 

by: AshuraKnightPosted on 2007-06-09 at 17:58:39ID: 19250762

I would like to maximize my average number of points scored :)

 

by: NovaDenizenPosted on 2007-06-09 at 18:36:20ID: 19250956

So how many distinguishable game states are there in a game tree?

First, the draw pile.  There are 4 each of 2s through 9s.  There are 14 10s, red jacks, queens, and kings.  2 black (gold) jacks.  4 aces.  So the discard pile can have 5^8 * 15 * 3 * 5 states, or a total of 87890625 states.  A little less than 90 million.

Each stack can be in one of the following states:
empty (1)
one seven (1)
two sevens (1)
1 card & value anywhere from hard 2 to hard 10 (9)
1 card & value soft 11 (1)
2 cards & hard value from 4 to 20 (17)
2 cards & soft value from 12 to 20 (9)
3 cards & hard value from 6 to 20 (15)
3 cards & soft value from 13 to 20 (8)
4 cards & hard value from 8 to 20 (13)
4 cards & soft value from 14 to 20 (7)

These total to 82 distinct states for each stack.  Some of these can only happen in one stack (like a four card hard 8 uses all 4 2s or a soft 14 uses all aces), but I'm looking for a conservative number here.  So the stacks can have roughly 82^4 states, 45212176.

The exposed draw card can be one of the 11 distinct categories of cards, so that's a factor of 11.

For perfect play, you only need to keep track of the contents of the draw pile, the current stacks, and the top draw card. So, the exhaustive game tree has something less than 87890625*45212176*11 =~ 4^15 nodes.   At one byte per record, that's 3.9 petabytes.

So easy.  Buy google, use all their servers to exhaustively analyze the game, then use it to automate your play. :)

 

by: AshuraKnightPosted on 2007-06-10 at 03:20:03ID: 19252525

Hehehe. so it's better just to calculate if the total is more than 21 discard the card, if not put it in the pile :)
I thought there's something like card counting strategy that could be implemented here.

 

by: ozoPosted on 2007-06-10 at 09:15:46ID: 19253369

We're ignoring the 7 7 7 rules, so there are only 80 distinct states for each stack,
and the order of the stacks does not matter so it's C(83,4) not 80^4
We don't need the exposed draw card, we can take the expected value over all possible draw cards. so we only need 161509570312500 bytes

 

by: ozoPosted on 2007-06-10 at 09:31:21ID: 19253457

A soft 20 might as well be a hard 10, so we can eliminate 3 more states.
It's probably doesn't affect the expected average to ignore strategies that try to play 5 cards in more than one stack, so that cuts it down a little more.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...