Problem 43969. Sleeping Queens 1
My youngest daughter received a card game named Sleeping Queens for Christmas this year, and has been playing it nearly non-stop since opening it.
You are dealt five cards, most of which have numbers 1-10 on them. There are other cards, but for now we will just deal with the numbers. You can discard cards in any of three different methods and draw that many new cards:
- Individual cards, one at a time
- Pairs of cards, but not three or four of a kind
- Cards that make up an addition problem.
Write a MATLAB script that will tell you how how many different ways you can discard cards in your hand.
For example, if your hand had the cards [1 2 2 4 9], you could discard
- Any of the cards individually (5)
- The pair of 2s (1)
- [2 2 4] because 2+2=4 (1)
- [1 2 2 4 9] because 1+2+2+4=9 (1)
so your script would output 8. Likewise, a hand of [1 2 2 2 6] would allow you discard cards 9 different ways:
- Any of the cards individually (5)
- Any of the three different pairs of 2s (3)
- [2 2 2 6] because 2+2+2=6 (1)
So the output of your script for [1 2 2 2 6] should be 9. We don't need to know what the possible combinations are to discard just yet; we just need to know how many there are. Good luck, and happy hunting!
Solution Stats
Problem Comments
-
2 Comments
Good problem
Wouldn't [2 2 2 6] make a three of a kind?
Solution Comments
Show commentsGroup

Physics
- 18 Problems
- 13 Finishers
- Mechanics 1
- jogging?
- Bouncing disk
- Energy of an object
- Kepler's Equation
- Mechanical Advantage of a Gear Train
- What gear ratio does the cyclist need?
- Bernoulli's Equation
- Juggling
- Find the jerk
- Determine if a four bar mechanism is of Grashof type
- center of mass
- Center of mass
- Elastic Collision 001: 1-D
- Calculate compression ratio of engine
- Distance of the centroids of the balls
- Calculate the height of an object dropped from the sky
- How Far Can You Throw Something?
Problem Recent Solvers28
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!