The Santa Fermi Problem

How does Santa visit and deliver all those toys to the good girls and boys around the world in just one night?  With approximately 7 billion people on earth, that’s almost impossible to image.  Where do we begin to even come to grips with quantifying this problem?

Fermi Problems are illustrative of how scientist and engineers are trained to think – to systematically break down a large problem into simplier descrete steps and logically solve them with clear, well-reasoned assumptions and approximations.  Many high-level employers trying to fill cognitively demanding positions ask Fermi Problems in employee interviews to judge an applicant’s ability to think about complexity, think logically and think on their feet in real time (Google, Microsoft, Silicon Valley Startups, top global consulting firms, etc).

enrico-fermi( The great physicist Enrico Fermi 1901-1954 )

Often known as “back of the napkin” type analysis, Fermi problems are a way to reduce a complex problem into simple, clearly defined steps that work together to answer the complex problem.  A famous example is what is the probability that a breath you take today would contain any of the same matter that Julius Casear exhaled upon his death in 44 B.C. (The Last Breath of Cesear Fermi Problem)?

Assumptions and estimation should be derived from general knowledge or logical assumptions/derivative from such knowledge.  Generally, one shouldn’t have to look up key statistics or use a calculator to flesh out an answer.  To quote Wikipedia:

“In physics or engineering education, a Fermi problem, Fermi quiz, Fermi question, or Fermi estimate is an estimation problem designed to teach dimensional analysis, approximation, and the importance of clearly identifying one’s assumptions. The solution of such a problem is usually a Back-of-the-envelope calculation. The estimation technique is named after physicist Enrico Fermi as he was known for his ability to make good approximate calculations with little or no actual data. Fermi problems typically involve making justified guesses about quantities and their variance or lower and upper bounds.”

So let’s analyze just how Santa would be able to deliver all those toys on the night of December 24th.  This is what I worked out with my boys on the car ride this morning.

(1) There are 7 billion people in the world, of which about 2 billion celebrate Christmas (Christian or culturally observant)

(2) A simple population pyramid of these 2 billion celebrants would have about 15% in the 1-12 year old target market for Santa’s good girls and boys (or 15% of 2 billion = 300 million)

(3) Most of the Europe, America and developed parts of NE Asian are suffering population decline (if not for immigration) so there are a lot childless adults and married couples.  Assume an average family size of 4.0 (1.5 parents – many single parents + 2.5 children/couple where 2.1 children/couple is replacement level).  So our 300 million children are clustered into 300 million/ 2.5 children/household = 120 million distinct households to visit.

(4) Assume that some households request that Santa deliver presents on some day other than the 24-25th of December and that some naughty children are underserving of any gifts.  Let’s generously estimate this at 40 million to have a nice round number to work with in the next step.  120 million households with children – 40 million not delivered to on 24-25th = 80 million households

(5) Now say Santa can start work at 8pm in the evening on the International dateline and work 36 hours until 8am in the morning the next day on the International dateline.  That would give Santa an approximate present delivery rate of 80 million household / 40 hours = 2 million households/hour

* As an aside, a real problem for Santa is the uneven population distribution.  Although Santa could spend less or more than 36hrs/24 time zones per time zone depending upon the population density of each time zone, sparsely populated time zones like Islands of the Pacific Ocean and even rural areas will incur a lot of travel overhead. Fortunately for Santa, this aspect of his job has become significantly easier over the past +114yrs as the urban/rural populations shift toward urban (10/90 -> 90/10 in the USA).

Two million household visits/hr may sound like a lot, but it’s an order of magnitude less than our initial guess based simply on the planet’s population of 7 billion people.  Luckily, Santa’s sleigh is the only object with mass that we know can travel near or at the speed of light and he has legions of labor extendering elves (although their jobs are in danger of automation by Google’s self-driving technology and recent acquisitions in the robot space).

When we got home I Googled for “Santa Fermi Problem” and sure enough, there were others who contemplated this problem.  A detailed example of a deeper examination of the Santa question is given a physicist at Fermi National Labs.  The money quote:

“The distance Santa has to travel can be estimated from the following. First, while the surface area of Earth is about 1014 square meters, only about 30 percent of that is land mass, or about 0.3 x 1014 square meters. Second, we’ll assume, for simplicity’s sake, that the 800 million homes are equally distributed on this land mass. Dividing 0.3 x 1014 by 800 million gives 4 x 104 square meters occupied by every household (about six football fields); the square root of that is the distance between households, about 200 meters. Multiply this by the 800 million households to get the distance Santa must travel on Christmas Eve to deliver all the children’s gifts: 160 million kilometers, farther than the distance from here to the sun.

