Posts tagged with planning

A perlmonk asked for a “custom random number generator”. This is a non-maths person’s word for a probability distribution.


It was a slightly unusual case, but not hard. After I’d finished several easy steps, though, the final formula looked like it had been scrivened by a wizard:


Of course, I’m not a wizard; I’m not even an acolyte. The steps I took just involved (1) a certain viewpoint on probability distributions, and (2) puzzles that an 11-year-old could solve. 

This is how formulas in textbooks get to look so daunting.

 —skippable interlude— 

I guess I figured this out years ago, when I first saw the Black-Scholes-Merton formula in business school.


The BSM is just a continuous-time limit of “Did the stock go up or down in the last 5 minutes?” But the BSM is dressed up with such frightening language that it seems much more inscrutable than “A tree generated from two alternatives which are repeated”.

\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} + rS\frac{\partial V}{\partial S} - rV = 0

For example in the Wikipedia article on BSM the subheads include: Greeks (), elliptic PDE’s, derivation, interpretation, criticism, extensions of the model, notation, assumptions, references. It’s 24 pagedowns long. From this pretence of sophistication follows:

I’ve seen it in biology, chemistry, and physics textbooks as well. A convoluted formula encodes the results of a simple model. Because of scientism the students commit it to memory as well as more derived results. Hopefully they come to find that it was not so complicated only a professors could understand it.

But I don’t think that’s common knowledge, so formulæ retain an impenetrable mysticism and the rituals of uncomprehending repetition continue.

 —back to the main idea— 

It needn’t be so enigmatic. I can demonstrate that by showing how the ugly beast above looks if you break it into steps. It’s simpler as several lines of code than as one formula.

Client Request

Anonymous Monk wanted a probability distribution like this:


with the median at x and equal probability masses between [x/y,x] and [x, x•y]


I’m going to take a Gaussian and map the endpoints to what the client wants.


The result will tend to the centre a “normal” amount of the time and yet will be squashed onto the domain the client wants.

Match up the Endpoints

I know that exp maps (−∞,0] onto (0,1]

To follow that, I need a transformation that will match (0,1) to (x/y, x). So 1 ⟼ x and 0 ⟼ x/y.

0 ⟼ x and 1 ⟼ xy

as 6 lines of Code

my $random = ...; #Gaussians, however you fry them up
if ($random <= 0) { 
$random = exp($random); #map (−∞,0) → (0,1)
$random =     ; #map (0,1) → (x, x•y)

else { #map (0, +∞) → (0,1)
$random = 1 − exp(−$random);  #map (0, +∞) → (0,1) ... which is the same problem as above except backwards
$random =     ; #map (0,1) → (x/y, x)


  1. use paper first, write code second
  2. draw a picture
  3. if necessary, break it into a simpler picture
  4. compose the answers to the parts
  5. code the pieces in separate lines

The equation at the top does decompose into the sequence of steps I just outlined. But even though it looks simple as a sequence of steps, the one-line formula is scary.

Years ago, manufacturers could build a sequence of prototypes and use these to discover and rectify any problems. But now competitive pressures [have reduced] the time to bring a vehicle to market…. Automotive manufacturers aim to … design … a new vehicle and the manufacturing facility … in an entirely virtual world.

This speeds the introduction of the new product, but it does mean that designers … aim to anticipate … problems before a physical build of the vehicle is completed or a new production facility is built. Experience [from] the past is useful, but new vehicles have new features…. For these reasons, we need models that predict how humans of different types will behave in vehicle and workplace environments.

I love Julian James Faraway's reasoning process at the beginning of his paper on ergonomic simulation. He starts out by addressing the most important question: why should I care? rather than assuming “STEM is useful” or “Mathematics is good by fiat”.

Instead of saying that some bit of maths is "important" because “important” is an adjective and he felt like putting an adjective there, Dr. Faraway explains why mathematics is relevant to this specific problem which people already care about.

  • Because of the production constraints, the automobile manufacturers need to figure this out on computer before building and testing something in reality.
  • Because we don’t have infinite money to build a lot of test space programmes, we have to calculate exactly the trajectories and rocket pulse timing beforehand.
  • Because the Aswan dam is so hugely expensive, we need to mathematically plan how it should work before making it.

And so on. It suggests that the practical application of mathematics is in areas where prototyping is prohibitively expensive.

Or where prediction is necessary. For example, actuaries predict large-scale (i.e., central limit theorem applies) insurance losses before they happen.

Building a railway through “the roof of the world” (Tibet).

  • A clever low-low-tech solution to the problem of ground’s freezing & thawing messing up your hard structure. (Also a clever low-tech, but not low-low-tech solution.)
  • Specific numbers that matter a lot: how many days do you need to stop at what altitudes on your way up to work at 5000 metres (15,000 feet) above sea level?

National Geographic:-Megastructures-Extreme Railway (por Simon Peter)

One of my old jobs was at a private equity firm. One rule of thumb I learned there may be useful to would-be entrepreneurs. To myself, I call it the rule of "Just add water." Like one of those bath toys that grows to a larger size of the exact same thing when you add water, the perfect investment is a business that grows to a larger size of the exact same thing when you just add money.

This is not meant to deter anyone who’s already on a different path or to be some master theory of finance. I just think it’s an easy-to-remember model that a will-be entrepreneur can use to check ideas against when planning a new “growth business”. (i.e., not the vineyard you’re going to operate in retirement; not the splogs you run passively on the side to augment your regular income; not the community-enhancing business you’re doing less for money than to make the world a more interesting place. Just businesses that are hoping to get acquired by a large corp or else attract investment to grow to a medium-to-large size)

So. What does an ideal investment look like to an investor? It looks like “I put in money and get out more money later”. It doesn’t involve

  • taking chances,
  • having to run the business (unless they are actually great in that business area),
  • and especially not giving someone a chance because everyone deserves a chance.

Here is my fantasy model of the perfect business to invest in. Let’s say the Six Flags corporation has built its first rollercoaster park in Ohio and it is doing very well. It cost $130 million to build and it nets $10 million in profits per year. If you do some annuity maths (from the geometric series) you’ll see that that’s a decent business. Let’s ignore all complications and say that that profit stream is worth a net $7.6mm today. (WolframAlpha’s number if I use 6% interest rate and just assume the theme park depreciates to zero after 30 years of constant profits) Which is a big number for one person but small when it’s divided 100 ways.

Nevertheless the value that’s been proved by the Six Flags team is not just a $7,600,000 net addition of wealth but $7,600,000 in that region of Ohio. In other words that number can be multiplied. All you have to do is: just add money.

Well me and my people, we have connections to people who already made it and now want their money to work for them. “Having the money work for them” means paying us a management fee to look for businesses like this Six Flags and then bet on sure things. If we have a sure thing like this to bet on, then we can subscribe as much funds as we need to.

So the initial cost of a Six Flags was $130mm and let’s say there are 19 other locations with the exact same stats (number of people with a certain income in a certain radius, competition, etc) where the management team has convinced us they can duplicate the exact same business with the exact same cash flows. It would take them >15 years to save up enough money to build a new Six Flags in just one of those locations, but here is an opportunity for capital to come in and speed up the business’ growth. Now we multiply $7.6mm of NPV by twenty = $152mm of present value.

Then we have to figure out how to actually structure this deal, that’s another complicated question. When do investors get their money and how? How much is the investors’ capital worth as a percentage of the growth? Does the management team get stretched too thin or can they hire and train enough people. (This is called “operations” = actually doing things like running a business, not just elocution and planning as the financiers do).

In reality there are going to be more factors like repair costs and risks, risk of lawsuits, interest rates, other opportunities, appropriate size of the investment, and much more. Anything that makes this business not just an annuity complicates things. That’s why I say this is a fantasy model.

But I think the basic story behind the duplication of Six Flagses is basically what investors love to see. Isn’t it what you would love to see if you were an investor; had made your fortune running paper mills; and just wanted to sit back, relax, and live off your massive dosh now?
Zhang Yin
Here is something that already works perfectly, all the kinks have been straightened out, it’s just a formula that’s been proven to work. All these Six Flags management people need is money, which I happen to have, and nothing else from me (I don’t know how to run a Six Flags), and then the investors can multiply out the Six Flags formula to all of our benefit.


The present zeitgeist notwithstanding, the driving force of capitalism is not solving social problems. Asking those questions can be a good way to look for ideas, but it is not sufficient for extracting dinero from customers/clients, which is the actual driving force. Social problem + investment = solution is a naïve way some beginning entrepreneurs think, and it essentially puts all of the risk and all of the work onto the investor—which is not a value proposition for them. (I.e., you are relying on your investment partner being a fool—so then how will you really feel after you’ve bilked him/her/them and living on ill-gotten wealth?)

So that’s the foolish way to think “Just add money”: I am going to make the next Groupon, all I need is some programmers and a million dollars and then we can get started doing this thing! Why is this going to work? Because people are stupid. They’ll buy anything. What, do the work without getting paid? You crazy! What I just described is not “Just add money”, it’s “Just add everything”. Some people deceive themselves, though, thinking they could be rich if only somebody gave them the million-dollar OK to pursue their “idea”. (Well, they would be rich, but it wouldn’t be from the idea succeeding. And business costs could eat a million in short order anyway.) One of your “jobs” as “the boss”—what you’re contributing to the situation, and what you’re getting paid for—is a plan that, with good execution and getting people on board with you and relationships and everything else, is going to add to the world a “machine” that causes people to hand over money, either in large amounts or many times, over decades-plus time period. That is, you’re creating new revenue streams that your investors (if you’re taking investors) are buying into. (There are some markets where it takes a lot of money to start up or where a huge advertising budget can make/break the business. I don’t pretend to understand those, though, so I can’t offer any useful advice there.)

I’ll grant there are other ways to win investors over—like, they are half in it for personal interest in a subject area, or they half just want to change the world like you do, or Instagram just sold for a $billion and they are gunning from the hip for the next big score, etc. To me, as an entrepreneur, you can hope for that kind of luck, but you can’t control luck. You do have it within your control to solve all of the problems down to the point where more money = multiplication and the multiplication will bring in enough returns for everyone to share and both parties walk away satisfied. If you offer people an obviously good deal you will get bites and you can use that goal to sieve your ideas at the outset.

Chen […] thinks that if your language has clear grammatical future tense marking […], then you and your fellow native speakers have a dramatically increased likelihood of exhibiting high rates of obesity, smoking, drinking, debt, and poor pension provision.

And conversely, if your language uses present-tense forms to express future time reference […], you and your fellow speakers are strikingly more likely to have good financial planning for retirement and sensible health habits.

It is as if grammatical marking of the difference between the present and the future insulates you from seeing that the two are coterminous so you should plan ahead. Using present-tense forms for future time reference, on the other hand, encourages you to see that the future is just more of the present, and thus encourages you to put money in a 401(k).

Geoff Pullum