Thursday, January 30, 2020

Fun with numbers for January 30, 2020

Some collected numerical fun I had on twitter since the last post.

Science illustration fail: meteor tails in outer space



Why oh why do these representations always put meteor tails on objects far off the exosphere? That tail extends past 3000 km altitude, with the fireball center at around 1400 km. Little atmosphere there, fellas…

Also, that meteor (assuming it's the darker circle inside the fireball) is well over 300 km in diameter; even losing a big chunk of its mass in the atmosphere, it would reach the ground much larger than the 7 km the article says.

Source: https://www.cnet.com/g00/news/asteroid-that-smashed-earth-2-229-billion-years-ago-may-have-thawed-the-planet/



Star Trek: Picard nonsense: solar panels on/over the Golden Gate Bridge



I got this image, from the new show Star Trek: Picard, requiring unattainable suspension of disbelief — as if there was ever fluid traffic, let alone no traffic, on the GGB.

Oh, and also, solar roadways?! Really?!

I assume the Picard writers are from Hell-A, since anyone from the Bay Area would know that the GGB is fogged-in most days, so putting solar panels on it would be even stupider than on other roads, and that's saying something...

Okay, some have suggested panels are above the road. At 100% efficiency, 4 kWh/(m$^2$ * day) San Francisco insolation, and 75,000 m$^2$ deck area for the GGB, that's a 12.5 MW (average power) generator, and for that we cover one of the best views of the city?! In the 24th Century?!

Anyone who drives East on the Bay Bridge gets the transition from claustrophobic (West of Yerba Buena Island) to open space (East of YBI). Covering the GGB, especially as a pedestrian park, would be a terrible decision, more so for a puny 12.5 MW power rating.



Corona virus causes an epidemic of bad economics


What is it about supply and demand that is difficult to understand for otherwise intelligent people?


Two of many reasons why raising prices in these circumstances is good:

Some of the people who are reminded of the need for N95 masks, hand sanitizer, and disposable gloves during an emergency might realize that they shouldn't be unprepared in the future; if there's no enforced rationing (terrible thing to do, rationing) and the prices don't rise, these people may buy more than they need now, to address their previous failure to prepare. Therefore, raising the price will deal with some of this behavior, making supplies available to more people.

Expedited delivery (to the retailer) costs more than regular delivery. Some of these deliveries were made with an assortment of goods, many of which were high-margin (say bottles of 30-year-old scotch) that absorbed most of the cost of the delivery. Delivering truckloads of low-margin items like sanitizer and N95 masks alone (no expensive items to share the cost of the delivery) means the cost per unit is much higher.



California electrical consumption in nuclear explosions per year


Impressing people who have trouble with division, for emotional responses. (Not me.)

There's a video circulating on Twitter (not linking to it, for reasons that will become obvious) that describes the effect of AGW in terms of nuclear explosions per day. This is an excerpt of a much longer Thunderf00t video, which includes his customary numerical errors and bombast, but more importantly, and worse for a purported scientist, uses the imagery of nuclear destruction to create emotional responses to serious issues that demand cold analysis.

To show how ridiculous the imagery is, I calculated the equivalent of California's 2018 electricity consumption* in nuclear (fission and fusion) explosion units:


The point, which might escape some of the audience for that video, is that energy is energy and power is power; 45 Hiroshima-like nuclear explosions per day is just another way of saying 33 GW. Using such imagery is an appeal to emotion, not something a scientist should do.

Draw your own conclusions.

- - - -
* AEMO (Australian Energy Market Operator) has near real-time data, California, land of high-tech, releases information for a given year in late-June the following year.



Live long and prosper.

Wednesday, January 15, 2020

Fun with numbers for January 15, 2020

Infinites make for math fun



Link: https://twitter.com/3blue1brown/status/1215087264792887296

I did as GS suggested and figured out the solution myself. (That's the point of following recreational math accounts, after all.)

It wasn't difficult, since the behavior of a function $ f_n(x) = x^{x^{x\ldots}}$ where there are $n-1$ exponentiations, when $n \rightarrow \infty$ is likely to be divergent for any $x>1$. This was my intuition, and based on that intuition, I assumed there couldn't exist $x$ and $y$ such that $f_{\infty}(x) = 2$ and $f_{\infty}(y) = 4$. Therefore the premise is false and the reasoning fails because of that.

But I didn't prove it. I did play around with a spreadsheet to check the behavior of the function around $x=1$, since $f_n(1) =1$ for all $n$ and the functions are continuous in $x$. A simple spreadsheet shows the behaviors for $x$ between 0 and 1 and for $x$ above 1. The rows are increasing $n$, the relevant part is the diff-in-diff column, a discrete version of a second derivative w.r.t. $n$:


What these results (and several others, the point of a spreadsheet model being to play around with the numbers, or as a responsible adult would say it "do sensitivity analysis") show is that for $0 < x <  1$ the function is increasing and "concave," therefore most likely converging to a number in the [0,1] interval; for numbers above 1, the function is increasing and "convex," therefore most likely diverging to infinity.

Still not a proof, but confidence is high. (And confirmed later by the rest of the thread.)

True to my origins as a Prolog (and Lisp, occasionally) programmer, I feel compelled to write a formal definition of this function, thusly:

$\qquad f_1(x) = x;$
$\qquad f_n(x) = x^{f_{n-1}(x)} \quad\text{for $n>1$} $

As usual, recursions FTW!




Go beyond one-step thinking to understand executive pay


Scott Manley, whose space videos are among the most informative on YouTube, expressed a common complaint about executive severance pay, on the occasion of Boeing's change of the guard:


My response is the précis of why you have to pay outgoing executives significant severance: it's a signal to the incoming executives, not a reward to the outgoing executives.

(This was particularly obvious in the case of PG&E in California, which paid a lot to its executives in what most people thought scandalous and well-informed people recognized as a move to retain talent under circumstances when most top managers were considering outside options.)

The responses to SM's tweet contained a lot of misconceptions about executive-level, also called C-suite, management, and this one, which was a response to my response illustrates the three most important ones:


(As I try to be more positive, I'll be anonymizing tweets that I'm critiquing.)




Yet another Rotten Tomatoes calculation (Doctor Who)



Given these numbers, it's

5,872,182,639,638,860,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000

times more likely that critics and audience use opposite criteria than the same criteria.





Never give up; never surrender!

Monday, January 6, 2020

Fun with numbers and geekage for January 6, 2020

Money and Death on Vox, a bad infographic


I saw this on Twitter, apparently it's an infographic (or, in the parlance of those who want information graphical design to be, well, informative, a "chartoon") from a Vox article:


To begin with, these bubble diagrams, when correctly dimensioned (when they represent the data in an accurate graphical form), make comparisons difficult. Can you tell from that chart which cancer, breast or prostate, is more over-funded?

To add to that, this infographic isn't correctly dimensioned; it uses geometry to tell a lie (probably unwittingly), and that lie can be quantified with a lie factor:


The lie factor is the ratio of the perceived relative size of the geometric objects (for circles: areas) to the relative magnitude of the numbers (the money and deaths): you could fit eighteen of the COPD deaths circles inside the heart disease deaths circle, though the number of heart disease deaths are just a bit over four times those of COPD.

I would have thought that decades after Edward Tufte made this point in The Visual Representation of Quantitative Information, we'd no longer see this problem, but I was mistaken.



The infographic is used to make the point that donations are not correlated with deadliness, by showing what's effectively only a comparison of two rank orders. A better way to compare these two numbers would be to compute how much money is donated for each death or how many people die for each donated dollar, or both:


Note how easy the comparisons become and how two clear clusters appear in this format. That's the purpose of information graphical design, to make the insights in the data visible, not to decorate articles as a dash of color.



An anniversary of sorts: my Rotten Tomatoes analysis model is one year old.



On Dec 31, 2018, I watched a Nerdrotics video where Gary made the qualitative case for critics and audiences on Rotten Tomatoes using opposite criteria to evaluate certain TV shows. Out of curiosity, I decided to check that with data. That led to a few entertaining hours doing all sorts of complicated things until I settled on a very simple model, which I quickly coded into a spreadsheet, for extra convenience, and a number of fun tweets ensued, like the latest one:


The model:

Step 1: Treat all ratings as discretized into $\{0,1\}$. Denote the number of critics and audience members respectively by $N_C$ and $N_A$ and their number of likes (1s) by $L_C$ and $L_A$.

Step 2: Operationalize the hypotheses as probabilities. Under 'same criteria,' the probability of critics and audience liking is denoted $\theta_0$; under 'opposite criteria,' probability of critics liking is denoted $\theta_1$, and since the audience has opposite criteria, their probability of liking is $1-\theta_1$.

Step 3: Using the data and the operationalization, get estimates for $\theta_0$ and $\theta_1$. Notation-wise we should call them $\hat \theta_0$ and $\hat \theta_1$ but we're going to keep calling them $\theta_0$ and $\theta_1$.

Step 4: Compute the likelihood ratio of the hypotheses (how much more probable 'opposite' is than 'same'), by computing

$LR = \frac{\theta_1^{L_C} \, (1-\theta_1)^{N_C - L_C}} {\theta_0^{L_C} \, (1-\theta_0)^{N_C - L_C}} \, \frac{(1- \theta_1)^{L_A} \, \theta_1^{N_A - L_A}}{\theta_0^{L_A} \, (1-\theta_0)^{N_A - L_A}} $

(For numerical reasons this is done in log-space.) The reason I use likelihood ratios is to get rid of the large combinatorics (note their absence from that formula), which in many cases are beyond the numerical reach of software without installing special packages:




Going to the Moon... Done, moving on.


☹️ Let's just let the numbers speak for themselves:




Sainsbury's bans veggie bags


In the UK, which is in England, they keep banning things:


To be fair to Sainsbury's, they probably see this as a monetization opportunity under the cover of social responsibility (objections will be socially costly for those objecting), so probably not a bad business decision, irritating though it might be.

(I use a backpack as a shopping bag, and have been doing so for a long time, before there was any talk of bans or charging for bags. Because it's more practical to carry stuff on your back than in your hands. But I agree with Sam Bowman, this is starting to be too much anti-consumer.)


Gas for a 5 mile drive in a 25 MPG car yields about 1.8 kg of CO2. A 4 g polyethylene bag has a 24 g CO2 footprint. So, someone who walks to a local store [me] could use 74 plastic bags and still have lower footprint than someone who drives to a strip mall supermarket.



Engineer watches Rogue One, critique ensues



Typically, switches with overarching functions (say, "master switches") will have some sort of mechanical barrier to accidental movement, for example you have to lift them or press a button to unlock them before moving; sometimes they have locking affordances so that only authorized people (with the key or the code) can move them. There were none of these basic precautions here.

Apparently this switch controlling the entire facility's communications was located on the side of the taxiway for one of the landing pads, for... reasons? (Well, there's a reason: to get the drama of the pilot linking the cable and then the sacrifice of the two other fighters.)

And as for the final fight on top of the tower…


Consider that even if there was some reason the antenna was in some way dependent on actuators located on these pontoons, the controls for those actuators need not be near the actuators. It would make more sense for them to be near the central column anyway, just like the controls for a ship's engine are in the engine control room and act electrically on the actuators in the engine room (where there are backup electric controls and also mechanical access to the actuators themselves).



Big box gyms playing their usual pricing games of this season



(It's not hard to identify 24HourFitne…, ahem, the Big Box franchise from the name of the plans, but this is not a franchise-specific problem, it's a "all big box gyms and many smaller gyms that copy their policies" problem.)

And of course gyms want resolutioners to sign up for a year, as they know most of them will drop out soon:




Book buying, a personal history



So many books, so little time. But at least the wait is much shorter now.



Linkage


Unlike all the CYA statements people add to their various social media accounts to emphasize that which should be obvious — that retweeting and commenting is not an endorsement, much less a blanket endorsement of the entire sub-topology of what is being retweeted or commented on — these links are my endorsement of the content linked:

Plants can improve your work life — Phys.org

This may be a transcendent year for SpaceXArs Technica.

The World's Largest Science ExperimentPhysics Girl on YouTube (video)

Metal Mayhem - with Andrew Szydlo Royal Institution on YouTube (video)

The Hacksmith is taking a social media break. (Instagram.)

And showing that sports are much better when you replace them with engineering, here's Destin 'Smarter Every Day' Sandlin:






Live long and prosper.

Friday, January 3, 2020

New Year resolutions: being sophisticated about one's own hyperbolic discounting


To understand New Year resolutions, we need to understand time-inconsistent decisions, commitment devices, and why those devices fail.

Let's think like quants and build a simple model: to diet or not to diet, that is the question.

To answer that question, people weigh the value of having a good lazy time (eating, not exercising), call it $v_0$, versus the value of being fit, call it $v_1$, with the understanding that you only get $v_1$ after a delay $t_1$ to get into shape, no matter when you start.

Resolutioners follow a variation of the Kate Moss rule: nothing tastes as good as being fit feels, in other words, $v_1 > v_0$. The problem is the $t_1$ delay, because people discount value when it's delayed. People like instant gratification and delayed sacrifice, whereas exercise and diet are instant sacrifice and delayed gratification.

In fact, we know from many experiments that people are willing to delay gratification later, say starting at $t_L$, just not now:

a) Given a choice between $\langle v_0$ now $\rangle$ and $\langle v_1$ with a delay $t_1 \rangle$, they choose $v_0$: they eat pizza and binge-watch 'Dracula' on Netflix instead of exercising and eating high-protein, low energy (carbs + fat) foods.

b) But, given a choice between $\langle v_0$ at time $t_L \rangle$ and $\langle v_1$ at time $t_L + t_1 \rangle $ (i.e. the same choice, but with a delay of $t_L$), they choose $v_1$: if asked on Nov 15 whether they're willing to join a gym and start eating more healthy food on New Year's day, rather than spend the next year binge-watching Netflix and eating pizza, they choose the gym and healthy food.

