Wednesday, July 24, 2013

More on the importance of exponential growth OR that part in Wayne's World

Yes, I'm talking about this part of Wayne's World:


It seems that over the past few posts I've touched on exponential growth from a few different directions.  One of those ways was relating to the proliferation of unique Tetris pieces you can make with a set number of 1x1 Tetris blocks, and the other two were touching on the Wayne's World social network method from above.

Those two posts were the one about my Kickstarter project and the one about saving the post office by creating a national culture of everyone removing and returning business reply mail envelopes from junk mail.

Let's get the obligatory Kickstarter plug out of the way.  The reason that Kickstarter works (when it works) is due to the nature of social networks.  If I just wanted to collect money from the people I knew, I'd simple ask every person I knew if I could borrow a dollar the next time I see them.

It's an interesting social experiment, and perhaps one I'll try sometime, but it's not the point.  The point isn't for people I know to give me money (though thanks if you have!), but for them to tell the people they know.
You see, I might be able to say that I 'know' a few hundred people.  People who if I saw them sitting at a bar in an airport while traveling I would sit down and strike up a conversation with (my favorite test of if you actually 'know' a person).  I don't know that I'm too much of an outlier on that - keep in mind I've said 'know' and not 'friends', which is a whole different story.

If each of those people gave me a dollar (from the above example), I'd have a few hundred dollars.  But if those people instead just told their friends about me, and I got a dollar each from them, well, that's a lot more dollars.

How many more dollars?

Well, let's just make this easy.  Let's say I have easy communication access (can I put that in any colder terms?) with 100 people.  Let's also say that they also have 100 people with whom they share the same access, but those people are 100 different people (I guess I'm in there, too, so maybe they need to have 101 people).

Regardless.

If I did somehow find myself in a situation where I knew 100 people who each knew 100 non-overlapping people, that second set of known people is exponentially larger than the first.  Why?  Because there are exponents involved.

