Showing posts with label Tesla. Show all posts
Showing posts with label Tesla. Show all posts

Saturday, March 21, 2020

Fun with numbers for March 21, 2020

Recycling some tweets on the third day of California shelter-in-place. Weather is nice:




I really don't like these "flatten the curve" diagrams posing as science



Maybe it’s just me, but this diagram strikes me as a number of unsupported unquantified statements presented as if it’s some sort of quantitative model based on real data
  1. Axes have labels but no scales… so all we can measure is the relative magnitudes. Is that high peak at (D,A) 1%, 10%, 25%, or 90% of the population? Does it happen in a week, a month, or a year?
  2. A/B = 415/110 so this undefined intervention lowers the peak by 73.5%. How many patients is that? Do these measures really slow down infection rates this much? Assuming that there’s no change to recovery speed, that’s a 4-fold reduction from an unidentified intervention.
  3. E/D = 475/280 so this undefined intervention delays the peak by 70%. So if D is a month, this delays the peak a further three weeks, not long enough for a vaccine; if D is a year, that’s another 8 months, presumably enough. 
  4. B is still greater than C, so what happens when the slowed-down process crosses over the health system capacity? Rationing/triage or does this mean bodies littering the streets? That depends on that (B-C)/C = (110-83)/83 or 33% over capacity, but what happens needs absolute numbers, not relative; since there are no numbers, there’s no real meaning.

All the calculations above are just to show that if we’re to take a chart seriously we need to have real numbers and real details, and the above figure is just a qualitative “let’s hope this works to convince people to wash hands and stay away from others” masquerading as a technical models.

BY ALL MEANS, WASH YOUR HANDS, DON’T TOUCH YOUR FACE, AND STAY AWAY FROM OTHERS, because that makes sense. I've been doing it for as far as I can remember.



The information we're getting is preliminary and we're treating it as dogma


From a study of Italian testing:


The internal consistency of this test is 75% (25% of the time the test doesn’t agree with itself in retesting); this doesn’t mean that the test is 75% accurate, because that’s measured relative to the underlying condition. This is an upper bound on the accuracy of the test, since we know that at least 25% of the time it's inaccurate for sure. (Sample size appears small, but for Medicine this is almost their version of "big data.")


A more general point about COVID19 testing


It's easy to show that missing covariates leads to panic-inducing overestimates. The following numbers are not COVID19 data, just an illustration


Sometimes I despair of what people try to do with small amounts of data, and then the sarcasm comes out:
How can anyone deny this calamity?! In less than two months the entire population of the Earth will test positive. 
In 100 days, over 8 trillion people will test positive. That's 5 times the total number of humans who've ever lived!!!! 



TSLA twitter, always good for a laugh



No matter what the stock does or at what price it's trading, Ross always says "buy." One wonders how he charges 2-and-20 to his clients to give advice of this quality.



Richard "Hamster" Hammond drives a Tesla Model X



And gets very excited at adding one mile every few seconds at a Tesla Supercharger. (We can see in the touchscreen that the Supercharger is delivering 65 kW and Tesla claims 310 Wh/mi,* so that would average out at about 16 seconds per mile of range.) Not to be a spoilsport, but a gas pump adds about 26 miles of range per second (3 l/s in a 35 MPG car).

Then there's a small blur fail that reveals Hammond isn't really driving under the speed limit:


That's okay, Mr. Hammond, no one else is either.

- - - - -
* If you believe that number, you're exactly the kind of investor I'm targeting with a new product structured mostly with 2020 pandemic cat bonds; act now, supplies are limited.**

** CYA statement: this is a facetious offer, expressing derision for Tesla's number, not a proffer of a tradable security structured from out-of-the-money cat bonds.



Some videos to watch while the economy tanks around us



Grant Sanderson of 3blue1brown gave a talk at Berkeley about having people engage with math. The gist is that people want relevance and/or a story. That's good advice, but I think 3B1B's problem is that his audience is self-selected. In other words, that's how you engage an audience that's predisposed to look for and watch math videos. Still, good points.



Experimentboy is back, with thermal cameras. Very fun stuff.



PhysicsGirl suggests fun experiments to keep us from losing our minds while we wait to be moved to FEMA camps or be turned into Soylent Green.


YouTube affords the überdorks amongst us the opportunity to watch talks waaaaay above our expertise, something that in real life would be embarrassing, not to mention logistically difficult. So here are some links to:

Caltech. MIT-West, as some people who went to a technical school in Massachusetts call it.

