Drawing Random Numbers with Playing Cards
An Easy Way to Get Random Numbers
Need an easy and fun way to draw random is to use a playing deck of cards. No electricity or potentially expensive electronic devices are needed, and your shuffling skills will improve dramatically.
Take a regular deck of cards, and you will only need 40 cards. Get all the Aces, ones through nines, and one set of face cards. Assign the following cards as the following values:
Any set of face card or tens: 0 (I use Jacks, see the pictures above. You can use Queens, Kings, or Tens)
To get a random number:
1. Shuffle the deck
2. Draw up to four cards
3. That card becomes the random number. Insert a decimal point anywhere if appropriate.
Why only up to four cards? There are only four digits available per deck. We are generating a samples with no replacement.
Sample four digit numbers:
8-clubs, Ace-hearts, 2-clubs, 5-diamonds: 8125
2-diamonds, Ace-clubs, 3-clubs, 5-spades: 2135
4-hearts, 8-spades, 3-diamonds, 9-spades: 4839
4-hearts, 3-diamonds, 9-slides, 8-clubs: 4398
Jacks-clubs, Ace-clubs, 2-diamonds, 2-spades: 0122
How many possible permutations are possible with this deck?
2 digits: nPr(40, 2) = 1560
3 digits: nPr(40, 3) = 59,280
4 digits: nPr(40, 4) = 2,193,360
Can we create a program to generate random numbers using this method?
Yes. I am using the TI-84 Plus CE to for this program. The TI-84 has a randIntNoRep function, which generates a list of random integers without replacement. The nice part of the is we are working with base 10, so the use of a remainder function will give the results we want: 0 through 9.
Random Sample of Integers Without Replacement:
randIntNoRep(low, high, size of the sample)
Remainder function, which can be used as the modulus function.
remainder(x, y): returns the remainder of x ÷ y
The program RANDDECK will generate a list and draw a histogram.
TI-84 Plus CE Program: RANDDECK
Disp "MAKE A 4 DIGIT,","NUMBER FROM A DECK 0-9"
Input "NO OF TRIALS: ", N
Disp "PRESS [ENTER] TO"
Pause "DISPLAY HISTOGRAM"
Here is an example.
Until next time,
All original content copyright, © 2011-2022. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.