Showing posts with label recreational math. Show all posts
Showing posts with label recreational math. Show all posts

Friday, March 6, 2020

Fun with numbers (and other geekage) for March 6, 2020

More collected tweeterage and other social media detritus.


MSNBC doesn't care about getting numbers right


And water is wet and fire burns... Okay, this one is particularly egregious. It starts on twitter, with a person who doesn't understand the difference between millions and trillions:


But then, Brian Williams and NYT Editorial Board member Mara Gay put it up in a discussion of Bloomberg's failed presidential bid, and agree with it (video here):


The problem here isn't so much that anchors and producers at MSNBC can't do this basic math, it's that they don't care enough about getting the numbers right to ask a fact-checker to check them. Note that they had the graphic made in advance, and this was a scripted segment, so they didn't just extemporize and made an error. They didn't care enough about the numbers to check them.

And, given their response, they still don't care. This is sad.



A puzzle that's going around, solved correctly


Saw this on Twitter, and a lot of snark with it:


Apparently some people have difficulty with this puzzle, drawing a line in B that's parallel to the bottom of the bottle (perhaps they think the water is frozen?). But many of the people who mock those who draw that parallel line draw a horizontal line that is too low, creating a triangle.

Here's the correct solution:


As with all math problems, even very simple ones like this, the right approach is to do the math, not to try to guess and hand-wave your way to a probably-wrong solution.



In their haste to badmouth Millennials, finance researchers misstate their results


I saw this "Millennials are bad with money" article on Yahoo Finance, got the original report (PDF), and found a glaring problem with their data. (The table notes make it clear they're saying a conjunction, 'AND,' not a 'GIVEN THAT' conditional.)


My guess is that despite the table notes and the 'AND,' what they're measuring is the proportion of people who answered the three questions correctly GIVEN THAT they self-described as having high finance literacy, I.O.W. that's 19% of the 62%, not 19% of the 9041 Millennials. That would make the population in the conjunction 1065, whereas the number of people who got the three right answers is 1447; so about 4% of Millennials are money-smart[ish] but think they aren't.

But if you're going to get snarky about other people's issues with money, maybe write your tables and table notes a bit more carefully…

About the financial literacy of Millennials, these were the three multiple-choice questions:
Suppose you had $\$100$ in a savings account, and the interest rate was 2% per year. After 5 years, how much do you think you would have in the account if you left the money to grow? Answers: a) More than $\$102$; b) Exactly $\$102$; c) Less than $\$102$; d) Do not know; e) Refuse to answer. 
Imagine that the interest rate on your savings account was 1% per year and inflation was 2% per year. After 1 year, how much would you be able to buy with the money in this account? Answers: a) More than today; b) Exactly the same; c) Less than today; d) Do not know; e) Refuse to answer. 
Please tell me whether this statement is true or false. “Buying a single company’s stock usually provides a safer return than a stock mutual fund.” Answers: a) True; b) False; c) Do not know; d) Refuse to answer.
These questions are extremely simple, which makes the low incidence of correct answers troubling.



Science illustration lie factor: 71 million


How bad can science illustrations get? Let's ask the Daily Express from the UK:


We don't need to calculate to see that that meteor is much larger than 4.1 km, but if we do calculate (I did), we realize they exaggerated the volume of that meteor by just a hair under SEVENTY-ONE MILLION-FOLD:


To put that lie factor into perspective, here's the Harvester Mothership from Independence Day: Resurgence, which has only a lie factor of 50 (linear, because that's the dimensionality of the problem here):




Fun with our brains: the Stroop interference test


From a paper on the effect of HIIT and keto on BDNF production and cognitive performance that intermittent fasting and low carb advocate (and responsible for at least 50% of my fat loss) P.D. Mangan shared on twitter, we learn that people with metabolic syndrome show improvement on their cognitive executive function when on a ketogenic diet and even more if interval training is used.

To measure cognitive executive function they use a Stroop interference test, which is a fun example of our brains' limitations, so here's an example:


The test compares the speed with which participants can state the colors of the words in the columns inside the box: on the left the color and the word are congruent (the word is the name of the color of the text for that word), on the right the color and the word are incongruent (the word is the name of a color, but not the color of the text for that word).

Other than color-blind people, almost everyone takes less time and makes fewer mistakes with the congruent than the incongruent column. That's because the brain CEO (executive function) has to stop the reading and process color in the case of incongruent. This is easy to see if one compares the test with the two extras: speed of the incongruent is about the same as that of reading the words in Extra 1 column, while the speed of stating the colors of the Extra 2 column is much faster (and less error-prone) than that of the incongruent column.

(The paper also measures BDNF, the chemical usually associated with better executive function, directly, by drawing blood and doing an ELISA test; but it's interesting to know that diet and exercise may make you a more disciplined thinker and to see that in the numbers for an actual executive function test, not just the serum levels.)




Technically, Target isn't lying, it's 4 dollars off



But I've never seen that $\$$11.99 'regular' price for this coffee, which would make it the only coffee in the entire aisle not to have a regular price of $\$$9.99. All the other sale signs say 'Save $\$$2,' for what it's worth…



Destin 'Smarter Every Day' Sandlin visits a ULA rocket factory



And, on twitter, ULA CEO Tory Bruno gets a dig into SpaceX's Texas operations:




Live long and prosper!

Thursday, February 27, 2020

Learning and understanding technical material – some thoughts

Learning technical material


From my YouTube subscriptions, the image that inspired all this:


Ah, MIT teaching, where professors get former students who they consult for/with to teach all their classes, while still getting their teaching requirement filled…

(For what it's worth, students probably get better teaching this way, given the average quality of MIT engineering professors' teaching.)

These are not the typical MIT/Stanford/Caltech post-docs or PhD students teaching the classes of their Principal Investigators or Doctoral Advisors. These are business associates of Tom Eagar, who get roped into teaching his class "as an honor." (In other words, for free.)

Note that there is such a thing in academia as "organizing a seminar series," which some professors do (for partial teaching credit), formally different from "teaching a class" (full teaching credit). Doing the former for the credit of the latter… questionable, but sadly common in certain parts of academe.

On the other hand, as most MIT faculty and students will confirm, technical learning is 0.1% lectures, 0.9% reading textbook/notes, 9% working through solved examples, 90% solving problem sets, so all this "who teaches what" is basically a non-issue. (These numbers aren't precise estimates, just an orders-of-magnitude reference used at MIT.)


That's probably the major difference between technical fields and non-technical fields, that all the learning (all the understanding, really) is in the problem-solving. Concepts, principles, and tools only matter inasmuch as they are understood to solve problems.

(Sports analogy: No matter how strong you are, no matter how many books you read and videos you watch about handstand walks, the only way to do handstand walks is to get into a handstand, then "walk" with your hands.)

Which brings us to the next section:


Understanding technical material


There are roughly five levels of understanding technical material, counting 'no knowledge or understanding at all' as a level; the other four are illustrated in the following picture:


The most basic knowledge is that the phenomenon exists, perhaps with some general idea of its application. We'll be using gravity as the example, so the lowest level of understanding is just knowing that things under gravity, well, fall.

This might seem prosaic, but in some technical fields one meets people whose knowledge of the technical material in the field is limited to knowing the words but not their meaning; sometimes these people can bluff their way into significant positions simply by using a barrage of jargon on unsuspecting victims, but generally can be discovered easily by anyone with deeper understanding of the material.

A second rough level of knowlege and understanding is a conceptual or qualitative understanding of a field; this is the type of understanding one gets from reading well-written and correct mass-market non-fiction. In other words, an amateur's level of understanding, which is fine for amateurs.

In the case of gravity this would include things like knowing that the gravity is different on different planets, that there's some relationship with the mass of the planet, and that on a given planet objects of different masses fall at the same rate (with some caveats regarding friction and fluid displacement forces).

The big divide is between this qualitative level of understanding (which in technical fields is for amateurs, though it's also the level some professionals decay to by not keeping up with the field and not keeping their learned skills sharp) and the level at which a person can operationalize the knowledge to solve problems.

Operational understanding means that we can solve problems using the material. For example, we can use the formula $d= 1/2 \, g \, t^2$ to determine that a ball bearing falling freely will drop 4.9 m in the first second. We can also compute the equivalent result for the Moon, using $g_{\mathrm{Moon}} = g/6$, so on the Moon the ball bearing would only fall 82 cm in the first second.

This level of understanding is what technical training (classes, textbooks, problem sets, etc) is for. It's possible to learn by self-study, of course, since that's a component of all learning (textbooks were the original MOOCs), but the only way to have real operational understanding is to solve problems.

There's a level of understanding beyond operational, typically reserved for people who work in research and development, or the people moving the concepts, principles, and tools of the field forward. Since that kind of research and development needs a good understanding of the foundations of (and causality within) the field, I chose to call it deep understanding, but one might also call it causal understanding. Such an understanding of gravity would come from doing research and reading and publishing research papers in Physics, rather than applying physics to solve, say, engineering problems.


An example: Sergei Krikalev, the time-traveling cosmonaut


The difference between qualitative understanding and operational understanding can be clarified with how each level processes the following tweet:


More precise data can be obtained from the linked article and that's what we'll use below.*

Qualitative understanding: Special Relativity says that when people are moving their time passes slower than that of people who are stationary; the 0.02 seconds in the tweet come from the ISS moving around the Earth very fast.

(There's a lot of issues with that explanation; for example: from the viewpoint of Krikalev the Earth was moving while he was stationary, so why is Krikalev, instead of the Earth, in the future? Viascience explains this apparent paradox here.)

Operational understanding: time dilation relative to a reference frame created by being in a moving frame with speed $v$ is given by $\gamma(v) = (1 - (v/c)^2)^{-1/2}$. The ISS moves at approximately 7700 m/s, so that dilation is $\gamma(7700) = 1.00000000032939$. When we apply this dilation to the total time spent by Krikalev at the ISS (803 days, 9 hours, and 39 minutes = 69,413,940 s) we get that an additional 0.0228642576966 seconds passed on Earth during that time.

Because we have operational understanding of time dilation, we could ask how much in the future Krikalev would have traveled at faster speeds (not on the ISS, since its orbit determines its speed). We can see that if Krikalev had moved at twice the ISS speed, he'd have been 0.0914570307864 seconds younger. At ten times the speed, 2.2864181341266 seconds younger. And at 10,000 times the speed – over 25% of the speed of light – almost 28 days younger.

As a curiosity, we can use that $\gamma(7700)$ to compute kinetic energy, $E_k(v) = (\gamma(v)-1) \, mc^2$, or more precisely, since we don't have the mass, the specific energy, $E_k(v)/m = (\gamma(v)-1) \, c^2$. At its speed of 7.7 km/s the ISS and its contents have the specific energy of ethanol (30 MJ/kg) or seven times that of an equivalent mass of TNT.

To say that one understands technical material without being able to solve problems with that same understanding is like saying one knows French without being able to speak, read, write, or understand  French speech or text. Sacré Bleu!

The application is what counts.


- - - - -
* The article also refers to the effect of gravity, noting that it's too low to make any difference (Earth gravity at the ISS average altitude of ~400 km is 89% of surface gravity; both are too small for the General Relativity effect of gravity slowing down time to be of any impact on Krikalev, or for that matter anyone on Earth).

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.

Thursday, December 26, 2019

Fun With Numbers for Boxing Day, 2019

Some collected numerical fun from twitter to end the year.


As an amuse-bouche, if you're going to mock other people for their lack of intelligence, perhaps don't make trivial arithmetic errors…


(In accordance with my recent resolution to be more positive by not posting negative content, I didn't post this to twitter and I obscured the author.)



Geometry and trigonometry to the rescue


Scott Manley likes For All Mankind, but would like the producers to get the science right a bit more often:


Trust but verify, as they said in the Soviet Union:


In case the trigonometry isn't obvious, the angle (call it $\alpha$) is important to translate the horizontal measurements (say $l_1$ measured at $h_1$) into vertical distance via the magic of tangents: $\tan(\alpha/2) = l_1/(2 h_1)$ from where we get $h_1 = l_1/(2 \tan(\alpha/2))$.


The calculation above is actually for a FoV of 60° (camera), not 120° (eyes) as said in the text, because I used a hand calculator and post-its and transcribed the result from the wrong post-it; this result is about twice the correct result; for more accuracy, here are the different altitudes calculated [using a spreadsheet, like a proper responsible adult] as a function of what the angle taken by the big ship (around 50 m linear dimension) is:


(There are many approximations and precision trade-offs in the measurement, but SM's point holds: these are clearly different orbits and no one in the production or writing team seems to have noticed.)



It's only the equivalent of one to five .50-cal bullets...


The Hacksmith made one of those "how much dangerous nonsense can we post before YouTube throttles our channel" videos:


and I checked their Physics:


They replied on twitter that the maximum speed was over 2000 RPM, at which point I calculated that the kinetic energy was close to that of five .50-cal bullets.

What could go wrong, amirite?

(I like how the producers of Nikita [with Maggie Q, not La Femme Nikita with Peta Wilson] thought that the Styer HS .50 was an appropriate rifle for a shot through a window across a city street. Spoiler alert: it isn't; it's too much gun, in the words of Mike Ermentraut. The rifle looks gigantic next to Maggie Q, which is probably why they chose that caliber instead of something in .223 or .308 either of which would be more appropriate --- he said with all his marksmanship expertise acquired on the training fields of the xbox.)



Et tu, Arthur C. Clarke?


Usually A.C. Clarke's science is spot-on (excerpt from The Songs of Distant Earth),


 but in this case, no:


(We could say that it's the captain of the Magellan that's wrong, perhaps exaggerating for effect, not A.C. Clarke, but that's a cop-out.)

Here's an example of A.C. Clarke getting much harder science right, from Rendezvouz with Rama (an old tweet, from the era when I wasn't blogging):


(I mean, what kind of nerd does numerical integration to check on the feasibility of a scifi author's solution to a minor plot point just to post it on twitter? This guy! 🤓 [Pointing both thumbs at self.])



Tidal turbines and bad interpretation of statistics


Real Engineering had an interesting video about tidal turbines:


But I had an issue with the conclusions from the impact study, because they repeat a common error: mistaking statistical significance (or lack thereof) for effect size. This point deserves a better treatment, but for now here's a simple example:


The energy density of the ocean, like other renewables, is still a bit on the low side. Compared to Canadian actinides, it's certainly lacking:




Carbon capture wonky accounting


The XPrize has a video on "Everyday Products Made Out of Thin Air":



I like the Xprize and the ideas behind it, but most of these 'carbon capture products' are complete nonsense. The CO2 footprint for the processes that make and market the product is much larger than captured CO2. In other words, these products harm the environment by increasing the total CO2 output.

(Yes, I've covered this before, on one of the rare occasions I agreed with Thunderf00t.)

If you create say 1000 tonnes of CO2 building a factory to make a product that captures 100 g of carbon per unit, you need to make over 2.7 million units just to capture the CO2 created by building the factory alone! (If the product has 100 g of carbon, that came from 44/12*100 = 367 g of CO2.) Not counting the footprint of packaging, delivery, etc.

(This is the same accounting problem that people have comparing the CO2 footprints in production of wind turbines and gas turbines. If the gas turbines already exist and the wind turbines don't, the CO2 footprint of building them has to enter the calculation [but never does…].)

Note also that the products aren't made of 100% carbon, so the correct accounting for how much CO2 they capture would necessitate accounting for the CO2 footprint of the other components and their delivery — usually to a net creation of CO2 by these 'capture' products just in this manner.

Let us not forget delivery; even if we just consider local delivery with a city van (like those that are always blocking traffic in San Francisco by being double-parked in awkward places, not that traffic moves in San Francisco, vans or no vans), the numbers aren't encouraging:

A Ford Transit cargo van is rated for 25 MPG in the city. Assuming that gasoline is 100% trimethylpentane for simplicity, burning 1 kg of gasoline yields 3.1 kg of CO2. One gallon of gasoline is 2.86 kg (3.79 l * 0.755 kg/l) so 100 miles of delivery route has a 35.5 kg CO2 footprint. If each product unit has 100 g of carbon captured (367 g of CO2), it takes 97 units in that delivery route just to make up for the delivery itself.

Here are some real carbon capture products: first some really big ones a little bit south of the Bay Area


More: https://www.flickr.com/photos/josecamoessilva/albums/72157629918640442

and one of the same species that sprang from a seed taken to the Moon (story)


More: https://www.flickr.com/photos/josecamoessilva/albums/72157687657575895

I like trees.


Friday, November 22, 2019

Fun with numbers for November 22, 2019

How lucky can asteroid miners be?



So, I was speed-rereading Orson Scott Card's First Formic War books (as one does; the actual books, not the comics, BTW), and took issue with the luck involved in noticing the first formic attack ship.

Call it the "how lucky can you get?" issue.

Basically, the miner ship El Cavador (literally "The Digger" in Castilian) on the Kuiper belt had to be incredibly lucky to see the formic ship, since it wasn't in the plane of the ecliptic, and therefore could be anywhere in the space between 30 AU (4,487,936,130 km) and 55 AU (8,227,882,905 km) distance from the Sun.

The volume of space between $r_1$ and $r_2 $ for $r_2 < r_1$ is $4/3\, \pi (r_1 - r_2)^3$, so the volume between 30 and 55 AU is 219,121,440,383,835,000,000,000,000,000 cubic kilometers.

Let's say the formic ship is as big the area of Manhattan with 1 km height, i.e. 60 km$^3$. What the hay, let's add a few other boroughs and make it 200 km$^3$. Then, it occupies a fraction $9 \times 10^{-28}$ of that space.

To put that fraction into perspective, the odds of winning each of the various lotteries in the US are around 1 in 300 million or so; the probability of the formic ship being in a specific point of the volume is slightly lower than the probability of winning three lotteries and throwing a pair of dice and getting two sixes, all together.

What if the ship was as big as the Earth, or it could be detected within a ball of the radius of the Earth? Earth volume is close to 1 trillion cubic kilometers, so the fraction is 1/219,121,440,383,835,000, or $4.56 \times 10^{-18}$; much more likely: about as likely as winning two lotteries and drawing the king of hearts from a deck of cards, simultaneously.

Let us be a little more generous with the discoverability of the formic ship. Let's say it's discoverable within a light-minute; that is, all El Cavador has to do observe a ball with 1 light-minute radius that happens to contain the formic ship. In this case, the odds are significantly better: 1 in 8,969,717. Note that one light-minute is 1/3 the distance between the Sun and Mercury, so this is a very large ball.

If we make an even more generous assumption of discoverability within one light-hour, the odds are 1 in 42. But this is a huge ball: if centered on the Sun it would go past the orbit of Jupiter, with a radius about 1 1/3 times the distance between the Sun and Jupiter. And that's still just under a 2.5% chance of detecting the ship.

Okay, it's a suspension of disbelief thing. With most space opera there's a lot of things that need to happen so that the story isn't "alien ship detected, alien weapon deployed, human population terminated, aliens occupy the planet, the end." So, the miners on El Cavador got lucky and, consequently, a series of novels exploring sociology more than science or engineering can be written.

Still, the formic wars are pretty good space opera, so one forgives these things.



Using Tribonacci numbers to measure Rstats performance on the iPad


Fibonacci numbers are defined by $F(1) = F(2)= 1$ and $F(n) = F(n-1) + F(n-2)$ for $n>2$. A variation, "Tribonacci" numbers ("tri" for three) uses $T(1) = T(2) = T(3) = 1$ and $T(n) = T(n-1) + T(n-2) + T(n-3)$ for $n>3$. These are easy enough to compute with a cycle, or for that matter, a spreadsheet:


(Yes, the sequence gets very close to an exponential. There's a literature on it and everything.)

Because of the triple recursion, these numbers are also a simple way to test the speed of a given platform. (The triple recursion forces a large number of function calls and if-then-else decisions, which strains the interpreter; obviously an optimizing compiler might transcode the recursion into a for-loop.)

For example, to test the R front end on the iPad nano-reviewed in a previous FwN, we can use this code:


Since it runs remotely on a server, it wasn't quite as fast as on my programming rig, but at least it wasn't too bad.

Note that there's a combinatorial explosion of function calls, for example, these are the function calls for $T(7)$:


There's probably a smart mathematical formula for the total number of function calls in the full recursive formulation; being an engineer, I decided to let the computer do the counting for me, with this modified code:


And the results of this code (prettified on a spreadsheet, but computed by RStudio):


For $T(30)= 20,603,361$ there are 30,905,041 function calls. This program is a good test of function call execution speed.


Charlie's Angels and Rotten Tomatoes



Since the model is parameterized, all I need to compute one of these is to enter the audience and critic numbers and percentages. Interesting how the critics and the audience are in agreement in the 2019 remake, though the movie hasn't fared too well in the theaters. (I'll watch it when it comes to Netflix, Amazon Prime, or Apple TV+, so I can't comment on the movie itself; I liked the 2000 and 2003 movies, as comedies that they were.)



Late entry: more fun with Tesla



15-40 miles of range, using TSLA's 300 Wh/mile is 4.5 kWh to 12 kWh. Say 12 hours of sunlight, so we're talking 375 to 1000 W of solar panels. For typical solar panels mounted at appropriate angles (150 W/m2), that's 2.5 to 6.7 square meters of solar panels…

Yeah, right!



No numbers: some Twitterage from last week


Smog over San Francisco, like it's 1970s Hell-A


Misrepresenting nuclear with scary images


Snarky, who, me?



Alien-human war space opera – a comprehensive theory