Archive for the Fun Category

Birthday Statistics

Each spring I’m hit by a deluge of birthdays to attend.  The deluge tapers off in July.  This made me curious: are my friends more likely to have spring birthdays?  I did some digging and found the answer: overwhelmingly, yes.

First, the control group.  Here are average US birthdays by month (2009 census):

As one would expect, US birthdays average 8.33% per month (as 100% divided by 12 months = 8.33%).  Now, below are my friends’ birthdays by month:

Fully 25% of my friends are born in May and June.  And three of my friends share my exact birthday, June 18th.  When you consider the math of the Birthday Problem, this seems unlikely.  What are the odds of four individuals in a set of 167 sharing the exact same birthday?

By way of control group, only two of my other 167 friends share the same birthday with each other.

DATA SET

To obtain the data above, I took my 650+ Facebook friends and parsed 180 that I feel a genuine connection with (as many Facebook friends are acquaintances).  Of 180 friendships, I was able to scrape birthday data for 176 of them.  Creating the chart above.

THE BIG QUESTIONS

Why am I nearly twice as likely to have a friend born in the spring than the summer?  Why am I nearly three times as likely to have a friend born in June as a friend born in January?

Is this random chance or do other people notice trends among their friends as well?

THE SCIENCE OF BIRTHDAYS

Turns out, science has spotted many birthday correlations, none of which are properly understood.  For instance, children with autism are 16% more likely to be born in winter months. 1 Spring babies are at a 17% higher risk of suicide.2

Other bizarre birthday statistics:

* US teen mothers are more likely to give birth in January than any other month 3
* February babies have a higher likelihood of narcolepsy 4
* Pilots are more likely to be born in March 4
* People with autumn birthdays have the longest lifespans; spring birthdays have the shortest. A person born in October will outlive a person born in March by an average of 215 days.4
* June and July babies consistently have the highest likelihood of short-sightedness4
*September babies get the best grades and test scores in school.4

Conclusions

I think astrology is malarkey. But is it possible that birth month affects personality? Is my statistical sample of 167 friends simply too small to be meaningful? It is interesting to me that among my very best friends, spring babies are still over-represented, with a distribution mirroring the chart above. Possibly science will begin to formulate explanations for the statistical correlations between birth date and personality, health, and aptitude.

Friendship Equation

Work is preventing me from spending enough time with friends lately.  Rather than deal with this problem head on, I got curious about defining the relationship between friendship and time and came up with the following formula for calculating Friendship Value:

This assumes that Friendship Value = [1. Discounted perceived value of past interactions] + [2. perceived value of current interactions] + [3. discounted perceived value of future interactions]. Working backwards:

3. “Discounted Perceived Value of Future Interactions” can be expressed as the summation of all future interactions (t) years from the present (t=0) where “i” = the discount rate at which the net present value of the opportunity costs of a friendship equals the net present value of the benefits of the friendship:

Or, for those that want to graph friendship as a continuous rate (where d=discount rate and λ = log(1+i) ), by the integration:

2. “Perceived Value of Current Friendship Interaction” may be expressed as:

1. “Discounted Perceived Value of all Past Interactions” may be expressed as:

And thus, total Friendship Value can be expressed as =

By this we see that friendship is in a constant state of entropy, buoyed only by the value of our current interactions and the perceived value of our future interactions.  Without the hope of future interactions, the value of a friendship will decline asymptotally, approaching but never reaching zero.

If the value of perceived future interaction declines, it affects the net present value of the friendship.  So if I am going to be busy for the next six months, this dramatically affects the current value of my friendship.

We can calculate the relationship between time and friendship using an inverse square law:

Where FV1 = The Friendship value of a friend, FV2 = The Friendship value of me, and t = the amount of time spent apart.

By this equation, as the net present perceived value of either or both friends decreases, the force of attraction between the friends drops proportionately. But when time is spent apart, the overall value of the friendship drops exponentially.

Thus, friendship is a function of time.  And if I value friends, logic compels me to leave work alone at some point to spend some time with them. I probably need to get out more.

Math Puzzle

If you have so much time on your hands that you’ve ended up at this blog, here is a math puzzle I made up…

A broker is looking at three stock prices and notices a funny relationship. The three prices are all three-digit numbers. By subtracting the first number from the second number, she gets the same result as subtracting the second number from the third number. By subtracting the inverse of the first number from the inverse of the second number, and subtracting the inverse of the second number from the inverse of the third number, she still receives the exact same answer. Finally, each of the three numbers, minus its inverse, yields the same number (although a different number from the proceeding two operations).

What three numbers was she looking at? (NOTE: if you solve this without using palindromes, the solution is very elegant)

Email me your answer and I will send you a prize!*

 

*I do not have any prizes.  But you will have my heartfelt admiration.

Wikipedians by Political Party

Wikipedia founder Jimbo Wales once said Wikipedians are “more liberal than the U.S. population on average, because we are global and the international community of English speakers is slightly more liberal than the U.S. population.

I have crunched the numbers and it appears he is correct.  Wikipedia is more liberal than America.

wikipedians-by-political-party

DATA SET

Of the 14,000,000 registered Wikipedians, it appears 347,000 have created user pages.  Of these 347,000 users, 23,190 individuals, or 6.7%, appear to have professed a political affiliation in the bios on their user pages by mentioning key phrases like “Liberal Party of Australia” or “Social Democrat,” etc.  This provides the following data set:

wikipedians-by-political-party-data-set

Liberal, Conservative, and Libertarian Wikipedians

There are some 57 countries where English is the official or de facto language.  Any of these peoples and more may be contributing to the English language Wikipedia.  Lumping together these Wikipedians into four basic categories, we get the following totals:

wikipedians-conservative-liberal-libertarian

These totals contrast the overall US population in three important ways.

  1. Liberals are slightly overrepresented as compared to the US population
  2. Conservatives are decidedly underrepresented as compared to the US population
  3. Libertarians are dramatically overrepresented as compared to the US population

To illustrate the disparity between the American population and the Wikipedian population, here is a chart showing the USA by political party (2008), using data courtesy of ElectionStudies.org:

usa-political-party

Libertarians

What is particularly interesting is the preponderance of Libertarians on Wikipedia.  While Libertarians carried 0.04% of the vote in the latest US presidential election, they carry even less of a vote in other English speaking countries.  Indeed, it is somewhat unclear if any functioning Libertarian party currently exists in any English-speaking country besides the US.  So it is statistically interesting to find 10% of Wikipedians identifying as Libertarian.

Methodology, Notes, and Margin of Error

*This data was assembled using Boolean searches of the seed “en.wikipedia.org/wiki/User:”.

*Various search terms were excluded to prevent duplication.  For instance, a UK Wikipedian self-identifying as a “Liberal Democrat” must not be double counted in searches for the terms “Liberal” and “Democrat.”  Thus, Liberals were counted as follows:

liberal democrat site:en.wikipedia.org/wiki/user:
liberal -democrat -”australia” -philippines site:en.wikipedia.org/wiki/user:
democrat -liberal -social site:en.wikipedia.org/wiki/user:
Social democrat -liberal site:en.wikipedia.org/wiki/user:

Note that the “Liberal Party of Australia” is center-right, and thus excluded from searches for “Liberal.”  Userpages that mentioned both “Philippines” and “Liberal” were excluded as well because while the Philippines has a “Liberal Party” there is no corresponding “Conservative Party” so a fair tally of left-vs-right Wikipedians would have been disrupted.

*”Labor party” and “Labour party” were conducted as separate searches seeing as Wikipedians may belong to the Labor Party in Jamaica, New Zealand, Australia, the UK, etc.

*”Independents” are almost certainly undercounted.  The word “Independent” appears in many contexts in user bios.  Thus, this search only counted “Independent Party.”

*Many Wikipedians identify as “Anti-Communist.”  So the search for Communist excluded the term “anti.”

*Similarly, “Nazi” was not included in this search as so many Wikipedians appear to identify as “Grammar Nazis” or “Deletion Nazis” or “Wikipedians who have been called Nazis by other Wikipedians,” etc.

*While India and Pakistan represent massive English speaking populations, their political parties – being somewhat unique and endemic – were not counted in this search.

*Further exclusions could be added to these boolean searches to refine the data.  For instance, a Wikipedian saying, “I disagree with the Labor Party” would be counted as a member of the Labor Party in this methodology.  Nevertheless, it is assumed such search errors would occur equally for all parties and thus keep proportions consistent.  Furthermore, random spot checks for associations like “Hate” & “Labor Party,” “Dislike” & “Labor Party,” and “Disagree” & “Labor Party,” yield zero results.  And moreover, the 6.7% sample size is fairly robust when accounting for margin of error.

Anthropogenic Fibonacci Sequences

DNA measures 34 angstroms long by 21 angstroms wide for each full cycle of its double helix spiral. 34/21 = the Golden Ratio.

DNA measures 34 angstroms long by 21 angstroms wide for each full cycle of its double helix spiral. 34/21 = the Golden Ratio.