Thanks to the rotation of the earth, Santa has more time than children might initially think. Standing on the International Date Line, moving from east to west and crossing different time zones, Santa has not just 10 hours to deliver his presents (from 8 p.m., when children go to bed, until 6 a.m., when they wake up), but an extra 24 hours— 34 hours in all.

Even so, Santa’s task is daunting.

Now, some have guessed that Santa accomplishes his task by traveling at a speed close to that of light—let’s say, 99.999999 percent of the speed of light. By traveling that fast, in fact, Santa can deliver all his presents in just 500 seconds or so, with plenty of time left over (the remainder of the 34 hours) to polish off the cookies the children have left him on their kitchen tables.”

This is a much more rigourous examination of the question than I did with my son in the car because he solves for the estimated total path length Santa must travel, but most of our assumptions were in agreement.  I did notice one major error in the assumptions made:  Most humans on the planet do not celebrate Santa’s gift-giving which the author above assumes.

santa_speedingMerry Christmas and watch the color of Rudolph’s nose in the sky to estimate Santa’s speed on Christmas eve.



eV3 Programming

In our last meeting before Christmas, we got a chance to review basic eV3 programming which mostly includes:

– Driving straight a fixed distance or stopping on a color

– Squaring up with wall with touch sensor

– Squaring up with 2 color sensors

– Using the gyro to make accurate turns

– Following an edge of a line with a PID follower program

You can relax in that FLL mat programming is relatively simple compared to the complex examples you can find in other eV3 books like The LEGO Mindstorms eV3 Laboratory.


The challenge of FLL programming in eV3 comes in getting these simple programs to execute reliability and quickly.  Also, the user interface takes a little getting used to as does learning different ways to do the same thing in case you need to try several work-arounds.

Unfortunately, we initially ran into several unexplained problems on our new eV3.  For example, our first several tries just to drive in a straight line failed as did our first several attempts to make a simple tank turn with only 1 or 2 basic blocks.  Just as mysteriously, they disappeared.

Nearly all the programming we’ll need to learn can be found in easy to digest nuggets at the website  The website presents a number of beginning, intermediate and advanced lessons – most of what we’ll use are the advanced lessons which are each usually less than a dozen basic blocks in size.  If you’re new to eV3 programming, just run through the lessons at all levels and should have have a great foundation to program all our FLL missions.


Rules, Judges and Errors in the Robot Game

FIRST LEGO League has a pretty extensive collection of rules for the Robot Game and they make addendums throughout the season as new questions arise.  There have been about 4 updates so far this season.

However judges, like coaches, are volunteers, fallible and only given a few hours of training in which to absorb a mini-law school education in FLL rules and how to apply them.  We’ve seen several errors in our tournaments and judging, including:

* One team brought several identical ev3 robots to the competition table and just swapped them out during their run.  That is, they had 2 robots at the table and made attachments and other changes to one while the other was running.  This is a huge advantage for this one team because they required no time between runs out of base to change attachments or select programs.  The judges at the tournament didn’t catch this, but this was specifically addressed as illegal in the latest December 5th clarification.

* The Engagement Mission specifies that the robot can only rotate the dial 180 degrees for each trip out of base.  We’ve seen a robot that sat in base and repeatedly turned the dial without leaving base which violates the stated rule that the robot must return to base between each 180 degree rotation.  It was a clever attachment and the team was awarded the full 56% credit on the Engagement Mission for a whopping score of 745!  See the next post above for a video of this amazing device.

* Many teams grab their robot with cargo (eg a bit or reverse engineering basket)  before it has completely entered base.  The rules state that the robot can be pulled into the base by any part that is in base, but any cargo not completely in base must be left on the mat outside the base when the robot was touched.  I didn’t see this rule enforced when this situation arose.

* Many teams have reported errors in scoring because the judges encounter a lot of new situations or exceptions to the rules in real-time and are only given minutes to mark down a teams score.

Like life, human error also happens in FLL tournaments.  Coaches and other adults are not allowed to participate or even watch most of the events the FFL team does.

Therefore, it is up to you, the kids, to speak up in a friendly, respectful, clear and confident manner to the judges if you see any possible error.  Adults and coaches are only there to observe and even then, they are not allowed to enter the judging rooms.

It is also important that you read and understand the rules linked above if you want to raise a question with a judge.

referee_argueBe warned that the judges word is final and generally they will not have time to re-read the manual or view video tape replays.

eV3 Color Sensor

P1190332( Right:  New eV3 color sensor vs Left: Old NXT color sensor)

The eV3 doesn’t come with separate color sensors and light sensors like the NXT.  Instead, it comes with a new eV3 color sensor which more accurately detects more colors as well as can be used in reflective mode as a light sensor to detect colors in a gray scale.

ev3_color_spread( Light dispersal from top LED which is reflected and read by sensor below )

In less common usage, it can be used to detect light shone upon it.  Surprisingly, it can be used like a near field ultrasonic sensor to measure short distances betwee 1.5 cm to 5 cm since it can read it’s own reflected light off a nearby surface and judge short distances depending upon the intensity of the light that is reflected back to it.

Here are two videos (parts 1 & 2) that do a good intro on the eV3 color sensor:


The eV3 color sensor is our most commonly used sensor.  Guidelines suggest setting the color sensor perpendicular to and 8-16mm above the mat surface with sheilding to avoid effects from ambient light.

The more in front of the drive wheels they are located, the sooner they can detect mat markings and better to effect changes based upon markings like turns.  The wider apart they are the more accurate squaring up becomes.  Both of these changes come at the expense of lengthing and widening our robot chassis respectively, which generally reduces manueverability, increases weight, etc.  – typical design tradeoffs we’ve seen all season.

We use it to help make our way around the field by:

– detecting and differentiating colors on the mat

– following lines and stopping at them

– squaring up to lines to correct for accumulated errors in driving/turning

The eV3 Education Kit comes with only 1 sensor so we had to order another for $35 to be able square up.  Ideally, we’ve considered using 3 to square up to lines in both forwards direction and sideways direction (if they weren’t so expensive).

Whereas we had a lot of spurrious problems with the NXT color and light sensors, the eV3 seems to be much better behaved.  The much fewer number of reported eV3 color sensor problems support this observation.



eV3 Gyro Sensor

gyroscope_md_wmThe new gyroscopic (gyro) sensor on our new eV3 robot is a potentially powerful but sensitive device.  You can basically think of it as a fancy electronic compass with the following twists:

1)  It doesn’t measure true North/South/East/West and all points inbetween.  Instead, our FlopBot can read two numbers from the gyro:  (a) a number representing current angle in degrees turned in a 2D plane, and (b) a number representing the rate of turning or rotation in units of degrees per second in that plane.

2)  Everytime the gyro is (a) programmically reset or (b) powered on by turning on gryo the angle value is (re)set to zero.  There is an undocumented way to reset the gyro that appears better than just using the reset option on the gyro sensor block (see Caution #3 below).

3)  With the gryo placed parallel to the mat surface and looking down on the robot, a right or clockwise turn will increase the angle value from while a left or counter-clockwise turn will decrease the angle value.  For example, starting from a gyro reset/powerup condition, turning right 1 full circle should increase the gyro angle sensor from 0 to 360 while turning left 2 full circles should leave the angle sensor at -720.

( Do not un/replug in gyro sensor to reset )


1)  Unlike Platonic Forms, the gyro sensor like all other material sensors and motors suffer inherent inaccuracies.  Manufacturers of electronic components statistically analyze and use quality control to ensure every component will reliably work within a given range of errors under various ranges of operating conditions (summarized in various charts and spec sheets).

The eV3 gyro spec sheet is very sparse and ambigious.  It states the gyro can measure angles within + or – 3 degrees of accuracy.  An optimist may hope for an accuracy of 3 degrees per 360 complete turn or 0.83% accuracy – wrong.  In fact, the error should increase as the turn angle increases and recorded more than 3 degrees error per 360 degree turn in our tests a few weeks ago. Manufactures generally game these specs by measuring these errors under unrealistic opering conditions, raises the question of how large an turn can you make and stay within that +/- 3 error range under normal conditions.

Since each turn adds some error to our gyro reading, it’s best to minimize the number of turns and, since errors accumulate, line up with a known wall or line and periodically reset the gyro to eliminate the accumulated error.  Note the trick to reset the gyro in #3 below.

2) The gyro needs to be very still when powering up or resetting to get a more accurate angle value.  Any giggling of the device when the powering up or resetting the gyro may result in greater errors.  Un/replugging the gyro cable is an unreliable way to reset the gyro (besides it is virtually impossible to keep the gyro motionless while un/plugging cables).

3)  The gyro may suffers drift where, even when stationary, the angle readings change.  One recommended way to fix drift is to reset the gyro by switching the gyro sensor block from angular velocity to angle mode with a 2-4 second pause afterwards to let the gyro stablize before proceeding.  Simply dropping a gyro sensor block and selecting reset doesn’t solve this nether does un/replugging the gyro cable.

4)  The gyro readings have latency and often overturn slightly.  If you’re turning from rest until your gyro reads 90 degrees, you’ll often overturn because the inertia of the robot and/or the fact that by the time the gyro reads 90 degrees and your subsequent software blocks test it and shut off the turning motors the bot will have turned a few degrees more.  What are three ways you could compensate for this over turning based upon gyro readings (hints:  pad, rev and PID)?

FlopBot needs the gyro to help navigate the field accurately.  It can help us make (1) more accurate turns and (2) possibly drive in straighter lines.  Here are two links to study and discuss in our next meeting:

(1) Creating Gyro 90 degree Turn “My Block” (with simple fixed correction factor)

* NOTE:  Try to think of a more general way to correct turns of any degree

Another example of making a simple 90 degree gyro guided turn

(2) How to Use the EV3 Gyro Sensor to Make Your Robot Go Straight

* NOTE:  There may be an error in this code as written.  It did not work when we tested it.  Can you spot the potential bug?  We can debug it to track it down and come up with several solutions.

Individual Talent < Teamwork < Networking

One of the unique aspects of FIRST LEGO League is the emphasis on Gracious Professionalism and Coopertition.

I-m-right-you-re-wrong-I-win-you-loseWith academic subjects we are taught to spend our entire time in school to compete against everyone else for the highest score on the curve.  There has been a trend to integrate more teamwork into academic studies, but in the end it is you alone that either get the A or accepted to the college of your choice, not a team.  The prestige of a degree strongly correlates to a high rejection rate which just intensifies the competition for the few open spots.

trash_talk_ali_listonWith sports, individuals or teams ruthlessly compete against other individuals or teams in a zero sum game.  The more losers we leave in our wake the more prestigious our victory.  Popular sports like basketball and football even institutionalize adding insult to injury via ingrained trash talk and showboating.  For the entertainment sport of professional wrestling, the verbal trash talk drama is as important if not more so than the physical match.

Strong individual talent and a competitive team spirit are great assets, but they only take you so far.  In fact, overdone, they are self limiting and even self-defeating.  A talented individual with a “difficult personality” under-utilizes opportunities open to them and/or is often relegated to a cubicle or low-visibility position to minimize the damage a disagreeable personality can do to the team and organization.

difficult_personalityA strong team player who can’t see beyond their immediate environment is likely destined to become a follower and simple cog in a bureaucratic machine.  Although such a person will have much better prospects than a peer lacking teamwork skills, they will once again be self-limited to working within roles defined for them by others and following orders.

A skill beyond simple individual success and well-defined teamwork is the ability to make connections and friendships with new people and expand one’s social network.  Most people are either born with the curiosity, drive and openness to do this naturally or learn it in the course of their careers.

I’ve not seen it formally taught, but it’s easy to observe networking and outreach skills among groups of the extremely successful including:  Silicon Valley entrepreneurs and venture capitalists, finance deal makers, politicians building a support base and any elite university like Stanford or Harvard MBAs.  As any entrepreneur or politician can tell you, a powerful social networks usually trumps everything because from that can arise everything else that paves the way to success:  money, talent, sales, partnerships, laws/regulations, etc.  As many jailed corrupt Chinese politicians/businessmen can tell you, naked money without powerful networks can ultimately lead to nothing.

In today’s hyper-competitive world, the FLL principles of Gracious Professionalism and Coopertition seem quaint, counterintuitive and even self-defeating.  However, judiciously and honestly applied – they are at the heart of the greatest possible personal and professional success and fulfillment.

We are programmed by nature and taught by education and sports that life is a zero-sum game.  If someone else wins, we lose.  However, to create something far beyond our limited abilities we need to reach out and see others as opportunities, resources and potential allies in overcoming the seemingly impossible, not as competitors or threats.  FLL is unique in giving kids the opportunity to experience the power of this insight.

Will_RodgersA stranger is just a friend I haven’t met yet.” – Will Rodgers


Genuine LEGO Parts vs Copycats

I seem to have received a batch of knock off LEGO pieces from my latest online order.  I’ve seen other copycat LEGO brands like KRE-O and no-names from China, but this batch fell somewhere in-between genuine LEGO quality parts and these knock-offs (plus they were advertised as LEGO pieces).