Stanford Institute for Theoretical Physics. Fair warning: Susskind eats cookies when he talks, so there's spraying in some videos (all Susskind videos, really).

Institute for Advanced Studies at Princeton.

Nasa Jet Propulsion Laboratory.

Art talks at Le Louvre, Musée D'Orsay, the British Museum, the Smithsonian Institution, and the Museum of Fine Arts in Boston, a small town in a hard-to-spell state




Live long and prosper.

Friday, October 4, 2019

Fun with numbers for October 4, 2019

It's flu season, let's talk product diffusion


One of the classic marketing models people learn in innovation classes is basically a SIR(1) model without the R part: the Bass model of product diffusion.

The idea is that some fraction $a$ of the consumers are "innovators" who adopt a product without social pressure, while another fraction $b$ are "imitators" who adopt a product when they see others with it. The fraction $x$ of the market that has adopted the product at a given time is given by the following differential equation

$\dot x = (a  + b x)(1-x)$, 

and the behavior looks like a traditional product life-cycle curve (an S-shaped curve):




The process for a viral infection is similar: some people get the virus from the environment (those would be the $a$ fraction), some get it from contact with other people (those would be the $b$); the infection process has a third element, recovery, which we ignored here.



Growth confusion and punditry, part 1


Pundits throwing around growth numbers seem to be unaware that there are significant differences even with very small growth numbers.




Growth confusion and punditry, part 2


A pundit: "it's important to get the economics high-growth first, so that the slower growth starts from a higher number." (Paraphrased.)

Me: Gah! Multiplication is transitive. The order doesn't matter, what matters is that the high-growth period be the longer period.

Consider two periods, with $t_1$ and $t_2$, with associated growth rates $r_1$ and $r_2$. Starting from some value $x_0$, the result of period 1 before period 2 is:

$\left( x_0 \, e^{r_1 t_1} \right) \, e^{r_2 t_2}$,

and the result of period 2 before period 1 is

$\left( x_0 \, e^{r_2 t_2} \right) \, e^{r_1 t_1}$,

in other words, the same result.

These pundits get paid to go on television and say these things and to write them in Op-Eds. And influential people take them seriously. The innumeracy is staggering.



Having some fun with Tesla data


Downloaded some historical data from Yahoo Finance (yes, I have other better sources, but this one is public and can be shared) and played around with smoothing. Here's a nice view of the TSLA closing price for the last year using the same triangular smoothing I did for my bodyweight (in other words, a second-order moving average of (5,5)):



Throughout the first half of 2019 Tesla boosters on Twitter were fully convinced that this would be the year that heralded the end of the internal combustion engine car. In reality, this seems to be the year in which Tesla's financial shenanigans are likely to bring its valuation to a more appropriate level.

CYA statement: I have no personal position on Tesla and will not initiate one in the next 72 hours. This is not intended as financial advice and represents my personal views (of making fun of Tesla boosters) not those of my employer or our clients.

Also:

