## The Summer 2017 Mathematics A To Z: Quasirandom numbers

Gaurish, host of, For the love of Mathematics, gives me the excuse to talk about amusement parks. You may want to brace yourself. Yes, this essay includes a picture. It would have included a video if I had enough WordPress privileges for that.

# Quasirandom numbers.

Think of a merry-go-round. Or carousel, if you prefer. I will venture a guess. You might like merry-go-rounds. They’re beautiful. They can evoke happy thoughts of childhood when they were a big ride it was safe to go on. But they don’t often make one think of thrills.. They’re generally sedate things. They don’t need to be. There’s no great secret to making a carousel a thrill ride. They knew it a century ago, when all the great American carousels were carved. It’s simple. Make the thing spin fast enough, at the five or six rotations per minute the ride was made for. There are places that do this yet. There’s the Cedar Downs ride at Cedar Point, Sandusky, Ohio. There’s the antique carousel at Crossroads Village, a historical village/park just outside Flint, Michigan. There’s the Derby Racer at Playland in Rye, New York. There’s the carousel in the Merry-Go-Round Museum in Sandusky, Ohio. Any of them are great rides. Two of them have a special edge. I’ll come back to them.

Randomness is a valuable resource. We know it’s key to many things. We have major fields of mathematics built on it. We can understand the behavior of variables without ever knowing what value they have. All we need is to know than the chance they might be in some particular range. This makes possible all kinds of problems too complicated to do otherwise. We know it’s critical. Quantum mechanics would not work without randomness. Without quantum mechanics, matter doesn’t work. And that’s true randomness, the kind where something is unpredictable. It’s not the kind of randomness we talk about when we ask, say, what’s the chance someone was born on a Tuesday. That’s mere hidden information: if we knew the month and date and year of a person’s birth we would know whether they were born Tuesday or not. We need more.

So the trouble is actually getting a random number. Well, a sequence of randomly drawn numbers. We rarely need this if we’re doing analysis. We can understand how some process changes the shape of a distribution without ever using the distribution. We can take derivatives of a function without ever evaluating the original function, after all.

But we do need randomly drawn numbers. We do too much numerical work with them. For example, it’s impossible to exactly integrate most functions. Numerical methods can take a ferociously long time to evaluate. A family of methods called Monte Carlo rely on randomly-drawn values to estimate the integral. The results are strikingly good for the work required. But they must have random numbers. The name “Monte Carlo” is not some cryptic code. It is an expression of how randomly drawn numbers make the tool work.

It’s hard to get random numbers. Consider: we can’t write an algorithm to do it. If we were to write one, then we’d be able to predict that the sequence of numbers was. We have some recourse. We could set up instruments to rely on the randomness that seems to be in the world. Thermal fluctuations, for example, created by processes outside any computer’s control, can give us a pleasant dose of randomness. If we need higher-quality random numbers than that we can go to exotic equipment. Geiger counters watching the decay of a not-alarmingly-radioactive sample. Cosmic ray detectors watching the sky.

Or we can write something that produces numbers that look random enough. They won’t really be random, and if we wait long enough we’ll notice the sequence repeats itself. But if we only need, say, ten numbers, who cares if the sequence will repeat after ten million numbers? (We’ll surely need more than ten numbers. But we can postpone the repetition until we’ve drawn far more than ten million numbers.)

Two of the carousels I’ve mentioned have an astounding property. The horses in a file move. I mean, relative to each other. Some horse will start the race in front of its neighbors; some will start behind. The four move forward and back thanks to a mechanism of, I am assured, staggering complexity. There are only three carousels in the world that have it. There’s Cedar Downs at Cedar Point in Sandusky, Ohio; the Racing Downs at Playland in Rye, New York; and the Derby Racer at Blackpool Pleasure Beach in Blackpool, England. The mechanism in Blackpool’s hasn’t operated in years. The one at Playland’s had not run in years, but was restored for the 2017 season. My love and I made a trip specifically to ride that. (You may have heard of a fire at the carousel in Playland this summer. This was of part of the building for their other, non-racing, antique carousel. My last information was that the carousel itself was all right.)