Joking aside, exponential growth occurs when the growth in a mathematical function is a product of the current value of the function.  In ideal case, when y = n^x, and where n is some number.  (Yes, I also know that the exponential function - not just exponential growth involves the use of e^x, but that's outside this discussion.)

What I'm getting at is that the number of people in this secondary network is 100*100, or 100 squared (100^2).  100^2 is 10,000.

That's not the function, that's simply one step along the way.  There is a function is how the number of people in the primary network (the people I know) are related to the number of people in the secondary network (the people the people I know know).  That function is a simple square: y = x^2.  This still isn't where exponential growth comes into play, but it's worth discussing first.  A square function (in fact, this square function) looks like this:



If the number of people that people know is 100, then we get the 10,000 above.  If each person knows 10,000 people, then the secondary network is out at 100 million.  If each person knows 3 people, then the secondary network is only 9 people.

If you happen to have friends who also like telling people things (and also happen to miraculously have a completely unique set of friends aside from you), we would move out to a cubic function: y = x^3.  Now, the number of people that can be reached if everyone has 100 people to talk to is 100*100*100 = 1,000,000

That's right, one MILLION people.

By increasing from a secondary to a tertiary network, we're incrementing the value of the power in the function.  It is though this that exponential growth occurs.  The Wayne's World growth is every person telling two friends, so the function y = 2^x shows how many people you are contacting at that stage of the process (e.g. x = 3 is three steps steps removed from the initial person).  That looks like this:


Don't be fooled by the scale into thinking that those numbers below 75 on the x-axis are zero.  They're just really small compared to the end number, but they're still really big.  For instance, 2^25 is still 33 and a half million.  The fact that 33,500,000 looks like zero might give you some perspective on just how big those numbers toward the right end of the graph actually are.

The graph of what we were talking about above, with every person telling a hundred friends is somewhat similar, except all the numbers have a lot more zeros on them.  In fact, since we're working with a nice power of 10 system all the numbers can simply be expressed very easily in scientific notation.  So much so that a table is perhaps more illustrative than a graph.


So, if I told 100 friends about something, and then each of them told 100 (different) friends, and so on, and so on, we'd run out of humans on the planet sometime between the 4th and 5th step.  The trick would really be finding those 100 unique people each time.

You might also note that this is how pyramid schemes work, and why they are always (eventually) unsustainable.  To keep the scheme going you need to keep finding unique people to enter into it.  The longer it goes on the more and more unique people you have to find.

For instance, here's the table for the Wayne's World 2^x method:


So, even if you're just having each person in the system tell two other people, you still run out of people on the planet in about 33 steps through that system.  Of course, an actual pyramid scheme is a bit more complex than this, but this would illustrate one running at peak efficiency.

Let's step back from pyramid schemes for a moment.

Think of it this way.  If two of you each told two friends about the post office plan from last week, and those two people told two people, etc, we'd have the whole US told (again at peak efficiency) at just under 30 or so steps.

Back to pyramid schemes though (I'm kidding), we don't need the whole of the country on the kickstarter - this process at 10 steps still has over a thousand page views.

So, you know, do both those things.

Tetris pieces are growing in perhaps a much more interesting way, that I'm only going to touch on briefly (until I decide to do a post that looks at those 6 and 7 block cases).  I talked about it during that post, but every time you add a block to the system you can place that block on a number of spots on preexisting pieces.  Early in that process you a) have fewer pieces and b) those pieces are smaller.  The growth that occurs at that stage is slow, then.

As you start to get more pieces, and those pieces get bigger, there are both more spots on any given piece to put a new block as well as more pieces on which to do so, which drives this accelerating growth.  Some of these aren't unique, but it's possible that the proportion of non-unique pieces produced at each step has a predictable function as well.

Something to look at later.

Or perhaps something to dream about...

Wednesday, July 17, 2013

How to save the post office (and stick it to the man)

Here's a question for you.  Why won't UPS or FedEx come to your door every day, pick up any mail you might have, and deliver it to any other address in the country - hold on, I'm not done - for the price of 50 cents or so per item?

The short answer is that it's simply not cost effective, at least without a huge customer base and established infrastructure.  

Even then, it's still a challenge.  The USPS knows that well.

The USPS was founded on the principle that mail service is a right of everyone in the country, and that prices should never become burdensome as to exclude anyone from that process.  Even if you live on top of a mountain, or in the Grand Canyon, the USPS will still bring you mail for just the price of postage.

The problem is that this system works best when it's running near or at capacity.  There's a lot of infrastructure in place, and as we send less mail in aggregate the costs of running the system don't really decrease proportionally.  

To pump money back in to the post office, then, all we need to do is send more mail.

Well, duh, you're saying, but that costs money.  And you have to sit down and write stuff.  It's soooo 20th century.  

Sure, it is.  While I'll stand by the fact that people should write more letters, I'll agree that this isn't the solution.  At least not the solution we're looking for *waves hand*.

You might not want to throw money at this, but there are plenty of those that do.  In fact, there's a good chance that they've mailed you some money today.  What are you likely to do with it?

Tear it up and throw it into the garbage.  

You see, I'm talking about business reply mail.  Yep, this stuff:



You see, companies pay to send you envelopes full of solicitation, including these business reply envelopes.  The trick is that they pay in bulk (and get a discount), and also only pay for return postage (also discounted) when those envelopes are returned.  

It's a pretty safe bet on the return mailers - they're happy to pay for them because when they do come back they're filled with what could basically be gold: filled out credit card applications, uh, other filled out credit card applications, uh, etc.  

Some of you are a few steps ahead of me already, I can tell.  What I'm about to suggest isn't a new idea - I'm confident that a good chunk of the country has independently derived this on their own.  It's not tricky, and you can find plenty of people already suggesting it on the interwebs (which makes our eventual job easier).  

By simply mailing these envelopes back - empty - you are in effect taking some amount of money from these corporations and surreptitiously donating it to the USPS.  

Before you say "I already saw that a bunch of places", let me again point out that a quick search reveals tons of people who have also come up with this idea to varying degrees.  What I'm looking to figure out today is actually how much this donation to the USPS would actually be if we all started doing it.  

So, I've been counting my mail.  

It's probably not shocking to anyone who a) is alive, b) lives in the US that I (we) get a lot of this type of mail.  There are some days I don't get any, and some days where I get a bunch.  On average it seems to work out to about one business reply envelope a day (days that I get mail, so discounting Sunday).  

Let's err a little lower to keep things nice and round, and say that I get 300 business reply envelopes a year.  

It's kind of hard to figure out exactly how much it costs to cover the cost of a returned business reply mail envelope, as the USPS has some information here: 


But seems to hold back on pricing information until you try to do it.  I've had trouble finding anything else on their site about what sort of discount actually takes place, so lacking that information we can simply work on the known bounds.  

That is, we know the most and least that one of these business reply mail would cost to cover.  The least is nothing, if the post office is simply in collusion with the companies and not really worried about losing money.  That seems pretty unlikely.  

The most that they could charge is something less than the price of a stamp, or it wouldn't be a discount.  The current cost of a stamp is $0.46.  That means that the upper bound of what I could be 'donating' to the post office in a year is somewhere around $138.  If companies are getting a 50% discount on mailings, we're now talking $69.  If they're getting a 75% discount it's only $34.50.

$34.50 might not seem like much, and in the grand scheme of fixing the post office it's really not.  The way around this is the law of large numbers.  You can still see from the same Google search I told you to do earlier that this is not a highly unique idea.  This is a very easy idea to develop independently and simultaneously.

In the latest US census, 76.5% of the 313,914,040 people in the country were over the age of 18.  I know for a fact that you can get this type of mail well before you're 18, but for simplicity's sake lets just go with those who are right in the target market for this kind of mail.

That leaves us 240,144,241 people who are likely to be receiving some number of business reply mail envelopes in the mail.  But how many?  

Well, I don't think the numbers that I've found for myself should be anything outlandish.  I go to lengths to make sure that companies *don't* have my address, so if anything I should be on the lower end of the scale.  
Let's simply say, though, that I'm presumably somewhere around average (if you don't believe me, start counting your mail).  What would that mean?

Well, it would mean that instead of me chipping in something like $34.50 a year, 240 million people could be.  
If you have a basic grasp on math you can see that we have a two digit number that's going to be multiplied by a number that has run out of millions digits.  That means we're now talking billions.  

$8,284,976,314, to be exact.  

Everyone online seems to have a different number for the USPS budget shortfall each year, but they mostly seem to fall between 5 and 11 billion, which means that 8 billions dollars could actually make a dent.  

That's also operating on the presumption that these companies get discounts as high as 75% on business reply mail returns.  It could be higher than this, I'll admit, but it could also be lower.  If they were only getting a 50% discount we'd be looking at $16,569,952,628.  With no discounts whatsoever we'd be looking at a cool $33,139,905,256.

It's easy to read that and say, 'yeah, but that's if everyone does it, it doesn't matter if I do'.  

Well, it does, because you're part of everyone.  Honestly, make this a habit.  Instead of just tearing up and throwing away your business reply mail return envelopes (you should be recycling them anyway, jerk!), make a pile of them and then recycle the rest of the paperwork.  

Have fun with it, save them up and send them all out on the first of the month or something.  Pick a day of the month when you pay your credit cards and take a bit more delight in the fact that you got something back out of it, too.  Well, at least the post office would.  

Some people will tell you to get all spiteful about it, and mail other junk mail, or crackers, or ez-cheese, or bricks, or other things that are just not a great idea to be sending through the mail.  Don't make this about anger, make it about release.  You're getting rid of something you don't want, and helping out an organization who needs it.

Some other people will tell you to do this so that the credit card companies will stop sending you business reply mail envelopes.  Sorry to burst your bubble, but they're never going to stop.  If every single person in the country was doing this every day they *might* start to notice.  $8 billion spread across all the companies that send you this type of mail is still the equivalent of a mosquito feasting on the ankle of a giant.  

But seriously, this isn't hard.  Do it. 

Wednesday, July 10, 2013

On Kickstarter

Hi everyone - today we're going to talk about Kickstarter.  We're going to talk about Kickstarter because I'm currently Kickstarting a Kickstarter project related to the blog.  Kickstarter.

Anyway, for those of you who like to just get to the point right away, here's a link to the project.


or short form for easy linking: http://kck.st/1514HKO

Take a moment to go check it out, and if you'd liked some of the stuff on here do consider tossing a few bucks at it.  If you've never used Kickstarter (and don't have an account) take note that it's actually quite easy to get started with.  Check out my project, check out some other projects - there's always something good on there.  

Also, pass along the word to anyone who will listen.  I've set the initial funding bar low, but have some fairly crazy stretch goals in there.  The more people who fund the project, the more stuff everyone gets out of it.  I doubt I'll hit them, but who knows.

So, go check it out, and spread the word!

If you want to talk a bit more about Kickstarter, though, that's what the rest of today's post is about.

Kickstarter was set up a few years ago (2009) as a means of crowd-funding projects (not to be confused with cloud-funding projects).  People put up projects, and other people can support those projects to help get them off the ground.  If the project is funded the person who created the project gets the money pledged, and if the project is not funded no one is charged anything.  

Kickstarter keeps a page on their website about stats, and they seem to update it daily.  It's actually a pretty cool resource, and you can find it here:


You can see that Kickstarter recently passed the 100,000 projects launched mark, and they also just passed the point where they have successfully raised 600 million dollars.  Yes,

$600,000,000.00

So, they're doing alright.

There are also some cool numbers about successful and unsuccessful projects.  There have been around 45,000 successful projects and around 57,000 unsuccessful projects.  

The successful projects that have raised a ton of money ( http://www.kickstarter.com/discover/most-funded ) are kind of few and far between.  The majority of projects are just small things that raise less than $10,000 - at the moment right around 77% of successful projects raised less than 10K.  

The unsuccessful projects, though, well, a lot of them just seem to sit and languish without anyone ever pledging anything.  Nearly 1 in 5 of unsuccessful projects never get a single pledge.  

That could mean that those were just poorly constructed projects, etc, or that there's some sort of momentum that builds as a project gets going.  No one wants to be the first person to back a project, right?  If no one else is doing it, it must not be good?  It would be pretty interesting to actually find a way to measure some of that, but for now all we can really do is speculate.

I've never been a first pledge on a project, so I'm not really sure what it feels like.  Whoever pledges first on this one, what was your thinking?  Do you wish there were comments so you could yell FIRST?

Kickstarter does point out that once a project gets past 20% funding it is more likely to succeed than to fail.  There are a lot of projects (over 46,000 as of today) that fail while failing to reach that 20% threshold.   

So, that's what I'm hoping for today.  20% of this project is only $50, so we're talking baby steps.  One person could do that on their own, though I'm not trying to say that one person alone needs to.  If we can get to 20% today then we can just let momentum carry things for a while.  

Though, it would also just be great to fully fund it, too.  That would make things nice and easy.  

So why are you still here?  Go check out the project!

Wednesday, July 3, 2013

Tetris Pieces, Exponential Growth, and Unexpected Cryptography

I talked about Tetris a few weeks ago (here), and examined the counts of pieces across a number of games. That got me thinking about Tetris pieces, especially when I started to look at some of the Tetris variants that people have programmed.

One of the things that lingered in my mind was the idea that all Tetris pieces are made up of four 1x1 blocks.  I've played some variants over the years (many of them official) that did some other things with these four blocks, like allow for corner-to-corner connection (unacceptable!) instead of strict face-to-face connection, but none to my recollection that changed the standard use of four 1x1 blocks per piece.

So what would happen if we changed around this simple building block (haha) of the Tetris franchise?

The simplest Tetris game would be a situation where each piece was made from one 1x1 block.  When I say simplest, I'm not sure I can express that enough.  You just get the same piece over and over, and try to build lines with it.  It's basically two-dimensional Minecraft where the pieces fall from the top and sometimes disappear.

The two 1x1 block case is hardly different, actually.  There's still just one piece, though at least now rotation matters in game.  Not that much, though.

The three 1x1 block situation starts to get a little more interesting.


You still only end up with two distinct pieces - a hooked piece and a straight piece.  It might actually make for a fairly interesting (if not somewhat simpler) game.  Tetris Jr., perhaps.  Someone code this.

A situation with four 1x1 blocks is the Tetris we know and love, and produces seven pieces.



You should be familiar with these, but you can also see that they're basically just an extension of the pieces in the three 1x1 situation.  You can add a 1x1 block to the first piece (in the three 1x1 case) to make the square (O) block.  You can also add a 1x1 block to that piece to make the S, Z, J and L pieces.  You can make the T out of any of the pieces, but the only way to make the straight (I) piece is to add on to the straight piece from the prior set.  It's a rather simple but interesting point.

So we already have a pretty interesting set of numbers here.  The first two cases result in a single piece, then we move to two, then to seven.  We're more than doubling with the addition of one more 1x1 block because each piece already able to be made can produce a number of new pieces.  The more complex those pieces, the more places a block is likely to produce a new unique piece when placed.

Let's see if we can build a set of Tetris pieces with 5 1x1 blocks.  By that I mean, I'm going to spend some time doing that in Excel, and the next thing you'll see is that completed.



So there you go.  That might have seemed quick for you, right?

I worked each piece separately to make sure I was covering all bases, and didn't create duplicates within the same base piece (from the four 1x1 level).  I shaded pieces red if they duplicated a piece already made by a previous base piece.  That leaves us with 18 unique pieces, which we can see a bit clearer in this picture.



There you go.  Someone, make this game.

There are two things that stand out to me.

First off, there's a lot more pieces, but still only one straight piece.  Since it simply is what it is (all the 1x1 blocks you have to work with, in a line), there's only ever going to be one while the rest of the pieces keep expanding.  If you thought you were waiting a long time for a straight piece in the four 1x1 version you'd hate a version like this.

You could look at it this way:

1x1 blocks
I pieces
Percent of whole
1
1 of 1
100.0%
2
1 of 1
100.0%
3
1 of 2
50.0%
4
1 of 7
14.3%
5
1 of 18
5.6%


That's only going to get worse, though I'm not going to go past five 1x1 blocks given how much more work the six 1x1 case is going to be.

The second thing that stands out to me, though, is how close some of these pieces look to actual letters.  There are also 18 of them, and while some of the duplicates fail the rotation test in Tetris, they would look distinct enough on paper.

In fact, we'd only need eight reflections to get up to 26, which is a pretty interesting number because at that point we can build a substitution cipher with the English language.  So...let's do that.



I didn't really expect to end up with a substitution cipher when I started this post, but I suppose time makes fools of us all.

The nice thing about this is that each letter can fit in a 4x4 square, allowing for even further ciphering by expressing those letters not as letters but as a string of numbers.  Off the top of my head you could easily do that one of two ways.

The first would be expressing a letter as a string of numbers based on which squares were filled in.  In that way, 'a' would be 6/9/10/14/15, or 69101415.  The information can be parsed out without explicit spacing due to the lack of any letters in the cipher using the '1' square.  If there's a 1 in the number it means that it - and the next number following - are part of a two digit number.  In that way you can easily break 69101415 into 6, 9, 10, 14, 15.

The numbers also don't need to be in order, so the letter would be just as preserved written as 10149156.

Each letter could also be written as a 16 digit binary number (realistically less if we figured out which squares were never used).  In that way, 'a' would be 0000010011000110.  If you read my post on binary math you know we could easily translate that number into base 10 and come up with 1,222.

I think I'll revisit this one in a few weeks, as I think there's some other stuff we could do with this.  For now, though:




Wednesday, June 26, 2013

Coin spinning, flipping, standing OR How to bias 'randomness' (Part I)

A few weeks ago, Zane Lamprey broke the Guinness Book of World Records record for "Longest live audio broadcast streamed over the internet" with 25 hours of non-stop broadcasting.  He also successfully funded his new show "Chug" through kickstarter, for those of you who ever saw his prior shows.

During this 25 hours Zane and his co-hosts and guests talked about a lot of stuff.  There was a limit of 5 seconds of continuous dead air, so they pretty much talked non-stop (especially Zane after learning about the 5 second rule).  One of the things they talked about was the idea that while coin flips are basically fair, coin spins tend to be a bit more biased.  Allegedly, it's even worse if you stand a coin on its edge and then bump the surface on which it's standing.



The general idea is that a coin flipped with enough velocity imparted into rotation is basically fair.  A coin flipped by someone looking to bias it may be able to shift that fairness slightly, and someone looking to professionally bias it for a living may be able to eradicate that fairness altogether.  Practically speaking, however, if you're trying to flip a coin in a fair way it's pretty easy to do so (e.g. get a good toss and spin on it, and don't pay attention to which side started up or down, or better yet have someone who hasn't seen this call it, etc).

Things happen differently when you stand a coin on its edge and then agitate the surface, or spin the coin instead of flipping it.  In both cases it is alleged that you'll see a lot more 'tails' results, at least on Lincoln Memorial pennies.

The bottom line is that a coin flip or spin is simply a system of knowable physical properties.  A physicist with enough gumption (these folks are mathematicians) could sit down and write a Lagrangian for the system to determine the outcome given starting conditions (e.g. position, initial velocity, initial height, etc).  I'm by no means saying that it would be easy, I'm just saying that it could be done.  [The easiest case to start on - those of you who have already opened their lab notebooks - might be the standing on edge case where the force comes from one side.]

Without such a Lagrangian, people like to just come up with reasons for things they observe, and then apply them without worrying about pesky things like the scientific method.


For instance, people who have examined this so far have come up with two main suggestions, the first far dominant over the second.

1) One side of the coin is heavier than the other, and so a spinning (or disturbed standing) coin will fall toward that side.  Thus, the other side will come up more often.

2) The way coins are struck leaves the edges to one side smoother than the other, and so a spinning (or disturbed standing) coin will fall toward that side.  Thus, the other side will come up more often.

Both would appear to make some sense, though warrant further examination.

Now, I'm also not saying that it's by any means practical to deduce any of these smaller effects by brute force statistics.  The whole point - as will hopefully become apparent - is that by manipulating these effects we can potentially make them large enough to overpower any potential smaller confounds (like imperfect spinning, or the fact that the table I'm spinning on isn't a polished, frictionless surface).  There is a balance to be struck here between the extremes of dismissing an experiment out of hand because it would be impossible (or impractical) to do it perfectly and not doing an experiment at all because you think you know how things work and don't want to take the time.

Let's start with some coin flipping.

Most of this research on pennies is a few years old, and as such focused on the old US penny design with the Lincoln Memorial on the 'tails' side.  I was able to find one of those in excellent condition sitting around - the idea being that a penny that had some wear might a) collect 'gunk' on one side or the other, leading to an unequal weight distribution, b) receive uneven wear on the faces of the coin, leading to an unequal weight distribution, or c) receive wear on the edges, removing any bias in edges from striking.

