Sunday, May 22, 2022

278: Bicycle Repair Man

 Audio Link

With the arrival of summer weather in many parts of the U.S., it’s time to think again about various outdoor activities.    Watching a few bicycles pass by my house the other day brought to mind a famous anecdote about pioneering mathematician and computer scientist Alan Turing.   As you may recall, Turing was the famous British thinker who not only founded theoretical computer science, but also was the primarily visionary in the project to crack the German Enigma code, a key contribution to the Allied victory in World War II.   As often happens with such geniuses, his personal life was very odd, though he usually had reasons for whatever he did.   For example, he was mocked as ridiculously paranoid for chaining his favorite coffee mug to a radiator.  But there are rumors that years later, a pile of smashed coffee mugs was found near his old office, apparently thrown away by a disgruntled co-worker.    Another crazy story involves Turing’s efforts to repair his bicycle.


As the story goes, Turing noticed that every once in a while, the chain on his bike would come loose, and he would have to stop and kick it a certain way to get it back on its track again.   After a while, he noticed that the intervals at which this was happening seemed kind of regular, so decided to check that theory rigorously.   He attached a mechanical counter, and started measuring the exact interval at which this problem was occurring.    It turned out he was right— the intervals were regular.   The number of clicks between failures was proportional to the product of the number of spokes in his wheel, the number of links in the chain, and the cogs in the bicycle gears.   Once he discovered that, he took a close look at the components, and soon discovered the root cause:   there was a particular spoke that was slightly bent, and when this got too close to a particular link in the chain that was also damaged, the chain would be pulled off.   Armed with this knowledge, he was able to correctly fix the bent spoke and resolve the problem.    It’s been said that any competent bike repairman would have spotted the issue in a few minutes without bothering with counters and intervals, but the mathematics of that would be pretty boring.


Naturally, as with any anecdote about someone famous, there are some alternate versions of this story.   My favorite is the one that changes the ending slightly:  once Turing figured out the formula for when the chain would jump off, he started carefully calculating the intervals as he rode the bike, and stopping to kick it at the exact right times he calculated.   That’s a fun one, and certainly fits into the stereotypes of Turing’s eccentricity.   But I do find it a bit hard to believe.  When riding a bike outdoors, there are lots of variables involved to interrupt your concentration:  road obstacles, changing inclines, approaching cars, etc.   Could someone safely riding a bicycle successfully keep a running count of the wheel and chain rotations, over a continuous ride of several miles?   And in Turing’s case, it was further complicated by the fact that he always wore a gas mask as he rode, to prevent triggering his allergies.   But the alarm clock he was known to wear around his waist might have helped.


In honor of this story, there was actually a proposal back in 2015 to name a bicycle bridge in Cambridge, England after Turing.   I didn’t see any further references to this online, so it looks like it didn’t pass.   But there’s plenty of non-bicycle-related stuff named after him in the computer science world.    If you want someone to propose a bicycle bridge in your name, next time your bike breaks down, think about the clever mathematical tricks you might use to diagnose the issue.   Also, remember to found a branch of mathematics and win a world war.    Or forget about the bridge, and just take your bike to a competent repair shop.


And this has been your math mutation for today.




References:  












Wednesday, March 30, 2022

277: Bad Career Advice

 Audio Link

Welcome to Math Mutation, the podcast where we discuss fun, interesting, or weird corners of mathematics that you would not have heard in school.   Recording from our headquarters in the suburbs of Wichita, Kansas, this is Erik Seligman, your host.  And now, on to the math.


As I mentioned in the last episode, I’ve recently reread Nassim Nicholas Taleb’s  classic book “The Black Swan” , about the disproportionate role of unlikely extreme events, the Black Swans, in shaping our lives and our history.    Today I’d like to discuss another of the intriguing ideas he discusses in the book:  scalable and unscalable jobs, and which you should choose if starting out your career.   


Back when he was in college, Taleb received some advice from a business student:  choose a scalable, rather than a nonscalable, profession in order to become rich.    It’s a pretty simple concept:  a scalable job is one where you are paid for ideas, not hourly labor, and thus can affect many people with a small amount of work.   This contrasts with nonscalable jobs, where you are directly paid for the labor you perform.    An example of a scalable job is a corporate CEO, a derivatives trader, or an author:   in any of these professions, a small amount of work can impact a massive number of people.    On the opposite end of the spectrum, you can think of cases like a dentist or a chef:   your services are inherently delivered one-on-one, and your output is essentially dependent on the time you spend.     Some like to refer to scalable professions as “idea” professions, and nonscalable ones as “labor” professions.


