## Friday, June 16, 2017

### using a coin as a 7-sided die

This method doesn't result in evenly distributed probabilities, but I've found it useful all the same. I want to have a random rest-and-fasting day every week, so how can I randomly select one day out of seven to be that special day? An idea came to me: I can use a regular old coin! The coin-toss method works this way:

1. Let heads = Sunday through Wednesday (4-day range).
2. Let tails = Wednesday through Saturday (4-day range).
3. First toss (or 2 out of 3) determines which half of the week will contain the special day.
4. Second toss: let heads = first two days; let tails = second two days.
5. Third toss: let heads = the 1st of the 2 remaining days; let tails = the 2nd.

Et voilĂ !

How this works in a practical sense:

1. I flip the coin; it comes up heads, so I know my special day will be S, M, T, or W.
2. I flip the coin again; it comes up tails, so now I know my special day will be T or W.
3. I flip the coin a third time; it's heads, so I know my special day will be T.

And there we go. On the designated day, I'll take a break from working out, but I'll also fast.

Of course, by doubling up on Wednesday, I increase the chance that Wednesday will be my "random" day (i.e., Wednesday will always make it past the first coin toss). If you can think of a better way to select randomly from among seven days with equal probability, let me know in the comments, and I might even adopt your method.

#### 7 comments:

1. I always go to random.org for my randomness needs.

1. I'll check it out. Thanks.

2. Go to:
http://www.mathgoodies.com/calculators/random_no_custom.html

set lower limit = 1
set upper limit = 7
press enter

This generates a random integer between 1 and 7, inclusive.

It is based on the algorithm [integer = random X 7 + 1], where "integer" is truncated, and "random" is a machine-generated random number between 0.0 and 1.0, exclusive of the endpoints.

Your coin-toss method will choose Wednesday twice as often as any other day.

3. Henry,

You're right about the coin-toss method, of course. I'll check out the site you've recommended. Charles's site claims to employ "true randomness" through the constant checking of atmospheric disturbances.

4. "True randomness" is a meaningless expression. There are many practical measures of randomness that can compare the efficacy of various random number generators. But the "truth" of any such generator is a relative term.

In any case, I don't think your application requires any sort of strenuous search for the ultimate random number generator.

Download a random number generator app for your smartphone, then use the algorithm I specified to pick your random day of the week.

5. Here is a way to simplify your "coin toss" scheme by using a 6-sided die:

For week #1 arbitrarily eliminate one weekday, let's say Sunday (but any other choice will do). Roll the die (1-6) to determine your off-day from (M, T, W, T, F, S). Suppose you roll a 3. Then your off-day for week #1 will be Wednesday.

For week #2 you eliminate Wednesday from your choices, namely (M, T, T, F, S, S). Suppose you roll a 5. Then your off-day for week #2 will be Saturday.

For week #3 you eliminate Saturday from your choices, etc.

In the long run and on average, each day of the week will be chosen at random with equal probability. Moreover, your off-day will always be a different day of the week from the previous week.

QED

6. Excellent idea, Henry. Thanks.

READ THIS BEFORE COMMENTING!

All comments are subject to approval before they are published, so they will not appear immediately. Comments should be civil, relevant, and substantive. Anonymous comments are not allowed and will be unceremoniously deleted. For more on my comments policy, please see this entry on my other blog.

AND A NEW RULE (per this post): comments critical of Trump's lying must include criticism of Biden's lying on a one-for-one basis! Failure to be balanced means your comment will not be published.