Flipping was rather boring, and led to a fairly predictable outcome.  Of 50 attempts, 24 came up tails and 26 came up heads.  Is that biased?

Well, I could write a much longer post just about how many times you realistically have to flip a coin to tell if it's actually biased, but let's just quickly compare this result to something which we have reason to believe should be quite a bit less biased.

If you read the post a few weeks ago you know how to generate random numbers in a program like Excel or Google Docs.  We can quickly generate 50 random numbers that way, which will fall between 0 and 1.  Then we can check what proportion of those fall into the top or bottom half of that scale.

I would suggest you do this for yourself just to see how such a random distribution breaks down at this sample size.  My first draw got me a distribution of 23 'bottom' and 27 'top'.  It's perfect to illustrate my point, so I'll stop there - 24/26 split on coin toss seems fair enough to me for all practical purposes.  I could flip it again until I have the same number for each side and then stop there - would that satisfy randomness any better?

No, that would be cheating.

How does this same coin fair on the spin test, though?  Well, it's a little worse.  This time the split is 29 tails to 21 heads.  I'm a little more impressed with this, for two reasons.

First off, it's a little more outside the range of what I'd be expecting.  You might say, well you just observed a 27/23 split on something you are holding up as random, so why is two more off this that impressive?

Well, second (off?), we have directionality in our hypothesis this time.  The expectation is that tails will come up more, which is what is happening.  I'm confirming something that has already been shown, rather than deriving something from sheer exploration.  When flipping I wasn't expecting a bias in one way or the other, so being convinced of a bias in either direction should be more difficult.  How much more difficult is an entirely different discussion.

It should be said that these spins - at this point and continuing through the rest of this post - have all been done with the same direction of rotation relative to the ground.  That direction is clockwise looking down from above, or a right-hand rule result of negative Z in a Cartesian coordinate system.  There is much to be said about testing a counterclockwise or positive Z spin, but that's more than I want to realistically talk about today.

I wondered if this would hold up on other coins, so I found another shiny new penny - but this time of the new 'shield' penny variety.  Without a hypothesis here I'm back to a bit of exploration, but found similar results of 29/21.  Interestingly, though, this time in favor of heads instead of tails.

By the way, I have no reason to believe that this or any other coins I have is biased in flips (and frankly, I simply don't care), so I didn't check flips on this or any other coins.  Looking back I'm wondering why I even did on the first penny.

Anyway, looking at one type of penny at a time seems prudent as a start, so I'm simply going to let the shield penny slide for now.

There's another part to this, though, and it's the whole standing up and bumping.  The idea is that if you put a penny on its edge, then destabilize it, it's biased again toward tails.

Turns out it's not the easiest thing to stand a penny on its edge, but the results seemed so clear so quick that I didn't have to do it for long.  Of ten attempts, I ended up with 9 tails and only 1 heads.

Before you start speculating, I also tried to vary things as much as possible (you might say introduce as many confounds as possible) as to check that it wasn't just the fact that my table was tilted in one direction or another.  If one trial was in one area I tested the next with the coin 180 degrees from that, then 90, then 180 from the 90, then a whole different area of the table.

I also tried to bump the table with fairly uniform strikes from my fists some distance away from the coin and from random (and sometimes dual and competing) directions.  Nothing really seemed to change the fact that this coin wanted to go tails up.

Intrigued, I reached the part where science comes into play.

Some of the brightest people I've ever worked with have always pushed the idea that unless you're able to manipulate an event, you don't actually understand it.

In this case, people claim to understand how this whole penny problem is working out.  They postulate that it's one of the two above ideas, but I've been unable to find anyone who has actually sat down to manipulate either of them to actually strengthen (or weaken) the effect.

So, I sat down to try and strengthen (or weaken) the effect.

The first thing on my mind was how to see if weight played any role.  There are two obvious ways to manipulate this - add weight to one side or remove weight from the other.

Not wanting to deface any coins at the moment, I decided to try to add weight to one side of the penny by simply adding some small cut squares of packing tape.  I made sure that they didn't extend to the edges so that they wouldn't interfere with any spinning, and the result was a coin that from a distance didn't really look much different than normal (since packing tape is transparent).

I put the tape on the tails side to see if I couldn't negate the effect that we're seeing.  If the heads side is in fact heavier, then adding weight to the tails side should (at some level of weight addition) eliminate that bias.

Ten trials with the coin stood on edge, and no great change in which way they fell.  Instead of 9 tails and 1 heads, this time I found 8 tails and 2 heads.  The difference is in the direction I was expecting, but it is by no means the game-changer that would eliminate that bias.  Wondering if the weight was enough to do anything, I decided to try the same with spins.

Keep in mind, the last time I tried spinning this same penny resulted in the expected bias toward the tails side:  29 tails vs 21 heads.  The effect wasn't as strong as the standing on side effect, but it was there.

Of 25 spins (I was getting a little lazy), the effect does seem to be reversing.  By putting a small amount of tape on the tails side of the coin, it now appears to be biased a bit toward falling heads up - 16 heads to only 9 tails.

Putting the tape on the other side of the coin is also biased toward heads, though.  It's a little less, 14 vs 11, but it might mean that the tape isn't really enough to do much, or there's something being canceled out here that's bringing things back to near-random.

A little bit of tape is one thing, but I found myself wanting to really knock this thing out of the park and fully bias a coin in one direction or another.  Frankly, a penny is too small to add much weight to, but a quarter gives a lot more surface area to play around with.

To start I figured I'd check to see if an old (but good quality) eagle-backed US quarter would be biased in the spin test.

Emphatically yes, it would appear.  In the first 10 spins only 1 came up heads.  I tried another quarter, and it appeared to be similar.  I could test more quarters and see if there's a consistent effect here, but what I'm really trying to do at this point is simply show that something I do can change the result.  I don't care what the starting result is so much as I care that by some intervention it can be changed.

That intervention is (ostensibly) weight.  A few pieces of tape on a penny is one thing, but for this test I wanted to really just overpower smaller effects.  So, I used some tape to carefully tape a dime to one side of the quarter.

For reference, I used the old loop tape onto itself and put under technique, like you might use to hang a poster on your wall.  That way I didn't run the risk of taping too close to an edge and introducing other variables.  The dime sat safely in the middle of the face of the quarter, so there was no worry that its edge might graze the table either - if the dime was touching the table it was already well on its way to (read: unavoidably) falling onto that side.

The weight of a dime would seem to be drastically greater than the weight differential of either side of the coin,  and my only concern was the fact that I'd done something aerodynamically detrimental.  Something to think about, though it turns out (later) that other things might actually be at play.

[By the way - as a quick aside - the addition of this weight was enough that the quarter was no longer willing to stand on its edge, thus making the standing and bumping aspect of this impossible.]

If the above weight arguments are working properly, then the idea would be that the head side of this quarter was heavier, and thus causing the quarter to fall with the tails side up.  The first natural thing to try, then, was to place this dime on the tails side to see if that weight would pull that side down faster, leaving the heads side up.

And this is where things start to get weird.

10 spins.

10 tails side (with dime taped to it) up.

Oddly, then, it would seem that I'd solidified the effect that had already been occurring.  There is simply no way that the weight differential was still in favor of the heads side of the quarter (if it ever had been).

There's a simple way to confirm that - move the dime to the heads side of the quarter and see if that will reverse the effect.

Well, yes.  10 spins, this time 8 heads (with dime up) and only 2 tails (with dime down).

I was such in doubt of my own results that I ran both cases again.

The dime on heads side was similar, with 7 heads (with dime up) and 3 tails (with dime down). 

I kept spinning the dime-on-tails-side hoping that I'd eventually get a heads (dime side down) result.  I have yet to reach that point.  I spun 40 more times, just to get to a nice even 50 overall, and have yet to end with anything other than a tails (dime up) result. 

It only took me a few spins on this second run to figure out what I believe might be going on in this case, though.  It's not the fact that a heavier side will fall (as it might be if it was standing on edge), but rather that introducing more weight on one side of the coin shifts the center of mass.

Why is the center of mass of the two-coin system important?  Well, it's potentially important on the one-coin system as well, but in the two-coin system it has a pretty profound impact on axial tilt even on a pretty hard spin.  Systems rotate around their center of mass, so if that is pushed outside of one of the faces of the coin (or toward one of the faces, in a less extreme example), the axis will drift to keep that side inside the spin. 

That is to say that even on a spin with a whole lot of energy the spinning coin fails to achieve a spin perfectly perpendicular to the surface on which it is spinning.  It maintains an axial tilt that keeps the dime side 'internal', so to speak.  As the coin slows, the axial tilt increases, as it's only the energy in the spin that is keeping it even close to a zero tilt system.

The short answer (and longer question) is that an unequal distribution of weight might cause differential effects in spinning vs standing coins due to the fact that axial forces can come into play during a spin but only gravitational forces will come into play (ideally) in a standing bump test.  

All in all, from a numbers point there seems to be something here - though it's certainly not as simple as it might first appear.

What can we really get out of this so far?

Well, edging of the coin might not be a strong factor, at least not as strong as some of these weight changes.

The bump test and spin test seem to be producing effects of different sizes, or at least effects that are more robust to interference.  More importantly the bump test might be driven by gravity and the spin test driven by shift in center of mass.

Placing a relatively large weight on one side of a quarter tends to favor that side ending up face up, though there are also some problems of shift in the center of mass and axial tilt.  This might come into play in all coins, to a lesser degree. 

Overall, though, I think I'm left with more questions than answers.

There may be reason to believe that at least some of the forces that might be working on a spinning coin are based on spin direction - I've kept that constant so far but might find drastically different things with a reversed spin.  The only thing that should operate this way would be the Coriolis force, which seems like it may be one of the smaller effects operating in this system.

Taping a dime to a quarter is a quick proof of concept, but the additional protrusion that this introduces leaves me a little unhappy.  I'd like to figure out a way to increase the weight distribution without changing the shape of the coin, but that would seem to involve some metalworking.  

I didn't look specifically at edging yet, but it would seem that a quick brush with some sandpaper might be enough to give one edge or another a smoother...edge.  The problem with this is - unlike some tape on the face of the coin - that such a technique is destructive to the object being tested.  Unless I had two coins that I believed to be - for all intents and purposes - identical, I couldn't test the second edge sanded alone after I'd already sanded and tested the first one.

All in all I thought this was going to be fairly straightforward, but some of these odd results have be a bit intrigued.  I've put a (Part I) on this because I want to spend some time thinking about this as well as running it past others - by all means if you have suggestions or thoughts post them in the comments.  I'd love to figure out what's actually at play here.

Wednesday, June 19, 2013

Why the Stanley Cup Finals Don't Have Shootouts

It's Stanley Cup Finals time, and that means it is time to look at some hockey numbers.



(borrowed from http://www.printactivities.com/Mazes/Shape_Mazes/stanley-cup-hockey-maze.html in the spirit of fair use)

I always say that for most sports I don't care as much about win or lose as much as I care about just seeing a good game of [sport].  I think that holds fairly well for hockey, though in this particular Stanley Cup series I'm cheering pretty hard for my hometown team (the Blackhawks).

Nothing says good game of sport like playing it longer than normal, right?  A blowout in either direction is usually pretty boring, and coming to the end of regulation in a tie usually means just the opposite - a fierce, well-matched game of sport has likely been played to that point.

If you like watching hockey, you've already received a sort of buy two-get one free deal on the first two games of the Stanley Cup Finals between the Blackhawks and the Bruins (and Bruins fans got an extra freebie on that third game).  Two full periods - and some change from two other partial periods - were played outside of regulation in just the first two games.

If you watched those games, but don't really follow hockey a lot, you might have been scratching your head at some point during the second or third overtime.  "When do they get to the point where it's like in the movies and guys just shoot on the goalie?"

Well, we're in playoffs now, so...never.

You see, the rules of overtime play are different in regular season and post-season play.  In regular season hockey, overtime is a sudden-death (i.e. first team to score wins) five minute period, followed by a short break and then a shootout.  In post-season play, you just keep playing sudden-death (but otherwise normal) 20 minute periods until someone scores.

As long as no one scores, the game will simply go on and on.  If you're interested, the longest game of NHL hockey extended into the 6th overtime, and finished with a total of 176 minutes and 30 seconds of ice time.  The game was in 1936 between Detroit and Montreal, and the goal scored 176 minutes into the game was the only goal of the game.  If I could go back in time and watch any one game of hockey, that might just be it.

You may be asking "Yeah, but why make them play so much hockey?  Why not just go to a shootout?  If it's good enough for the regular season it's good enough for playoffs.  Come on."

Well, truth be told, shootouts aren't really good enough for the regular season.  It would appear that they're tolerated simply because they make great ends of movies (i.e. they're fun to watch).

I'd always been told that the reason shootouts aren't in the playoffs is because they are poor predictors of actual skill.  Granted, they measure a particular level of skill (I couldn't go out there and score a shootout goal against...well, probably anyone), but they completely fail to differentiate skill levels within the range of skill being measured (professional hockey players).

Imagine if a basketball game tied after a few minutes of overtime simply came down to a free throw competition, or - more appropriately - a series of one-on-one layup attempts against a team's best defensive player.

Imagine if a baseball game's extra innings consisted of every fielder except the pitcher and catcher taking the bench, and every hit simply being an in-the-park home run (actually, that might be awesome).

Imagine if football's overtime was, well, exactly as they do it now.  Come on, it's not like they want to play extra football.

Anyway, I've always just accepted the notion that this skepticism surrounding shootouts was true.  Given the shortened season this year, though, I figured it would be easy enough to go into the team records and pull some data on who actually does win the shootouts in the regular season.

Given that teams play each other (duh), I was able to cover a large majority of the shootouts that took place this year by looking at three random teams in each division (there are five teams in each division, three divisions in each of two conferences).

This sample produced 83 regular season games which were decided by shootout.

I was also able to determine - based on their standings at the time of the game involving the shootout - which team was favored to win, and which was the underdog.

If shootouts are actually getting at the skill of the team, then we'd expect to see teams with better records more likely to win shootouts (because they've shown themselves to be better at winning games, which is the main established criteria of hockey skill).

I'm not sure I really have any way to continue to hold you in suspense other than this sentence, so here is this sentence that's really just designed to hold you in suspense for the time it takes you to read it.

Of those 83 games, 45 (54.2%) of them were won by the underdog.  Only 38 (45.8%) were won by the team with the better record at the time.

Now, that's not too far from random chance (a 50-50 split), but random chance isn't what we're going for here.  Random chance would be if the NHL simply ended ties in regulation with a coin flip.  If we wanted to show that shootouts are useful they would need to display some bias toward the team with the better record.

Not only are we not seeing a bias toward the winning team, we're potentially seeing a bias against them.

So next time you're watching a shootout in regular season play (or someone you're with complains about lack of shootouts in the playoffs), take a coin out and give it a flip beforehand.  It might actually be a little bit more fair.

Wednesday, June 12, 2013

Distribution of birthdays and the availability heuristic

My birthday was this week, as were a number of my friends' birthdays.  I've always held the belief that the week or two surrounding my birthday is heavily populated by other birthdays of people I know, more so than any other time of year.  I know a few people that share my birthday, a few people that are the day before, a few that are the week after and before.

It can't be that my birthday week or two is special, though, right?

facebook is only good at a few things, and holding on to birthdays is one of them.  If you go into the events sidebar and then click on some stuff that makes sense when you see it you can eventually get to a calendar view listing off all your friends' birthdays (or at least those that use facebook and have put their birthday on it, and that are telling the truth).

It's a pretty easy way to pull down some data on a large majority of my friends' birthdays.  I have no reason to believe that birthday would have anything to do with friends' refusal to use facebook, so hopefully that data is missing at random.

It's a fun exercise, and I'd recommend you to do it if you're bored one day.  You might also think that your time of the year is special, and - well - if you do I'm here to tell you that it's probably not.

Well, unless your birthday is Halloween:



October 31st seems to be the most popular birthday, by a decent margin.  Seven of my facebook friends were born on Halloween (hi guys), with the next most popular date being June 7th (with five people - hi guys).  All other dates have four or less birthdays (hi guys, sorry you're not popular).

June 7th is pretty close to my birthday, so maybe this is starting to look like I was right all along?

If we're looking at the days with the most birthdays, we can also take a look at this with the least.  There are a lot of those - days where none of my facebook friends have a birthday.  What's the longest stretch of birthday-free days?  Well, there are two stretches of five birthday-free days.

Interestingly, they are right around the last place I would have expected them.



Well, that would seem to fly in the face of early June being anything particularly special.

There's still some other things we can look at, though.  How about months?  What's the most popular birthday month?


Oh, months have different numbers of days?  Okay, here's the same thing but normalized.


Or we could just look at quarters.


Overall, it looks like the late summer months are somewhat weak, as August and September are the only months where the average birthdays per day drops below 1.  Interestingly, May/June - despite some large gaps that we saw earlier - is still quite strong.  Both these months are closing in on one and a half birthdays a day.  This might actually start to explain some of what I've been picking up on through the years.

Perhaps the fact that June is still such a strong month even with so many days without birthdays is because the days that have birthdays (which happen to be around my birthday) have more birthdays than normal.

Well, the average birthdays per day across the whole year based on my friends' reported birthdays is right around 1.1 a day.  Those 3s, 4s, and 5s in that above table are starting to look pretty good, right?

In all, it's kind of hard to say one way or another that any part of the year seems to be the most populated (though late summer does sort of seem to be kind of desolate).  It is certainly clear that I have been a least a little biased by remembering the birthdays of individuals near mine (probably because I say at least once "hey your birthday is pretty close to mine!).   The spread of other birthdays does seem to be decently random, though Halloween still seems at least a little confusing.  What's the deal with Halloween, seriously?

Vampire/werewolf/zombie/ghost doctor conspiracy?

The moral is clearly that you should never trust anyone with a Halloween birthday (sorry guys - you might be ghost doctors or something).  Happy (belated/eventual) birthday, everyone!