These racing derbies have the horses in a file move forward and back in a “random” way. It’s not truly random. If you knew exactly which gears were underneath each horse, and where in their rotations they were, you could say which horse was about to gain on its partners and which was about to fall back. But all that is concealed from the rider. The horse patterns will eventually, someday, repeat. If the gear cycles aren’t interrupted by maintenance or malfunctions. But nobody’s going to ride any horse long enough to notice. We have in these rides a randomness as good as what your computer makes, at least for the purpose it serves.

What does it mean to look random? Some things seem obvious. All the possible numbers ought to come up, sooner or later. Any particular possible number shouldn’t repeat too often. Any particular possible number shouldn’t go too long without repeating. There shouldn’t be clumps of numbers; if, say, ‘4’ turns up, we shouldn’t see ‘5’ turn up right away all the time.

We can make the idea of “looking” random quite literal. Suppose we’re selecting numbers from 0 through 9. We can draw the random numbers we’ve picked. Use the numbers as coordinates. Say we pick four digits: 1, 3, 9, and 0. Then draw the point that’s at x-coordinate 13, y-coordinate 90. Then the next four digits. Let’s say they’re 4, 2, 3, and 8. Then draw the point that’s at x-coordinate 42, y-coordinate 38. And repeat. What will this look like?

If it clumps up, we probably don’t have good random numbers. If we see lines that points collect along, or avoid, there’s a good chance our numbers aren’t very random. If there’s whole blocks of space that they occupy, and others they avoid, we may have a defective source of random numbers. We should expect the points to cover a space pretty uniformly. (There are more rigorous, logically sound, methods. The eye can be fooled easily enough. But it’s the same principle. We have some test that notices clumps and gaps.) But …

The thing is, there’s always going to be some clumps. There’ll always be some gaps. Part of randomness is that it forms patterns, or at least things that look like patterns to us. We can describe how big a clump (or gap; it’s the same thing, really) is for any particular quantity of randomly drawn numbers. If we see clumps bigger than that we can throw out the numbers as suspect. But … still …

Toss a coin fairly twenty times, and there’s no reason it can’t turn up tails sixteen times. This doesn’t happen often, but it will happen sometimes. Just luck. This surplus of tails should evaporate as we take more tosses. That is, we most likely won’t see 160 tails out of 200 tosses. We certainly will not see 1,600 tails out of 2,000 tosses. We know this as the Law of Large Numbers. Wait long enough and weird fluctuations will average out.

What if we don’t have time, though? For coin-tossing that’s silly; of course we have time. But for Monte Carlo integration? It could take too long to be confident we haven’t got too-large gaps or too-tight clusters.

This is why we take quasi-random numbers. We begin with what randomness we’re able to manage. But we massage it. Imagine our coins example. Suppose after ten fair tosses we noticed there had been eight tails turn up. Then we would start tossing less fairly, trying to make heads more common. We would be happier if there were 12 rather than 16 tails after twenty tosses.

Draw the results. We get now a pattern that looks still like randomness. But it’s a finer sorting; it looks like static tidied up some. The quasi-random numbers are not properly random. Knowing that, say, the last several numbers were odd means the next one is more likely to be even, the Gambler’s Fallacy put to work. But in aggregate, we trust, we’ll be able to enjoy the speed and power of randomly-drawn numbers. It shows its strengths when we don’t know just how finely we must sample a range of numbers to get good, reliable results.

To carousels. I don’t know whether the derby racers have quasirandom outcomes. I would find believable someone telling me that all the possible orderings of the four horses in any file are equally likely. To know would demand detailed knowledge of how the gearing works, though. Also probably simulations of how the system would work if it ran long enough. It might be easier to watch the ride for a couple of days and keep track of the outcomes. If someone wants to sponsor me doing a month-long research expedition to Cedar Point, drop me a note. Or just pay for my season pass. You folks would do that for me, wouldn’t you? Thanks.

## Roller Coaster Immortality Update!

Several years ago I had the chance to go to Lakemont Park, in Altoona, Pennsylvania. It’s a lovely and very old amusement park, featuring the oldest operating roller coaster, Leap The Dips. As roller coasters go it’s not very large and not very fast, but it’s a great ride. It does literally and without exaggeration leap off the track, though not far enough to be dangerous. I recommend the park and the ride to people who have cause to be in the middle of Pennsylvania.