Still, these pieces easily stood out as fakes against the thousands of dollars of real LEGO pieces from several LEGO retail and Education Mindstorm Kits and Expansion Sets, over 3 dozen orders on and a number of LEGO sets purchased over the years.  This high quality of genuine LEGO pieces make it easier to spot fakes.

Here are some amusing LEGO copycats:


( LEGO has exclusive rights to Star Wars merchandise )


( LEGO does not make military models )


( Fake set missing the final “a” in the LEGO created the animated series “Chima” )


( Fake set not missing the final “a” in LEGO “Chima” )







( Definitely non-LEGO Adult-themed custom sets )


Because LEGO is expensive, I always assumed they were protected by patents.  What I didn’t realize is that LEGO’s patent expired and they failed in their bid to sue copycat manufactures.  Despite losing their patent protection on their basic building bricks, as of 2012 they are a $3.5 billion dollar corporation with their closest competition MEGA at $0.4 billion.  Here is an NPR story that examines why LEGO can charge so much more than their competitors for a similar product.

Perhaps the biggest reason LEGO can charge so much more is their insane quality control.  This gives LEGO pieces a decent resale value while there is relatively no resale market for knockoffs (unless passed off as LEGO pieces).

Per FIRST LEGO League rules, our robot must be made of 100% LEGO parts.  Any non-LEGO parts are grounds for disqualification.

Although the parts I received look identical to LEGO parts and seem to have the right dimensions, they have a dull sheen, are uniformly sticky and seem to be made of a lower quality plastic then genuine LEGO pieces.  Although the pieces are new and unmarred, they have a uniformly tacky touch that gives them away (probably due to the plastics used and the injection mold process).  Here are three tells that this batch is fake:


lego_fake_white_injection_web( Fakes have many surface wrinkles especially near injection points whereas LEGOs have a smooth finish on their surface – this photo doesn’t capture how big the difference really is )

lego_fake_logo_web( This fake piece is entirely missing the “LEGO” stamp anywhere on it whereas the real LEGO piece has “LEGO” stamped on it however many fakes do have an illegal “LEGO” stamps )


Here is a very detailed rundown of the many LEGO copycats and how good/bad they are at quality and set design:

BTW, counterfeit consumer goods account for approximately 5-7% of all world trade ($250 billion in 2007) with about 80% coming from China which rarely enforces intellectual property rights.  Products that demand premium prices well above manufacturing costs due to a luxury brand (eg Apple, designer clothes), strict regulation and high quality control (eg pharmaceuticals) or high taxation (eg cigarettes) are copied more frequently.  Even counterfeit Ferraris and Porsches find their way onto the roads in Asia and fake electronic components are increasingly discovered in advanced US military systems.


Turning Test of Machine Intelligence

In our meeting last night, we discussed how machines may surpass human intelligence in our lifetimes based upon projections using Moore’s Law.  This raises the question of how to measure machine intelligence and compare it with human intelligence.  Just exactly what is Artificial Intelligence and how it compares to Human Intelligence is a huge debate.

There are various benchmarks at levels (1) low (number of human neurons vs machine equivalent logic circuits), high (machines beating the best humans at cognitive challenges like chess (Big Blue 1996-97) or Jeopardy (Watson 2011)) and everything in between (driving a car or passing a Turing Test).


The Turning Test is interesting because of it’s simplicity:  if a machine can chat online and fool humans into thinking it is human then it has passed the Turning Test.  Eliza was perhaps the first popular software program to bring the Turning Test to popular culture in the 1980s.  Eliza is designed to mimic a psychologist from the Rogerian school of therapy which involves constant redirecting questions at the patient – chat with Eliza on the web.


Several decades later, there are a number of online chat bots like CleverBot and JabberWacky that make failed attempts at passing the Turning Test but clearly fall into the Uncanny Valley  – a noman’s land between realistic and obviously false simulation.


Speaking of Alan Turing, there is a promising moving coming out about his efforts to develop one of the first programmable digital computers in WWII to help break the secret NAZI’s enigma code.  In fact, the code was broken by cryptographers in Bletchley Park which was one of the greatest secret weapons the Allies had over the Axis in WWII.  Here is a clip of the movie:

And here is a short introduction to Alan Turing.  It’s a bit Hollywoodish in how it elevates the individual narrative and adds many ahistorical bits for dramatic effect and marketing reach, but it is a study in the mythical rare lone wolf and tortured genius.