You can see why scalable work has the potential to earn much more money, since it’s a matter of simple math.   If your actions affect one or a small number of people, there is fundamentally less money to go around, since whatever you earn must ultimately come from the people you serve.    If your actions affect millions of people, then there is the capacity to draw in money from many directions; as Taleb phrases it, this can “add zeroes to your output… at little or no extra effort.”   An idea person does the same amount of work no matter how many people it affects.   The CEO gives his orders once, the derivatives trader presses the same button regardless of the quantity traded, and the author writes the book once.     Taleb also glosses over the fact that some professions are kind of in-between:  for example, a chip design engineer at Intel impacts many millions of customers, though that impact is shared with about 100,000 other co-workers, creating a pretty good income potential, though unlikely to make someone super-rich unless they progress high on the even-more-scalable management ladder.  


So, was the advice correct, to choose a scalable rather than a nonscalable profession?   Well, it is true that if you go around looking at super-rich people, almost all did it through being in the scalable world.  But be careful:   if you make this kind of observation, you are making a fundamental logical fallacy, confusing “A implies B” for “B implies A”.    If someone is rich, they probably got that way through a scalable profession— but does that mean that if an arbitrary person chooses a scalable profession, they are likely to become rich?   The answer to that is a definite NO.   For every J.K Rowling or Nassim Nicholas Taleb, there are thousands of aspiring authors who barely sell a copy of their book.   (I won’t comment on how the Math Mutation book fits into this discussion.)   The scalable professions are massively profitable for the small number of people who are successful, but what’s a lot less visible are the corresponding masses of unsuccessful aspirants to these careers who failed miserably.     


Thus, Taleb points out that the advice he got was not very good, even though he happened to follow it and succeed himself.    In a nonscalable profession, the average worker makes a decent living— in some, like skilled tradesmen, engineers, or doctors, they can be pretty sure of heading towards the upper middle class if they do a good job, even though they are not likely to become rich.   Choosing a scalable profession is like entering a lottery, while nonscalable or mid-range jobs give you much better odds of earning a solid living.   And of course, there is usually the possibility of later moving into management of whatever career path you’re on, if you decide later that you want to gamble on the scalable route, while having a solid profession to fall back on if you don’t win that lottery.  


Another interesting point Taleb makes is that the nature of some professions changes over time.   If you look to the 19th century or earlier, being a singer was a nonscalable, labor-type position:  you had to be physically present before a relatively small audience, and repeat that activity every time you wanted to earn money for your music.     Thus many singers across the world could make a living producing music for eager audiences.   Then came the 20th-century revolution in recorded sound.   Once that happened, you could see superstars like Elvis, Pavarotti, or the Beatles become household names— and the majority of the money that in previous years would have been distributed among thousands of local performers ended up in their pockets.   For those who think this situation was unfair to the local singers, think about the effect of the printing press on monks, or of the invention of the alphabet on traveling storytellers.     The truth is, making a job more scalable almost always benefits huge numbers of people who consume the goods or services being produced, while creating an inconvenience for those who had previously profited off the nonscalability of their jobs.


Another interesting point Taleb makes is to look at this concept at a national level.  In the case of the United States, it seems to have been much more economically successful in the past century than the intellectual European nations of, as Taleb puts it, “museumgoers and equation solvers”.    He attributes this to the US’s much greater tolerance for creative tinkering and trial-and-error, which result in the development of new concepts and ideas.   Because the economic benefits of concepts and ideas are scalable, this has resulted in a large multiplier on the money that can be made by US companies in general.    The much-lamented loss of US manufacturing jobs is just a reflection of this shift of focus.   Nike can design a shoe, or Boeing can design an airplane, with a relatively small number of ideas, and subcontract the grunt work to foreign companies.   


I wish I could say that I pondered all these insights when initially setting out on my career, but like most of us, I just blundered my way around until I settled into something that seemed good.   It seems to have worked out pretty well for me.    But if you’re at an earlier stage of your life, Taleb’s ideas are worth strong consideration. 



And this has been your math mutation for today.



References:  

https://www.amazon.com/Black-Swan-Improbable-Robustness-Fragility/dp/081297381X



Sunday, February 20, 2022

276: Don't Believe the Math

Audio Link

Welcome to Math Mutation, the podcast where we discuss fun, interesting, or weird corners of mathematics that you would not have heard in school.   Recording from our headquarters in the suburbs of Wichita, Kansas, this is Erik Seligman, your host.  And now, on to the math.


The last episode’s discussion of randomness brought to mind the classic book “The Black Swan” by economist-philosopher Nassim Nicholas Taleb.    His books discuss the disproportionate role of unlikely extreme events, the Black Swans, in shaping our lives and our history.    Noticing online that there is a 2nd edition now, I decided to reread Taleb’s book, and got many intriguing new ideas for podcast episodes.   Today we will talk about the “Ludic Fallacy”, the incorrect use of mathematical models and games to predict real-life events.   To understand this better, let’s look at one of his key examples.