(Yes, it's sarcastic.Very, very sarcastic.)



Yet another infrastructure photo



Monday, September 9, 2019

Fun with numbers for Sep 9, 2019


So, this might become a thing, blogging augmented tweets.

Rotten Tomatoes is at it again



Dave Chappelle apparently has a Netflix special that has critics and audience at loggerheads. Being a little more quantitative, we can say that the critics are 862,712 times more likely to be using criteria opposite to those of the audience than the same criteria. The logic is in this post.

There are two differences between that blog post and this calculation that are worth mentioning:

1. Computing $c(12352,124)$ without loading special numerical packages that can handle large numbers is beyond the capabilities of most mathematical software, so we use a trick: as we're only interested in a likelihood ratio, and those combinations appear in the numerator and denominator, we know that in the end they'll cancel out, so we ignore them altogether.

2. Small probabilities raised to a large exponent quickly get to the precision limits of the floating point representations; to deal with that we make our calculations in log-space. So instead of computing $0.01^{124}$, which would be well below the 1E-99 ($10^{-99}$) limit for most numerical software, and be treated as zero, we compute $124 \times \log(0.01)$, do all the operations in this log space and at the end we exponentiate the result.

Used Apple Numbers (in lieu of RStudio) for this one, was surprised to learn that LOG is $\log_{10}(\cdot)$ despite Numbers also having a LOG10 function. Oh, well, no problem as long as one is careful:




Tesla bull tries to praise superchargers, arithmetic and hilarity ensue


Sooooo I tried the 250kW charger for the first time and I think I'm in loooooove 🥰 -- Went from 19% to 60% I kid you not in just 5 mins. Thanks @elonmusk @Tesla 🙏

Your battery capacity is 51 kWh?!
5 minutes = 300 s
250 kW * 300 s = 75 MJ
75 MJ = (60%-19%) * Capacity, or
Capacity = 183 MJ = 51 kWh
I thought TSLA batteries started at 75 kWh?! 🤔 Possible explanations:

1. Tesla bull is exaggerating; if it took 10 minutes, or the starting point was close to 40%, that would point to a 100 kWh battery.

2. Tesla software is lying to the car owner, making the numbers look rosier than they actually are.

3. Battery has lost capacity, which happens to batteries because of the underlying principles (two main chemical reactions, one exoelectric, one endoelectric; but secondary, parasitical reactions exist that lower the battery capacity over time). Even for a 75 kWh battery that would be a very big loss (1/3), unless his charging cycles are deep and irregular (that kills batteries faster).



Counting calories is like Enron accounting


Just thinking logically, here, if you were bailing water out of a boat, would you keep adding water in?

Okay, so if you're trying to lose weight by using body fat for energy, why would you eat carbs, whose sole nutrition value is as energy? Why eat when not hungry? *

(Most of the arguments I have about calories are with people who for some reason want others to eat carbs. Counting calories biases you towards choosing carbs over fat, since fat is more energy-dense.)

But more to the point, the whole foundation of calorie counting is Enron-like accounting, where some things are counted (more or less), some things are estimated, and many other things are sort-of, kind-of assumed away in some "basic metabolic energy needs" or other ways of saying "let's assume everyone has the same basic efficiency in chemical energy extraction and mechanical power production."


The lack of accounting for energy lost as heat, which anyone out of shape who's ever jogged with an athletic friend can tell you varies a lot with the person, is the most obvious Enron-like accounting.  Higher body effort for the same mechanical output is reflected in heat loss, and differences in that heat loss can be (as calculated in that figure) in the 100-200 kCal/hour range.

That's the same difference as the mechanical energy difference between jogging and walking.  One hour at the low end of that difference (remember, this is just heat, the mechanical energy is the same for both people) every other day is equivalent to 2 kg of fat extra per year if we believe in the basic model of calories-in calories-out.

Now,  how much difference can there be in unmeasured chemical energy output? Depends on the person and the diet, but note that on a 2500 kCal/day diet a systemic difference of 2%, that is 50 kCal/day, is equivalent to 2 kg of fat extra per year if we believe in the basic model of calories-in calories-out.

Can different people with the same general diet show a 2% difference? Yep. For example, a paper called "Energy content of stools in normal healthy controls and patients with cystic fibrosis," by Murphy, Wootton, Bond, and Jackson in Archives of Disease in Childhood (1991) [thanks PubMed], includes data about the controls' intake and stool. Here are the computations for the first 5 healthy controls:



Yeah, just like that, if CICO were true, these people, on the exact same diet, would show a 3 kg per year weight gain difference. 30 kg per decade.

So, whenever people start talking about calories, be aware that they might be looking for a way to say "you're overweight because of your moral failings; if only you were as virtuous as I am!"

- - - - -
* 1. Carbs are delicious, even addictive. Just be aware of the trade-off: they slow down body fat loss and make you hungrier faster. Because controlling appetite is key to fat loss, that second part is much more damaging than the first. Any "diet" that requires constant attention and self-control is going to fail for normal people with normal lives in normal society: just look around you.

2. There's a situation when I'll eat even though I'm not hungry: if I know I'll become hungry later when no high-protein food will be available and the hunger will be inconvenient or require iron will to avoid eating institutional carbs-and-fat food. Usually this situation can be avoided by taking high-protein foods like Biltong (no, it's not jerky; yes, it's worth the price) or hard-boiled eggs with you, but there are situations when that's socially unacceptable.



Nerding out with science fiction




The book is Dream of the Iron Dragon by Robert Kroese. Highly recommended science fiction.

At $c/3$, each kg of mass in the ship has kinetic energy of 607 TJ, the equivalent of a large tactical nuclear weapon (145 kiloton TNT), or about nine times the Hiroshima explosion. The relativistic increase in mass in small (around 6%, of course), but that velocity-squared, that's the big deal. (At these speeds we have to use the relativistic formula for KE, the one with $mc^2$ in the numerator.)

A table of temporal dilation (it's a highly non-linear transformation):


At 99.95% of the speed of the light, one hour of ship time would be 31 hours, 37 minutes, and 48 seconds in the resting frame. At that speed, each kilogram of mass in the ship would have 2.75 exajoule of kinetic energy or, in big boom terms, about 13 times the energy of the largest hydrogen bomb explosion (the Tsar Bomba at 210 PJ or 50 MtTNT).

Another excerpt of the same book, non-numeric, but very dear to anyone who's ever worked in a large bureaucratic organization:


#NerdWhoMe

Sunday, September 1, 2019

Fun with numbers for Sep 1, 2019

Apple declines to burn 17 billion, Tesla boosters disappointed.


Ross Gerber, a Tesla booster who provides endless entertainment on TSLA twitter, had an interesting idea (the same idea he's had for the last 4-5 years), that Apple should burn 17 billion dollars instead of giving them to people who hold AAPL stock.


The first Tesla car that was targeted at the general public (as opposed to tech billionaires and centi-millionnaires who wanted to be thought as forward-thinking) was the Model S, introduced in 2012. So we'll use 2012 as the beginning of Tesla as a real car company.

As I write this it's Sunday, September 1st, 2019 and the last TSLA close was on Friday, August 31st at 225.61. We'll compare this number with the stock closing price for the closest date for all years 2012-2018 and compute the annualized growth. Then we use that growth to forecast the evolution of an hypothetical Apple stake of 17 billion.


Using a 5-year growth rate for that tweet was basically the textbook default, but looking at that table, the last two columns really tell an interesting story… didn't Ross suggest Apple buy Tesla in late 2017 and in late 2018? Because the numbers in that table say something about financial acumen.


Calories, calories, calories... What a bunch of nonsense!

This marvel of mechanical engineering is the Siemens STG5-9000HL gas turbine. Running in single-cycle mode at nominal power it takes in almost 59,000 kg of LNG per hour or around 900 MW (Calories in: 755 million kCal/hour) and delivers around 400 MW of spinning power to a generator, for about 360 MWe (Calories out: 310 million kCal/hour) of electrical power.

Wait, what? Isn’t it Calories-In-Calories-Out? Is the turbine getting fatter or something?

No. Running in single-cycle mode the system loses around 60% of its power to unrecovered heat.

This is the real problem with CICO and 'Just Get a Caloric Deficit' recommendations: because no one measures the energy lost in radiated, conducted, and convected heat, or the energy content of urine, feces, and ‘outgassing,’ and because those show large variation across people (and across different situations for the same person, including changes in diet), the whole thing is nothing more than pretend science: like astrology made with computers, adding the trappings of science to a flawed foundation yields nothing valuable.

Well, of no real value, but monetizable; and there’s also the moral posturing afforded by telling others that being fat is proof of their lack of willpower or moral failings. (And, of course, since it doesn’t work, leads to continuing supply of clients.)

Thermodynamics is not a magical incantation. But some people use as if it were.


(I'd be willing to bet that 90% of the people who invoke 'thermodynamics' as a magical incantation to ward off the evil spirits of low-carb diets couldn't have made the junior-high Physics computations in that first paragraph.)


More infrastructure


"How can you take photos of those ugly things when there are all these flowers and rocks?"

Me: because when you understand what these things are, you marvel at the detail, at the functionality, and at the fact that they work to begin with. Also, I photograph nature too.


Wednesday, August 28, 2019

Fun with numbers - August 28, 2019

Air conditioning FTW!


Part of what I do is training people, under the fancy name of "executive education," and to match the fancy name we tend to get nice AV equipment, color handouts, markers that work, fancy chairs, and climate-controlled rooms.

The least remarkable of those is also probably the most important. The air conditioning, not the markers.

For a large-ish event with around 60 people in a comfortably large room, with about 50% of heat losses to the exterior, the temperature would increase by almost 15 °C in a 90-minute session:


Okay, there's a lot of approximations in that calculation, but even 10 °C increase means that either it was too cold at the beginning or too warm at the end. So hurrah for air conditioning.


Seriously, how can people fall for this?


Today The Tesla Promotion Network Electrek, posted a news item about batteries. Apparently "[a] startup that spun out of Cambridge University claims a battery breakthrough that can charge an electric car in just six minutes."

That phrasing is unclear: how much charge? Even the slowest chargers in my neighborhood (6 kW) will give any electric car battery some charge in 6 minutes (0.6 kWh). Most people will read that to mean they could give a full charge to, say, a Tesla Model 3 in six minutes.

Say the Tesla has a 80 kWh battery; charging it in 6 minutes requires an average power of 800 kW; even using 480 V, that would mean the current would be almost 1700 A. That would be a really interesting current to see in a lithium-ion battery, or as the fire department calls it, "the initiating event of the fire."

For comparison, a typical gas pump can pump 3 l/s of gasoline, which at 34 MJ/l means that the gas pump can transfer energy at a rate of over 100 MW or around 125 times the rate of that fictional battery.



Not math: some infrastructure




Wednesday, May 29, 2019

Numbers as props vs numbers as information




Once you learn to tell the difference, you'll know whom to trust.

A very long time ago, in 2018, Elon Musk announced that Tesla would be ramping up production to 6000 vehicles per week. An anchor for a business program played the video, then addressed their co-host with:
"That's like four full parking structures a week. Wow!"
Co-host makes assenting noises.
That statement is true for parking structures that have 1500 spots, which most in San Francisco (where the show is produced) don't. Typical numbers here are closer to 500 than 1500. But that's not the important part.

The important part is that the number was used as a prop, not information.

More precisely, the anchor first bought into the idea that 6000 is a large number for a car company's weekly production, then looked for a way to make that number look big to the show's audience; parking structures are big buildings and are related to cars, so that was a good way to create the perception of "bigness." [1]

In other words, the process of using a number as a prop is:

1. Make a decision based on something other than the number
2. Look for a number to support that decision
3. Choose context to present the number that molds perception in favor of the decision.

The alternative to using numbers as props is using them as information.

The metric '6000 per week' is just data. It becomes information when it answers a question. A few of these questions that come to mind, considering that this is a business program focussing on technology for a mostly finance and finance-adjacent audience would be:

a. How does this production level compare to that of the competitors that Musk repeatedly states he's going to put out of business?
b. How does this production level compare to that of Toyota when it was running the factory that is now Tesla's?
c. How does this production level compare to the demand for electric vehicles in general, possibly by geographical area and brand of vehicle?

Note that these questions extract information from the number 6000, by comparing it to other numbers that are of business interest. This illustrates a very important principle of data-processing for decision-making:

What is informative about data depends on what decision is to be made.

Choosing question a for illustration, and using Wikipedia data for 2016, because it's publicly available so anyone can check this computation without having to pay financial information service fees, here are the production rates for the top 15 car companies by number of vehicles produced:



Those numbers put Tesla's production in context; they suggest that Tesla, relative to the competitors that Musk repeatedly taunts as "dinosaurs" and "on their way out," is a niche player and not a serious business threat. [2]

Note the process for using numbers as information:

1. Determine what decisions are to be informed by the number
2. Find the context that is relevant for that decision
3. Compare number with the numbers from that context

Using numbers as information is important primarily for decision-makers. Realizing when others are using numbers as props, not information, is important for everyone. Especially regarding whether you can trust the numbers -- and the other person.

Just because someone uses numbers as props, that doesn't necessarily mean their intent is to deceive you. Our society, particularly our news and edutainment, are full of prop-use of numbers for non-nefarious reasons: ignorance, desire to connect abstract numbers to concrete objects, laziness.

But there are people whose intent is to deceive, and often you can tell who they are by calling them on their use of numbers as props. [3]

When faced with the above table, many Tesla fans on twitter, some of whom manage third-party money, either resorted to ad hominem ("how big is your short position?" is a common one, even used by Musk) or changing the subject ("these cars will save the planet").

This is how you identify someone who's not making a good-faith mistake of using numbers as props, but rather someone who deliberately avoids using the appropriate context for the numbers to use them as props: they never address the relevant comparison.

Because most people don't process numbers as they hear or read them, but are still influenced by the perceived authority of the number, this behavior (deliberately using numbers as props to deceive, that is) is usually effective as a persuasion tool. And people who deliberately use numbers as props know about that effectiveness and that's why they do it. Which brings us to an important insight about people we get from their use of numbers:

People who deliberately use numbers as props are not to be trusted.



-- -- -- --  FOOTNOTES -- -- -- --

[1] More likely the choice was made by a writer or a producer, not the anchor; but the anchor is the face of the show, so we'll keep referring to them.

[2] Or, if we want to apply strategic thinking, Tesla should build itself by market expansion starting from its niche, instead of a frontal assault on the much larger companies (its current strategy)

[3] For what it's worth, I don't think the anchor, or the TV channel, were trying to deceive their audience. They were just caught in Musk's Reality Distortion Field, which in 2018 was much stronger than Steve Jobs's ever was.


-- -- -- -- ADDENDUM -- -- -- --

Later that year, numbers-as-props sophistry continued unimpeded by any sense of shame on the part of Tesla fans: