## Posts tagged ‘random’

### Making Heads or Tails of Randomness

Which of the four graphs below have a collection of truly random dots?

To put a little distance between the question and the spoiler below, let me interject with a couple jokes about randomness and probability.

From the ANZSTAT listserv:

If you choose an answer to this question at random,

what is the chance you will be correct?

- 25%
- 50%
- 60%
- 25%

Had enough? Okay, then, on with the show!

The 25 dots shown in each graph were randomly selected, but four different methods were employed:

**Completely Random**: The coordinates of each dot were selected completely at random, independent of the other dots.**Random-ish**: The area was divided into a 5 × 5 grid of squares, and one point was then randomly selected within each square.**Dartboard**: I placed a 5″ × 5″ square on a dartboard and threw darts at it until I hit it 13 times. I then turned the square 90°; and threw darts until I hit it 12 more times. (I’m a reasonable dart player, but yes, there were quite a few darts that landed outside the square.)**Eli’s Choice**: I gave my seven-year-old son a 5″ × 5″ square and asked him to draw 25 random points.

Perhaps those descriptions will better help you determine which graph contains truly random dots. Care to take another look?

No? Okay.

**Graph C** was the most fun; it was **Dartboard**. I despise dumb-ass probability problems like, “What’s the probability that a randomly thrown dart will land inside the square and outside the circle?” What kind of person throws darts randomly? That’s just stupid, not to mention irresponsible. You’ll put someone’s eye out! Yet throw them randomly I did. And I’m happy to inform you that none of the walls around my dartboard were harmed in the making of this graph.

**Graph A** was **Random-ish**. Although there is some white space in the upper right and two dots are somewhat close in the bottom middle, generally the dots are well spaced.

**Graph D** was **Eli’s Choice**. Like Random-ish, Eli was rather careful to make sure that none of the dots were too close to one another. I divided the square into 25 unit squares after he drew his dots, and there was a single dot in 23 of them. There are some definite linear tendencies.

By process of elimination, you now know that **Graph B** was **Completely Random**. The function **=5*RAND()** was used to choose each coordinate for all 25 points in an Excel spreadsheet, and then they were graphed as a scatterplot.

So, what’s the point?

Graph D was generated by a seven-year-old, but it’s not terribly different from what would be generated by an average adult. What most people think of as random is usually anything but. Truly random data usually has clusters within it. For instance, flip a coin 200 times, and there is an 80% chance that there will be a run of at least 6 consecutive heads or 6 consecutive tails within your data.

For graph B, the clustering that happens in the upper left and with the two dots that touch in the lower right is completely typical when data is generated at random. As humans, we often try to ascribe some special meaning to these occurrences. For instance, when there are ten homicides in one week in a city that normally only has two homicides per week, headlines will declare “Murder On The Rise,” and the mayor will hold a press conference on what the police are doing to address the problem. But there’s nothing to be done. This kind of grouping is normal. A few weeks later, when there are zero homicides in one week — which is also typical — there will be hardly a notice.

If you didn’t correctly choose graph B, then perhaps you’re random-averse.

Or, more likely, you’re just normal.

### Vi Hart, Sierpinski, and the Chaos Game

My kids love to spend the last 20 minutes before lights out doing math with daddy. Often, as an alternative to reading another chapter from the *Magic Treehouse* series, they will ask, “Can we do bedtime math tonight?”

Unfortunately, the materials at Bedtime Math quickly lost their luster — if not for Alex and Eli, at least for me. The problems are based on current events, but they are little more than traditional textbook exercises. Sorry, that’s just not the math to which I’d like my sons to be exposed.

So instead, I’ve been developing my own ad hoc bedtime math curriculum. Last night’s lesson was the Binary Trees video from Vi Hart’s Math Doodling series.

For 3 minutes, 48 seconds, the video had the boys’ rapt attention. When it ended, Eli turned to me. “Well, *that was pretty cool*,” he said.

This afternoon, we explored an extension.

- Draw equilateral triangle
*ABC*, any size you choose, on a sheet of paper. - Randomly pick a point
*Q*on the same sheet of paper. - Now, randomly pick a vertex
*A*,*B*, or*C*, and place a dot at the midpoint of the segment that connects*Q*to that vertex. (But don’t draw the segment. That’ll just make things messy.) - Again, randomly pick a vertex
*A*,*B*, or*C*, and place a dot at the midpoint of the segment that connects the previous point to that vertex. - Repeat Step 4 thousands of times, or at least enough times to see a pattern emerge.

We played this game for a little while using a 12-sided die to determine the randomly selected vertex. A roll of 1-4 chose *A*, 5-8 chose *B*, and 9-12 chose *C*. Interest was starting to wain after 20 rolls, so we paused for a question:

Notice that most of the points occurred within the triangle. If we continue rolling and drawing points, do you think any more points will occur outside the triangle?

The answer is **no**. All points will occur within the triangle.

If you haven’t seen this game before, it’s called the Chaos Game. And if you don’t have interest in rolling a die 2,496 times to see what happens, you can open the Chaos Game spreadsheet. The values in column B are the *x*-coordinates of the points, and the values in column C are the *y*-coordinates. Change the values in B1 and C1 to pick a new starting point, and hit F9 on a PC or fn+F9 on a Mac to generate a new set of data.

Cool, huh?

### Fishin’ for an April Fools Math Joke

My friend and former boss Jim Rubillo sent me the following email last night:

I am cleaning, and I found this book that you might want:

One Million Random Numbers in Ascending Order. Do you want it, or should I throw it away?

Seemed like an odd book, and I thought he might have gotten the title wrong since RAND Corporation published *A Million Random Digits with 100,000 Normal Deviates* in 1955. (Incidentally, you should visit that book’s page on www.amazon.com, where you’ll find many fantastic reviews, such as, “Once you’ve read it from start to finish, you can go back and read it in a different order, and it will make just as much sense as your original read!” from Bob the Frog, and, “…with so many terrific random digits, it’s a shame they didn’t sort them, to make it easier to find the one you’re looking for,” from A Curious Reader.)

Knowing that Jim is a stats guy, it seemed plausible. A little confused, I wrote back:

Is it literally just a list of random numbers? If so, I’ll pass. But if there’s something more interesting about it, then maybe?

His response?

It’s a sequel to

The Complete Book of Even Primes.

Gotcha!

And so it goes, with April Fools even afflicting the math jokes world.

Thank goodness he didn’t tape a fish to my back.

### Random Number Generation

While playing Nurikabe, my sons completed the following puzzle:

The puzzle itself isn’t very interesting, but did you notice the Puzzle ID? Exactly 1,000,000. The boys thought this was pretty cool, and I did, too. Yeah, yeah, I know, the occurrence of 1,000,000 shouldn’t impress me more than the appearance of, say, 8,398,176 or 3,763,985. But there are just under 10,000,000 unique 5 × 5 puzzles on the site, and only nine of them contain six 0’s. How lucky were we to get that random number?

Generating random numbers can be a difficult proposition, especially for a computer. This article from WIRED magazine — which describes a pattern that inadvertently appeared on lottery tickets, making it possible to predict winning tickets before they were scratched — shows how difficult it can be to generate numbers that appear to be random. (The article really is worth a read, especially for math geeks. Truth be known, WIRED is the only magazine that I read cover-to-cover every month.)

Robert Coveyou, a mathematician who worked on the Manhattan project, was an expert in pseudo-random number generators. He is most famously remembered for the following quote:

The generation of random numbers is too important to be left to chance.

Of course, Randall Munroe at xkcd has a foolproof method for generating a random number:

I would hate for you to need a random number and then have difficulty generating one. I’m here to help, so I present the…

**MJ4MF Random Number Generator (PDF)**

Creating the MJ4MF RNG is quite simple. Just follow these steps:

- Download and print the PDF from the link above.
- Cut out all six squares, one for each number 1-6.
- For each square, make two folds: first, fold the paper to the center vertically; then, fold the paper to the center horizontally. The result of these two folds is shown, below left.
- When all six pieces are folded, interlace them to form a cube. This is shown, below middle. The assembled cube is shown, below right.

Finally, a joke about random numbers.

A student is asked for the probability that a random number chosen between 0 and 1 will be greater than 2/3. The student answers 1/3. The teacher says, “Great! Can you explain to the class how you arrived at your answer?” The student says, “There are three possibilities: the number is either less than, equal to, or greater than 2/3, so the probability is 1/3!”