Suppose we do an experiment with two observers in a room, a professor and a gambler.   We present them the following mathematical puzzle:   I have a fair coin that I plan to flip 100 times, with everyone watching.   The first 99 flips are all heads.   The two observers are asked to estimate the probability that the next flip will turn up heads.    The professor confidently answers, “Since you said it’s a fair coin, previous flips have no influence on future flips.   So the chance is the same as always, exactly 50%.”   On the other hand, the gambler answers, with equal confidence, “If you got 99 heads, I’m almost certain that the coin is biased in some way, regardless of whether you said it’s fair.   So I’ll estimate a 99% chance that the next flip is heads.”    Naturally, in a purely mathematical sense, the professor was right, according to the information we provided.   But if this were a real-life situation, and you had to bet money on the outcome of the next flip, which answer would you go with?   The gambler probably has a point.


And this is Taleb’s key insight that forms the Ludic Fallacy:   while abstract mathematical models may provide some insight into possibilities, you cannot consider them reliable models of real life.     Issues or events that are outside your simple model may have a huge effect.   Taleb criticizes a lot of professionals who spend their lives creating complex mathematical models, and claim that they deserve large salaries or become media darlings for using them to make intricate predictions about the future, which then turn out to have little more accuracy than random chance.   Economists are some of the most notorious in this regard.    You may recall that back in the 1990s, a large hedge fund called Long Term Capital Management (or LTCM) was built around some insights from supposedly genius economists who had Nobel Prizes.   But when its “mathematically proven” strategy led to buying massive numbers of Russian bonds with borrowed money, which then defaulted, LTCM failed so badly that it needed a multi-billion dollar bailout to avoid crashing the world economy.      


There are plenty of other examples like this, and it’s not just experts who fall for this kind of fallacy.   Taleb is a bit critical of the modern software, such as features in Microsoft’s Excel spreadsheets, that make it easy for even ordinary workers to mathematically extend existing data into future extrapolations, which are very rarely accurate in the face of unpredictable real-life events.   In effect, computers allow anyone to transform themselves into an incompetent economist with high self-confidence.


I think my favorite example that Taleb cites is the story of a casino he consulted with in Las Vegas.  They had very meticulously modeled all the ways that a gambler could cheat, or that low-probability events in the games might threaten their cash flow, and had invested massive amounts of money in gambling theory, security, high-tech surveillance, and insurance to guard against these events.   So what did the four largest money-losing incidents in their casino turn out to be?    

1. The irreplaceable loss of their headline performer when he was maimed by one of this trained tigers.

2. A disgruntled worker, who had been injured on the job, attempted to blow up the casino.

3. An incompetent employee had been putting some required IRS forms in a drawer and failing to send them in, resulting in massive fines.

4. The owner’s daughter was kidnapped, and he illegally took money from the casino in order to ransom  her.

Now of course, it would have been very hard for any of these to be predicted by the models the casino was using.   That’s Taleb’s point:  no mathematical modeling could cover every conceivable low-probability event.


This is also an important reason why Taleb opposes centrally-planned economies.   One of the few Nobel-winning economists who Taleb respects is F.A.Hayek, whose 1974 Nobel speech offered a harsh critique of his fellow economists who fall back on math due to their physics envy,  and try to claim that their equations model the world just like the hard sciences.  No matter how many measurable elements they factor into their equations, the real world is much too complicated to model accurately and make exact predictions.   Modern free economies are largely successful because millions of individuals make small-scale decisions based on local information, and are free to take educated risks with occasional huge payoffs for society in general.   In his conclusion Hayek wrote, “The recognition of the insuperable limits to his knowledge ought indeed to teach the student of society a lesson of humility which should guard him against becoming an accomplice in men’s fatal striving to control society – a striving which makes him not only a tyrant over his fellows, but which may well make him the destroyer of a civilization which no brain has designed but which has grown from the free efforts of millions of individuals.”


We should mention, however, that Taleb and Hayek are not showing that mathematical models are totally useless— we just need to recognize their limitations.   They can be powerful in finding possibilities of what might happen, and opening our eyes to potential consequences of our basic assumptions.   For example, let’s look again at the coin flipping case.    Suppose instead of 99 heads, our example had shown a variety of results, including a run of 5 heads in a row somewhere in the middle.   The gambler might spot that and initially have a gut feeling that this is an indication of bias.   But the professor could then walk him through a calculation, based on the ideal fair coin, that if you flip a coin 100 times, there is over an 80% chance of seeing a run of length 5 at some point.   So using the insight from his modeling, the gambler can determine that this run is not evidence of bias, and make a more educated guess, considering that the initial promise of a fair coin has not yet been proven false.    Remember, however, that the gambler still needs to consider the possibilities of external factors that are not covered by the modeling— maybe as he is making his final bet, that disgruntled employee will return to the casino with an angry tiger.


So, in short, you can continue to use mathematical models to gain limited insight, but they are not confident sources for practical predictions.   Don’t get overconfident and fool yourself into making big bets that your model will guarantee discovery of all real-life risks.


And this has been your math mutation for today.



References:  










Saturday, January 22, 2022

275: Demanding Fair Dice

 Audio Link


Welcome to Math Mutation, the podcast where we discuss fun, interesting, or weird corners of mathematics that you would not have heard in school.   Recording from our headquarters in the suburbs of Wichita, Kansas, this is Erik Seligman, your host.  And now, on to the math.


Recently I was amused to hear about a strange machine called the “dice-o-matic”, a monstrous 7-foot tall machine that can physically roll thousands of dice per day.   It uses a camera to automatically capture the results and serve them up on the internet, for players of online board and role-playing games who need trustworthy rolls of virtual dice.   This was created by the hosts of the website gamesbyemail.com, as a result of demands by players for real dice rolls to apply to their games.    At first I thought this was rather silly— after all, nearly every programming language these days offers an option to generate a random number, so why would someone need physical dice rolls?   But as I read more about it, I could sort of understand the motivation.


To start with, let’s review how most random numbers are generated on a computer.   Typically these are not truly random numbers, but pseudo-random:   each number is derived from the previous one, but in such a way that they would effectively appear random to an external observer not aware of the algorithm used.    For a given “seed”, or starting number, they will always generate the same sequence.   The most common algorithm for such numbers is the Linear Congruential number generator.   For example, suppose you are trying to generate a random number between 0 and 7.   A simple Linear Congruential generator might take the current number, multiply it by 5, add 1, and then calculate the remainder modulo 8.   If we start with the number 0, we get the sequence 0,1,6,7,4,5,2,3, a pretty random-looking sequence of 8 numbers.    That sequence would then repeat forever— this type of generator naturally has that property.   But in real life, the numbers used for the multiplication, addition, and modulo operators would be much higher, so the cyclic nature would almost never be exposed.   By the way, the deterministic nature of these pseudo-random numbers can actually be beneficial in many applications:  for example, if testing a microprocessor design with random simulations, knowing the seed that led to discovering a malfunction enables you to easily repeat the exact same random test.


Usually you would try to get some number from a random physical source to set the seed, so you would not have the same sequence of numbers every time.  On unix systems, the /dev/random file looks for environmental noise, such as device driver delays, for storage in an “entropy pool” of random starting seeds.   There are other even better methods:  quantum physics supplies true randomness, through the timing of radioactive decays, for example.   And there are silly-sounding methods online that can be quite effective, such as the program at lavarand.org for generating random values using patterns observed in lava lamps.    Various online services provide true random numbers generated through other methods.    Of course, if you can generate these seeds with true randomness, you might argue that you should generate all your random numbers this way instead of using a pseudo-random algorithm.  But remember that current microprocessors run blazingly fast, with billions of operations per second.   Anything requiring input from the external world is going to create extra delays that are huge compared to internal operations.    So it’s much more common to use these true random sources just for the seed.


Which brings us back to the motivation for the dice-o-matic.   According to the description on their website, users were dissatisfied with the randomness of their earlier pseudo-random method.   They write:  “Some players have put more effort into statistical analysis of the rolls than they put into their doctoral dissertation.”   Personally, I’m a bit skeptical—   in any set of random numbers, you are going to see streaks of values that appear non-random.   There may be a run of 20 low numbers in a row, or an ascending 1-2-3-4-5-6 in a few places, etc.    I bet most of the complaining users had lost a game or had their D&D characters killed due to bad rolls that appeared in such a sequence, and were looking for external causes to blame.   On the other hand, if they put in enough effort, it should often be possible to demonstrate the non-randomness of pseudo-random numbers.   The website random.org points out some applications, such as scientific simulation of virus infections, where this lack of randomness has had detectable effects.  In any case, the gamesbyemail.com people took the issue seriously, and the dice-o-matic was their solution, freeing them from the dangers of pseudo-randomness.


We should also keep in mind, however, that dice actually aren’t the greatest sources of true random numbers either:   wear and tear will cause them to regularly depart from true randomness over time, as well as other possible issues depending on the manufacturing process, like the different amounts of material cut out to make the pips on each side.    Personally, I think the gamesbyemail people might have been better off installing a few number-generating lava lamps.


And this has been your math mutation for today.



References: