Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was picking football teams for my office's weekly "pick'em pool", and decided to pick randomly.

Since I only had a pencil and a legal pad handy, and I only needed outputs of 0 or 1 (0 being the home team wins, 1 being the away team wins) I invented my own "random number generator".

For each 2-team matchup, I generated an output by:

  1. drawing a zig-zag squiggle (sine-like random waveform, with near-zero bias) using a designated ruled line on my notepad as the x-axis.
  2. Then I counted the number of times the waveform intersected the ruled line.
  3. Then took that number mod 2 as my output.

Assuming each waveform was long enough (i.e. had at least 10 local minima and maxima) is my expected output somewhere near 0.5?

Just curious.

share|cite|improve this question
No, it will only depend on your habits about starting and ending the squiggle either above or below the axis. – Henning Makholm Oct 11 '12 at 22:02
Randomness tests might be of interest. They're all just heuristics, though. – Snowball Oct 11 '12 at 22:09
Trade the pencil with someone else for a quarter. And then use the quarter. – Patrick Li Oct 12 '12 at 0:54

Given a closed curve in the plane which doesn't go through any point more than twice. The curve cuts the plane into regions, and if the outside is colored white, one can color all the regions black or white so no two regions meeting along an edge are the same color. (This is a standard graph theory result.)

This fact could be used to make a mod 2 random number generator, since if you draw a complicated enough curve with lots of regions, and then pick a region not very near the outside, you likely won't see immediately whether it would turn out black or white once the coloring is done.

But the color of a region can be found by drawing a ray from a point inside it which avoids the vertices, and counting mod 2 the number of intersections of the ray with the curve; you'll get odd or even depending on whether the region would end up black or white respectively.

So if you draw a really involved curve, then quickly pick a region near the middle, it seems you'd end up with a mod 2 result which didn't depend on your own "bias", as you yourself wouldn't know in advance what that parity would come out. Of course this doesn't apply if you are Rain Man. :=)

share|cite|improve this answer
This is helpful! Thanks! I'm assuming I can extend your solution to mod N, assuming a curve with a large enough number of interior regions... – MadmenDiver Oct 12 '12 at 13:18
Well the overall count of the number of intersections on the way from the inner region to the outside would seem to be a random positive integer in some sense. You would know it was reasonably large if you made a quite complicated squiggle and chose a region near the middle. I think if the size of the squiggle was large compared to N you might arguabloy get a random number mod N. So I agree with your remark... – coffeemath Oct 14 '12 at 5:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.