If we use the standard exponential discounting of economics and normative decision-making (also finance, where it actually comes from), with some rate $r$, this behavior can't happen:

$ v_0 > v_1 \exp(-r \, t_1)$    (the first choice)

implies

$ v_0 \exp(-r \, t_L) > v_1 \exp(-r \, (t_L + t_1))$    (the opposite of the second choice),

since the second inequality is just the first multiplied on both sides by $\exp(-r \, t_L)$, which is the discounting equivalent to a delay of $t_L$.

There's a different type of discounting, hyperbolic discounting, that captures these effects, but by its own nature leads to temporally inconsistent-decisions, so it's a bad guide for decision-making.*

So, people don't follow the rationality of economists; anyone surprised? No?! Right. What does that have to do with New Year Day, an arbitrary date? Simple: it's all about commitment: a tool to manage one's own irrationality. It's an arbitrary date from a sidereal point of view, but not from a social point of view.** People celebrate, there's some talk of renewal, and therefore it becomes a focal point for the decision. It acts as a commitment device, especially if the resolution is made public to one's friends.

Why does it fail?

I believe three main reasons, based on occasional observation of others:

1 - Bad information leads to bad outcomes early on. People get bad information and hurt themselves in the gym or eat food that leads to significant hunger so, rationally (ironic, isn't it?), they stop exercise and diet. Note that this really is rational in the strict sense, because what they realize is that $v_1 < v_0$.

The problem is that their $v_1$ is low due to bad information about diet and exercise, which unfortunately is rampant. If they had good information they would get a high $v_1$ and stick with the program, but alas where it comes to fitness and diet the worst disinformation around tends to have the best marketing.

2 - The arbitrariness of the date and the fact that it's a psychological or social trick is known to the resolutioners themselves, so they eventually de-commit by rationalizing away any value the arbitrary date might bring. This is why gym people tell friends talking about their upcoming resolutions to start immediately (basically this is pointing out the time-inconsistency illustrated by the choices above and the obvious solution of sticking with one of the decisions, preferably the second one.)

3 - People revert to type. Sometimes people realize that their expectation of the value of being fit (the $v_1$) was based on other people's preferences and media narratives; that they really don't value health and fitness as much as they thought they did and that life is too short to give up pizza and ice cream.

So, what is to be done if one has friends who make these resolutions? Based on my totally anecdotal unquantified analysis in the three preceding points, there are two main interventions:

First, get them good information. For exercise I recommend John Little and Dr. Doug McGuff's book Body By Science as the foundation for understanding exercise and Dr. Brett Osborn's book Get Serious as an important complement for people over 35.

Diet is a minefield, so I'll just say what worked for me: intermittent fasting on a high protein-to-energy ratio eating. It worked because it didn't rely on self-control or discipline; it relied on never being hungry. I find that Mangan150 and TedNaiman on Twitter are good sources of information.
(A side note here on diet advice from athletes and personal trainers: a lot of people who are very fit passing their physique off as knowledge and some people with actual formal education but who never struggled with weight issues behave as never-smokers telling smokers who want to quit smoking to "just don't smoke!" 
 If only dealing with one's temporal inconsistencies were that simple... usually it's easy to identify these unhelpful people, because they focus on counting calories and "energy deficit." Getting an energy deficit is like not-smoking, an outcome, advice no more practical than "just don't smoke"; counting calories is terrible advice as I've shown before.)
Second, encourage them by managing expectations. I agree with the human fountain of expletives, Alan Roberts: people out of shape are trying to improve themselves, they're often ill-at-ease in a gym, and they don't need fitter people making them feel bad about themselves. Also, make sure they moderate their expectations and enjoy their newfound fitness: they're not going to compete in Ninja Warrior by July, but they'll be able to walk the trails in Castle Rock Park without getting a cardiac event.

Compliance will be rewarded.



- - -

* Hyperbolic discounting is a good description of how people make decisions in reality, so it's a good tool to analyze other people's decisions; however, if you're trying to make the best decisions yourself, hyperbolic discounting leads to time-inconsistent choices (as the ones above); as the obesity and unfitness epidemic shows, time-inconsistent choices have bad consequences, so when possible one should use exponential discounting which by definition forces time-consistent choices.

** It's actually about being close to the Winter Solstice, the shortest day of the year, and a superstitious celebration/offering to ensure the days start getting longer, but let's not quibble.