As folks know, the Fibonacci sequence and its corresponding Golden Ratio can be observed throughout nature, from the arrangement of leaves on a stem to the spiraled florets on the head of a sunflower.  But what about man-made Fibonacci sequences?

Here are some Fibonacci sequences I have observed that are created strictly from humans being human beings:

CHANGI AIRPORT, SINGAPORE 6:00 A.M.

Arriving for an early flight, I witness a terminal opening for the morning.  The first security guard enters the security check.  He walks through the metal detectors, passes his bags through the x-ray, and then runs the metal wand over his body.  Then clips on his security badge.

Thus screened, the first security guard performs the same operation on the second security guard.  While the new guard clips on his badge, the first guard screens a third guard.  Now the first two guards screen two more while the third clips on his badge.

Factoring in the pause time while each newly screened guard clips on his badge and turns on equipment, I realize that the rate at which security guards pass each other through the security check is a Fibonacci sequence.

THE KISSING DISEASE

The incubation period for mononucleosis – the time between exposure to the contagion and the appearance of symptoms – is roughly one month.  Once exposed to the virus, a person carries it for life and can theoretically pass it on for several years.

Thus, imagining a population in which (1) the “Kissing Disease” is introduced by a single person and (2) every person kisses exactly one new person each month, the spread of mono throughout the population is a Fibonacci Sequence.

  1. MONTH ONE: 1 carrier; 1 incubating
  2. MONTH TWO: 2 carriers; 1 incubating
  3. MONTH THREE: 3 carriers; 2 incubating
  4. MONTH FOUR: 5 carriers; 3 incubating

CHRISTMAS FIBONACCI

I witnessed the following Fibonacci Sequence at a Midnight Mass on Christmas Eve.  In a special ceremony, the minister turned off the church lights and distributed unlit candles to every member of the congregation.

The minister’s candle was the only lit candle.  He used it to light the first candle in the first pew.  While that person’s candle flame gathered strength, the minister lit a second person’s candle.  Now two people could light candles while the third person’s flame gathered strength.  Soon there were eight people with lit candles and five who could light other people’s candles.  Thus the brightness of the dark room accelerated in accordance with the Fibonacci sequence.

Ode to Joy on a Chess Board

How would music appear if played on a chess board?

Following comments from my Chess Music post about translating famous chess games into music, a reader requested to see the Ode to Joy on a chess board. Again, mapping algebraic chess notation to scientific pitch notation allows us to play Beethoven on a chess board.

I transposed the Ode to Joy from D Major into C Major for simplicity’s sake (apologies to Beethoven). From there, you can see how the notes E, E, F, G, etc, become E3, E6, F3, G3, etc on the chess board.

Note: my chess program automatically flips the chess board every move which makes the video a bit tricky to follow. But you can still get a neat sense of the symmetry of Beethoven’s melody showing up visually on the chess board.

Fibonacci Scale

If the Fibonacci sequence (1,1,2,3,5,8,13,21…) were translated into music, how would it sound?  The answer – surprisingly – is, pretty good.

Creating the Fibonacci Scale

To play the Fibonacci sequence on a piano, one must assign a number value for every note of the keyboard; A=1, B=2, etc.  As every octave has seven notes, every eighth note starts over at A.  Therefore, 8=A, 9=B, 10=C, etc.  Because there are only 7 possible notes, determining where a given Fibonacci number falls on a scale essentially deals with remainders:

Scale Note = Mod (F,7)

The next, and trickiest step for playing the Fibonacci sequence is finding a piano keyboard that extends into infinity.   Playing only the Fibonacci numbers on your infinite keyboard, one discovers the repeating sixteen note group A-A-B-C-E-A-F-G-F-F-E-D-B-F-A-G (repeat). Expressed numerically (Fibonacci sequence, Modulo 7), the sequence is 1-1-2-3-5-1-6-7-6-6-5-4-2-6-1-7, repeatedly infinitely.

fibonacci-sequence

It’s pretty nifty to find an infinite recursive sequence yielding a repeating finite group under modulo 7. But then, the universe is a nifty place.

Playing the Fibonacci sequence on a regular piano (for instance, in one octave of A major) is not unpleasant as the sixteen notes fit squarely into four measures. The sequence begins on the tonic note and ends on the leading tone, musically resolving when the sequence repeats.

It sounds like this: Fibonacci Sequence MP3. Take a listen!

Proving the Finite Group

To prove the Fibonacci sequence under modulo seven has a finite order of sixteen, we can use mathematical induction…  Special thanks to Kiri Wagstaff for helping me with my math!

Since it’s known that Fn+1 = Fn + Fn-1, let’s assume that:

Mod (Fn+1, 7) = Mod (Fn + Fn-1, 7)

Or in other words:

Mod (Fn+1, 7) = Mod (Mod (Fn, 7) + Mod (Fn-1, 7), 7)

This holds true for our base cases, n = 1 and n = 2.

For our inductive step (to prove the sequence repeats every sixteenth natural number) let’s assume that:

Mod (F(n+1)+16, 7) = Mod (F(n+16) + F(n-1)+16 ,7)

OR

Mod (F n+17, 7) = Mod (Mod (Fn+16, 7) + Mod (F n+15, 7), 7)

OR

Mod (2584, 7) = Mod (Mod (1597, 7) + Mod (987, 7), 7)

OR

1 = 1

AND

Mod (Fn, 7) = Mod (Fn+16, 7)

Fibonacci Fugue

Without further ado, here is a fugue I whipped up using the 16 note Fibonacci Scale as the main theme: Fibonacci Fugue MP3. Take a listen!

Order of Group for Non-Western Scales

What does the Fibonacci sequence sound like if played on non-Western scales? Repeating sequences again occur on scales of any length (excepting base 10-divisible scales which spit out gigantic Pisano periods before yielding an identity).  For instance, playing the Fibonacci sequence on a pentatonic scale yields the repeating pattern: A-A-B-C-E-C-C-A-D-E-D-D-C-B-E-B-B-D-A-E.   Playing in a nine note scale also yields a twenty note repeating pattern: A-A-B-C-E-H-D-C-G-A-H-I-H-H-G-F-D-A-E-F-B-H-A-I.

Fibonacci Scales in Bases 2 -15

Examining the modulo sequences, distinct patterns emerge.   The longer the modulo sequence, the more it approaches the Fibonacci sequence.   For instance, all of the sequences begin with 1-1-2-3-5, or A-A-B-C-E.   Furthermore, the sequences all end with the highest possible note in the scale.   Melodically, this means that every sequence begins on the tonic and ends on a leading tone, which is harmonically pleasing.  The second to last note is always A.  The third to last is always the second highest note in the scale.   The fourth to last note is always B, etc.   As larger sequences are generated, greater patterns emerge (see chart above).   Although it must be a mathematical coincidence, these patterns create harmonic consistencies that are not half-bad to listen to.

Perhaps most bizarrely, these Fibonacci scales all appear to obey the laws of musical phrasing.   Simply stated, the peak of a musical phrase is very often the highest note of a musical phrase, and tends to occur around 2/3rds (or maybe .618…) through the length of the phrase.   Furthermore, if a musical phrase begins and ends in the tonic key, the peak of the phrase will often be in the dominant key.   This pattern is bizarrely exhibited in the Fibonacci scales (chart above), which all contain a middle sequence of A-M-N-M-M-L-K, where N is the highest note in the scale, and M is the second highest, L is the third highest, and K is the fourth highest.

Square Scales and Cube Scales

Recurring sequences do not appear to be endemic to the Fibonacci sequence.  Playing the squares (1,4,9, etc) on the infinite piano yields a recurring order of seven {A,D,B,B,D,A,G}.  Playing the cubes (1,8,27) on the infinite piano yields a different recurring group order of seven {A-A-F-A-F-F-G}.   Perhaps these math-based melodies will one day provide inspiration for modern composers.

Chess Music

For absolutely no good reason, I found myself wondering what a chess game would sound like if played on the piano.

One can’t help but notice that algebraic chess notation maps almost perfectly to scientific pitch notation

scd_algebraic_notation

The eight columns of a chess board correspond to the eight audible octaves.  E.g., C4 is a middle square on the chess board and C4 is “middle C” on the piano…

pitch_notation

(Both images from Wikimedia Commons).

NOTATION

I know what you’re thinking: the diatonic scale has seven notes “A” through “G,” but the chess board goes up to “H.”  So how can we overlay chess notation with pitch notation?

Fear not!  We’ll simply use the Northern European system of musical notation, where an “H” indicates a B Natural, and a “B” indicates a B flat.  This is the notation that composers from Schumann to Lizst used to sign the name “B-A-C-H” into their music (see BACH motif).

The Bach Motif

The Bach Motif

So we now have a system for mapping the moves of a chess game onto a piano keyboard.  For example, Anderssen’s “Immortal Game” begins with 1. e4 e5 2. f4… which maps to E natural in the 4th register, E natural in the 5th register, and F natural in the 4th register.

NOTE VALUE

The remaining task is to assign note values.  What makes a quarter note, a half note, and a whole note?