I wondered whether any boards in it might date from the original construction in 1902 by the E Joy Morris company. If we make some assumptions we can turn this into a probability problem. It’s a problem of a type that always seems to be answered 1/e. (The problem is “what is the probability that any particular piece of wood has lasted 100 years, if a piece of wood has a one percent chance of needing replacement every year?”) That’s a probability of about 37 percent. But I doubted this answer meant anything. My skepticism came from wondering why every piece of wood should be equally likely to survive every year. Different pieces serve different structural roles, and will be exposed to the elements differently. How can I be sure that the probability one piece needs replacement is independent of the probability some other piece needs replacement? But if they’re not independent then my calculation doesn’t give a relevant answer.

A recent post on the Usenet roller coaster enthusiast newsgroup rec.roller-coaster, in a discussion titled “Age a coaster should be preserved”, suggests I was right in my skepticism. Derek Gee writes:

According to the video documentary the park produced around
1999, all of the original upright lumber was found to be in excellent shape.
The E. Joy Morris company had waterproofed it by sealing it in ten coats of
paint and it was old-growth hardwood. All the horizontal lumber was
replaced as I recall.

I am aware this is not an academically rigorous answer to the question of how much of the roller coaster’s original construction is still in place. But it is a lead. It suggests that quite a bit of the antique ride is as antique as could be.

## Reading the Comics, January 29, 2015: Returned Motifs Edition

I do occasionally worry that my little blog is going to become nothing but a review of mathematics-themed comic strips, especially when Comic Strip Master Command sends out abundant crops like it has the past few weeks. This week’s offerings bring out the return of a lot of familiar motifs, like fighting with word problems and anthropomorphized numbers; and there’s one strip that suggests a pair of articles I wrote a while back might be useful yet.

Bill Amend’s FoxTrot (January 25, and not a rerun) puts out a little word problem, about what grade one needs to get a B in this class, in the sort of passive-aggressive sniping teachers long to get away with. As Paige notes, it really isn’t a geometry problem, although I wonder if there’s a sensible way to represent it as a geometry problem.

Ruben Bolling’s Super-Fun-Pax Comix superstar Chaos Butterfly appears not just in the January 25th installment but also gets a passing mention in Mark Heath’sSpot the Frog (January 29, rerun). Chaos Butterfly in all its forms seems to be popping up a lot lately; I wonder if it’s something in the air.

## Reading the Comics, July 28, 2014: Homework in an Amusement Park Edition

I don’t think my standards for mathematics content in comic strips are seriously lowering, but the strips do seem to be coming pretty often for the summer break. I admit I’m including one of these strips just because it lets me talk about something I saw at an amusement park, though. I have my weaknesses.

Harley Schwadron’s 9 to 5 (July 25) builds its joke around the ambiguity of saying a salary is six (or some other number) of figures, if you don’t specify what side of the decimal they’re on. That’s an ordinary enough gag, although the size of a number can itself be an interesting thing to know. The number of digits it takes to write a number down corresponds, roughly, with the logarithm of a number, and in the olden days a lot of computations depended on logarithms: multiplying two numbers is equivalent to adding their logarithms; dividing two numbers, subtracting their logarithms. And addition and subtraction are normally easier than multiplication and division. Similarly, raising one number to a power becomes multiplying one number by the logarithm of another, and multiplication is easier than exponentiation. So counting the number of digits in a number might be something anyway.

Steve Breen and Mike Thompson’s Grand Avenue (July 25) has the kids mention something as being “like going to an amusement park to do math homework”, which gives me a chance to share this incident. Last year my love and I were in the Cedar Point amusement park (in Sandusky, Ohio), and went to the coffee shop. We saw one guy sitting at a counter, with his laptop and a bunch of papers sprawled out, looking pretty much like we do when we’re grading papers, and we thought initially that it was so very sad that someone would be so busy at work that (we presumed) he couldn’t even really participate in the family expedition to the amusement park.

And then we remembered: not everybody lives a couple hours away from an amusement park. If we lived, say, fifteen minutes from a park we had season passes to, we’d certainly at least sometimes take our grading work to the park, so we could get it done in an environment we liked and reward ourselves for getting done with a couple roller coasters and maybe the Cedar Downs carousel (which is worth an entry around these parts anyway). To grade, anyway; I’d never have the courage to bring my laptop to the coffee shop. So I guess all I’m saying is, I have a context in which yes, I could imagine going to an amusement park to grade math homework at least.

Wulff and Morgenthaler Truth Facts (July 25) makes a Venn diagram joke in service of asserting that only people who don’t understand statistics would play the lottery. This is an understandable attitude of Wulff and Morgenthaler, and of many, many people who make the same claim. The expectation value — the amount you expect to win some amount, times the probability you will win that amount, minus the cost of the ticket — is negative for all but the most extremely oversized lottery payouts, and the most extremely oversized lottery payouts still give you odds of winning so tiny that you really aren’t hurting your chances by not buying a ticket. However, the smugness behind the attitude bothers me — I’m generally bothered by smugness — and jokes like this one contain the assumption that the only sensible way to live is a ruthless profit-and-loss calculation to life that even Jeremy Bentham might say is a bit much. For the typical person, buying a lottery ticket is a bit of a lark, a couple dollars of disposable income spent because, what the heck, it’s about what you’d spend on one and a third sodas and you aren’t that thirsty. Lottery pools with coworkers or friends make it a small but fun social activity, too. That something is a net loss of money does not mean it is necessarily foolish. (This isn’t to say it’s wise, either, but I’d generally like a little more sympathy for people’s minor bits of recreational foolishness.)

Marc Anderson’s Andertoons (July 27) does a spot of wordplay about the meaning of “aftermath”. I can’t think of much to say about this, so let me just mention that Florian Cajori’s A History of Mathematical Notations reports (section 201) that the + symbol for addition appears to trace from writing “et”, meaning and, a good deal and the letters merging together and simplifying from that. This seems plausible enough on its face, but it does cause me to reflect that the & symbol also is credited as a symbol born from writing “et” a lot. (Here, picture writing Et and letting the middle and lower horizontal strokes of the E merge with the cross bar and the lowest point of the t.)

Berkeley Breathed’s Bloom County (July 27, rerun from, I believe, July of 1988) is one of the earliest appearances I can remember of the Grand Unification appearing in popular culture, certainly in comic strips. Unifications have a long and grand history in mathematics and physics in explaining things which look very different by the same principles, with the first to really draw attention probably being Descartes showing that algebra and geometry could be understood as a single thing, and problems difficult in one field could be easy in the other. In physics, the most thrilling unification was probably the explaining of electricity, magnetism, and light as the same thing in the 19th century; being able to explain many varied phenomena with some simple principles is just so compelling. General relativity shows that we can interpret accelerations and gravitation as the same thing; and in the late 20th century, physicists found that it’s possible to use a single framework to explain both electromagnetism and the forces that hold subatomic particles together and that break them apart.

It’s not yet known how to explain gravity and quantum mechanics in the same, coherent, frame. It’s generally assumed they can be reconciled, although I suppose there’s no logical reason they have to be. Finding a unification — or a proof they can’t be unified — would certainly be one of the great moments of mathematical physics.

The idea of the grand unification theory as an explanation for everything is … well, fair enough. A grand unification theory should be able to explain what particles in the universe exist, and what forces they use to interact, and from there it would seem like the rest of reality is details. Perhaps so, but it’s a long way to go from a simple starting point to explaining something as complicated as a penguin. I guess what I’m saying is I doubt Oliver would notice the non-existence of Opus in the first couple pages of his work.

Thom Bluemel’s Birdbrains (July 28) takes us back to the origin of numbers. It also makes me realize I don’t know what’s the first number that we know of people discovering. What I mean is, it seems likely that humans are just able to recognize a handful of numbers, like one and two and maybe up to six or so, based on how babies and animals can recognize something funny if the counts of small numbers of things don’t make sense. And larger numbers were certainly known to antiquity; probably the fact that numbers keep going on forever was known to antiquity. And some special numbers with interesting or difficult properties, like pi or the square root of two, were known so long ago we can’t say who discovered them. But then there are numbers like the Euler-Mascheroni constant, which are known and recognized as important things, and we can say reasonably well who discovered them. So what is the first number with a known discoverer?

