Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
Solved

# Wildcards and Statistics

Posted on 2006-05-17
Medium Priority
290 Views
I have a stack of numbered and colored cards.
Colors are red, blue, green. Numbers are 1, 2, 3.
There are four copies of each number in each color (a total of 36 numbered cards).

A winning hand contains:
- Four 1's and four 3's, all of the same color (that's 8 red cards OR 8 blue cards OR 8 green cards)
- Three pairs of 2's, one in each color (that's 2 red cards AND 2 blue cards AND 2 green cards)

There are 8 jokers/wildcards, which may be used in place of any of the numbered cards.

If I draw 14 cards at random, how do I find the probability of drawing a winning hand?

If there were no jokers, then the number of ways to draw a winning hand is (8c8 * 3c1) * ((4c2)^3 * 3c3) = 648, and the number of ways to draw any hand is 36c14 = 3 796 297 200, yielding a probability of 1.78E-71.

But I don't know how to add in the jokers.
0
Question by:snoyes_jw
• 6
• 4
• 2

LVL 27

Expert Comment

ID: 16700565
The jokers give you more cards from which to draw but they also increase the number of winning hands
for example a winning type 2 hand would be, in addition to the hands you have used, 1 red + 1j or 2j (repeat for the other color combination needed)
0

LVL 33

Author Comment

ID: 16708075
Obviously.

But since there are 14 cards in the hand, and I have only 8 jokers, I can't just add a joker for each one. If all the 1's and 3's are replaced with jokers, there are none left for the 2's.  So the sets of 2's are no longer independent from the sets of 1's and 3's.
0

LVL 27

Expert Comment

ID: 16710436
You do the calcultion exactly the same as you did befor except that now you draw from 44 cards and there are more winning hands.
True you only have 8 jokers but you have only 4 green 1s.
0

LVL 33

Author Comment

ID: 16737976
That doesn't really answer the question.
0

LVL 85

Expert Comment

ID: 16738476
I count 648 winning hands with 0 jokers
6480 winning hands with 1 jokers
29700 winning hands with 2 jokers
82704 winning hands with 3 jokers
156390 winning hands with 4 jokers
212628 winning hands with 5 jokers
214659 winning hands with 6 jokers
163800 winning hands with 7 jokers
94752 winning hands with 8 jokers
for a total of
961761 out of 44C14
0

LVL 33

Author Comment

ID: 16742294
And how do you arrive at those numbers, ozo?
0

LVL 85

Expert Comment

ID: 16744510
Tediously.
for 0 jokers
8c0 * (4c4 * 4c4)*3 * 4c2 * 4c2 * 4c2
for 1 joker
8c1 * (4c3 * 4c4)*3 * 4c2 * 4c2 * 4c2
+
8c1 * (4c4 * 4c3)*3 * 4c2 * 4c2 * 4c2
+
8c0 * (4c4 * 4c4)*3 * 4c1 * 4c2 * 4c2
+
8c0 * (4c4 * 4c4)*3 * 4c2 * 4c1 * 4c2
+
8c0 * (4c4 * 4c4)*3 * 4c2 * 4c2 * 4c1
...
0

LVL 85

Accepted Solution

ozo earned 2000 total points
ID: 16744521
for 1 joker
8c1 * (4c3 * 4c4)*3 * 4c2 * 4c2 * 4c2
+
8c1 * (4c4 * 4c3)*3 * 4c2 * 4c2 * 4c2
+
8c1 * (4c4 * 4c4)*3 * 4c1 * 4c2 * 4c2
+
8c1 * (4c4 * 4c4)*3 * 4c2 * 4c1 * 4c2
+
8c1 * (4c4 * 4c4)*3 * 4c2 * 4c2 * 4c1
0

LVL 33

Author Comment

ID: 16744971
Ok, I follow that.  If you'll kindly check how to do it with 2 jokers, I think I can follow the pattern for the rest.  I used the following, and it came to 831600:

8c2 * (4c2 * 4c4)*3 * 4c2 * 4c2 * 4c2
+
8c2 * (4c4 * 4c2)*3 * 4c2 * 4c2 * 4c2
+
8c2 * (4c3 * 4c3)*3 * 4c2 * 4c2 * 4c2
+
8c2 * (4c4 * 4c4)*3 * 4c0 * 4c2 * 4c2
+
8c2 * (4c3 * 4c4)*3 * 4c1 * 4c2 * 4c2
+
8c2 * (4c4 * 4c3)*3 * 4c1 * 4c2 * 4c2
+
8c2 * (4c4 * 4c4)*3 * 4c2 * 4c0 * 4c2
+
8c2 * (4c3 * 4c4)*3 * 4c2 * 4c1 * 4c2
+
8c2 * (4c4 * 4c3)*3 * 4c2 * 4c1 * 4c2
+
8c2 * (4c4 * 4c4)*3 * 4c1 * 4c1 * 4c2
+
8c2 * (4c4 * 4c4)*3 * 4c2 * 4c2 * 4c0
+
8c2 * (4c3 * 4c4)*3 * 4c2 * 4c2 * 4c1
+
8c2 * (4c4 * 4c3)*3 * 4c2 * 4c2 * 4c1
+
8c2 * (4c4 * 4c4)*3 * 4c1 * 4c2 * 4c1
+
8c2 * (4c4 * 4c4)*3 * 4c2 * 4c1 * 4c1
0

LVL 33

Author Comment

ID: 16745000
And I calculate the results for 1 joker as 51840, using the expression you posted.
0

LVL 85

Expert Comment

ID: 16745168
You're right, I miscounted the first time, forgeting to multiply by 8c2
Also watch out for
8c8 * (4c0 * 4c0)*1 * 4c2 * 4c2 * 4c2
not
8c8 * (4c0 * 4c0)*3 * 4c2 * 4c2 * 4c2

0

LVL 33

Author Comment

ID: 16745208
Groovy.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of data encryption, what it is, how it works, and why it's important. If you've ever wondered what goes on when you "encrypt" data, you can look here to build a good foundation for your personal learning.
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data definâ€¦
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templaâ€¦
###### Suggested Courses
Course of the Month11 days, 16 hours left to enroll