The relative value of chess pieces is Pawn = 1, Knight = 3, Bishop = 3, Rook = 5, Queen = 9, and King = Infinity.

Assigning these exact ratios to note values will create some rather annoying polyrhythms.  So let’s round off the ratios a tiny bit and assign the following note values to the chess pieces: Pawn = 1/16th note, Knight = 1/8th note, Bishop = 1/8th note, Rook = 1/4 note, Queen = 1/2 note, and King = rest.

OCTAVE VALUE

To put the icing on the cake, let’s condense the 8 registers into a single octave to make the chess melodies more tolerable. If a note is doubled (as in 1. e4 e5), let’s jump the second note up an octave to provide some flavor.

So without further ado, here are three famous chess games mapped onto the piano:

“THE IMMORTAL GAME”
June 21 1851

In “The Immortal Game,” Adolf Anderssen gave up both rooks, a bishop, and ultimately his queen, in order to checkmate Lionel Kieseritzky using only his three remaining minor pieces – a bishop and two knights.

LISTEN TO THE MP3: The Immortal Game

I set blues chords in the left hand to justify the constant tonal shifts from B to b flat in this chess game. The chords modulate from C Major to F Major and finally end in B Flat Major.

The game/melody: Pe4 Pe5 Pf4 Pe x Pf4 Bc4 Qh4+ Kf1 b5?! Bxb5 Nf6 Nf3 Qh6 Pd3 Nh5 Nh4 Qg5 Nf5 Pc6 Pg4 Nf6 Rg1!! Pcxb5? Ph4 Qg6 Ph5 Qg5 Qf3 Ng8 Bxf4 Qf6 Nc3 Bc5 Nd5 Qxb2 Bd6 Bxg1? Pe5! Qxa1+ Ke2 Na6 Nxg7+ Kd8 Qf6+ Nxf6 Be7#

THE OPERA GAME
1858, Paris

In “The Opera Game,” Paul Morphy bested the German Duke Karl of Brunswick and Count Isouard during the Opera “Norma” at the Italian Opera House in Paris.

Morphy won with a snazzy queen sacrifice in what is considered one of the most brilliant combinations in chess history.

LISTEN TO THE MP3: The Opera Game

This bouncy, modal melody seemed to lend itself to a Baroque invention. So I added in a left hand melody using Species Counterpoint.

The game/melody: Pe4 Pe5 Nf3 Pd6 Pd4 Bg4? Pd4xe5 Bxf3 Qxf3 Pdxe5 Bc4 Nf6 Qb3 Qe7 Nc3 Pc6 Bg5 Pb5? Nxb5! Pcxb5 Bxb5 Nbd7 0-0-0 Rd8 Rxd7 Rxd7 Rd1 Qe6 Bxd7+ Nxd7 Qb8+! Nxb8 Rd8#

World Chess Championship 1972, Game 6

Bobby Fischer bests Boris Spassky with an aggressive queenside attack. Spassky joined the audience in applauding Fischer’s win and called it the best game of the match.

LISTEN TO THE MP3: Bobby Fischer 1972

This chess game produced a wild jumble of syncopated sevenths and minor seconds. I tried to find order in the atonal chaos by laying in major ninth and suspension chords. My hope was to somehow evoke the major seventh chord sound of the 1970s, when this game was played. It came out sounding like if Schoenberg wrote intro music for a morning talk show.

The game/melody: 1.c4 e6 2.Nf3 d5 3.d4 Nf6 4.Nc3 Be7 5.Bg5 O-O 6.e3 h6 7.Bh4 b6 8.cxd5 Nxd5 9.Bxe7 Qxe7 10.Nxd5 exd5 11.Rc1 Be6 12.Qa4 c5 13.Qa3 Rc8 14.Bb5!? 14…a6?! 15.dxc5 bxc5 16.O-O Ra7 17.Be2 Nd7 18.Nd4 Qf8 19.Nxe6 fxe6 20.e4 d4 21.f4 Qe7 22.e5 Rb8 23.Bc4 Kh8 24.Qh3 Nf8 25.b3 a5 26.f5, exf5 27.Rxf5 Nh7 28.Rcf1 Qd8 29.Qg3 Re7 30.h4 Rbb7 31.e6 Rbc7 32.Qe5 Qe8 33.a4 Qd8 34.R1f2 Qe8 35.R2f3 Qd8 36.Bd3 Qe8 37.Qe4 Nf6 38.Rxf6 gxf6 39.Rxf6 Kg8 40.Bc4 Kh8 41.Qf4 1-0

UPDATE: By reader request, I’ve translated Beethoven’s “Ode to Joy” into a chess game. Click the link to see the video.