## Why I Don’t Believe It’s 1/e

The above picture, showing the Leap-the-Dips roller coaster at Lakemont Park before its renovation, kind of answers why despite my neat reasoning and mental calculations I don’t really believe that there’s a chance of something like one in three that any particular board from the roller coaster’s original, 1902, construction is still in place. The picture — from the end of the track, if I’m not mistaken — dates to shortly before the renovation of the roller coaster began in the late 90s. Leap-the-Dips had stood without operating, and almost certainly without maintenance, from 1986 (coincidental to the park’s acquisition by the Boyer Candy company and its temporary renaming as Boyertown USA, in miniature imitation of Hershey Park) to 1998.

The result of this period seems almost to demand replacing every board in the thing. But we don’t know that happened, and after all, surely some boards took it better than others, didn’t they? Not every board was equally exposed to the elements, or to vandalism, or to whatever does smash up wood. And there’s a lot of pieces of wood that go into a wooden roller coaster. Surely some were lucky by virtue of being in the right spot?

So in my head I worked out an estimate of about one in three that any particular board would have remained from the Leap-The-Dips’ original, 1902, configuration, even though I didn’t really believe it. Here’s how I got that figure.

First, you have to take a guess as to how likely it is that any board is going to be replaced in any particular stretch of time. Guessing that one percent of boards need replacing per year sounded plausible, what with how neatly a chance of one-in-a-hundred fits with our base ten numbering system, and how it’s been about a hundred years in operation. So any particular board would have about a 99 percent chance of making it through any particular year. If we suppose that the chance of a board making it through the year is independent — it doesn’t change with the board’s age, or the condition of neighboring boards, or anything but the fact that a year has passed — then the chance of any particular board lasting a hundred years is going to be $0.99^{100}$. That takes a little thought to work out if you haven’t got a calculator on hand.

I recently had the chance to ride the Leap-the-Dips at Lakemont Park (Altoona, Pennsylvania), the world’s oldest operating roller coaster. The statistics of this 1902-vintage roller coaster might not sound impressive, as it has a maximum height of about forty feet and a greatest drop of about nine feet, but it gets rather more exciting when you consider that the roller coaster car hasn’t got any seat belts or lap bar or other restraints (just a bar you can grab onto if you so choose), and that the ride was built before the invention of upstop wheels, the wheels that actually go underneath the track and keep roller coaster cars from jumping off. At each of the dips, yes, the car does jump up and off the track, and the car just keeps accelerating the whole ride. (Side boards ensure that once the car jumps off the tracks it falls back into place.) It’s worth the visit.

Looking at the wonderful mesh of wood that makes up a classic roller coaster like this inspired the question: could any of it be original? What’s the chance that any board in it has lasted the hundred-plus years of the roller coaster’s life (including a twelve-year stretch when the ride was not running, a state which usually means routine maintenance is being skipped and which just destroys amusement park rides)? Taking some reasonable guesses about the replacement rate per year, and a quite unreasonable guess about replacement procedure, I worked out my guess, given in the subject line above, and I figure to come back and explain where that all came from.

## A Cedar Point Follow-Up

I’m sure multiple people have a faint memory of several months ago, when I asked a question about getting the best view of something obstructed by a construction fence. The point was to catch the view at the Cedar Point amusement park, where the Disaster Transport bobsled coaster (and its building) and the Space Spiral were being torn out to be replaced with the GateKeeper roller coaster. The point of interest was whether the small collection of buildings which made up the Transport Refreshments stand was being preserved through all the demolition, and as of September 2012, there wasn’t any way to say.

I was happily able to get to Cedar Point this week and can offer the photograph here to show that they did indeed preserve the area. It’s been repainted and retitled, but probably we should have realized the logic: if there was enough need for someplace to sell Cheese on a Stick when the immediately adjacent rides were among the older and less flashy attractions, they’d surely want Cheese on a Stick when a new marquee ride was right across the entrance. (Well, they might have torn down all the buildings and put up new ones, but, they didn’t.)

I admit there’s not really fresh mathematics content here, but maybe someone was curious about the follow-up. There should be a couple of other pictures past the page cut, here.

## On Peeking At Cedar Point

I hadn’t intended to leave unanswered my little question about getting the best view of an obstructed attraction at Cedar Point, and apologize for that. Matters got in my way. And I really want to commend people to Geoffrey Brent’s solution, which avoids calculus in favor of geometric reasoning and so has that nice satisfying nature to it. (The part that turns into gibberish is rot13’d, so as not to spoil people: copy it to the box on Rot13.com and hit ‘Cypher’ to read it if you aren’t able to do the rot13 stuff in your head somehow.)

I do want to work out the solution by calculus methods, though, partly because that was actually easier for me, and partly to see whether my audience will put up with such. I’m trying to figure out how to present a more complicated subject which sure looks like it needs calculus to explain, and I’d like to have some sense whether I can write coherently on that topic so.

To set the stage: the problem was about where to stand, behind a tall obscuring fence, so as to see the greatest view of a building hidden behind the fence. To make for simple enough numbers, the viewer is assumed to have eyes six feet off the ground, the fence is eight feet tall, and the building, four feet beyond the fence, is twelve feet tall. Trusting that the ground is level — the reality isn’t quite, as it is at an amusement park — and that you can get as near or as far from the fence as you like, when does the angle between the top of the building and the top of the fence get its biggest?

## Peeking At Cedar Point

Back a couple months I wrote way too much about the problem of how many rides to expect on Cedar Point’s Disaster Transport, if we chose whether to re-ride it based on a random event. It struck me there’s another problem created by the amusement park’s removal of the indoor bobsled roller coaster. This one is based on Transport Refreshments, the block of food and drink stands which stood by the removed Disaster Transport and Space Spiral.

Specifically: what’s to become of that area? When my Dearly Beloved and I visited in late September the area was walled off, for construction, but one could rationalize any kind of fate for it. The block might get torn down to provide space for new rides; it might be left as-is, with the name Transport Refreshments left as a mysterious reference that new visitors would have to learn something of park history to understand; or the stands might be re-themed to the GateKeeper roller coaster being built. By now, probably, park-watchers really know, but when we visited, there wasn’t any telling, except by peeking over the fence.

The problem is you can’t see very much, because the fence is in the way. I’m tall and can hold my camera pretty high and so could get glimpses showing that the buildings hadn’t as of late September been torn down, and that they even had the sign in place, but that doesn’t mean much.

It does suggest a cute problem, though, one that’s easy to solve using calculus and maybe is solvable by easier tools. That problem’s, how do you get the best view of the hidden Transport Refreshments? Going up close to the fence means the fence obscures more of your field of view; getting farther away — the ground is roughly level here — reduces the field of view obscured by the fence, but also reduces the Transport Refreshments’ angular diameter. There’s probably a best spot to see what’s beyond, but, where is it?

To turn this into a word problem, let’s pretend things are nice round numbers: that the person doing the viewing has eyes about six feet off the ground, that the fence is eight feet tall, and that — four feet past the fence — the main sign for the Transport Refreshments stands twelve feet tall. I am sure these arbitrarily plucked numbers will produce only good results.

## It Would Have Been One More Ride Because

I apologize for being slow writing the conclusion of the explanation for why my Dearly Beloved and I would expect one more ride following our plan to keep re-riding Disaster Transport as long as a fairly flipped coin came up tails. It’s been a busy week, and actually, I’d got stuck trying to think of a way to explain the sum I needed to take using only formulas that a normal person might find, or believe. I think I have it.

## The Help Needed To Get to One

So, it’s established that my little series, representing the number of rides we could expect to get if we based re-riding on a fair coin flip, is convergent. So trying to figure out the sum will get a meaningful answer. The question is, how do we calculate it?

My first impulse is to see if someone else solved the problem first, for exactly the reasons you might guess. This is a case where mathematics textbooks can have an advantage over the web, really, since an introduction to calculus book is almost certain to have page after page of Common Series Sums. Figuring out the right combination of keywords to search the web for it can be an act of elaborate guesswork. Mercifully, Wikipedia has a List of Mathematical Series which covers my problem exactly. Almost.