Feb 112015
 

freightTrainWrite like a freight train.

Try to remove “that,” “had” or any of its derivatives. “You’ll find that you can often live without them.” vs. “You’ll find you can often live without them.”

Actually, remove every word you can. You can live without them.

When possible, place adjectives and adverbs before the words they modify. Be on a continuing mission to boldly split infinitives which have never been split before.

A colorful word is better than a colored word. When possible, replace adjectives with meaningful nouns and adverbs with meaningful verbs. “It’s a big mess.” vs. “It’s a debacle.” “Fournette ran hard through the line.” vs. “Fournette muscled through the line.”

Deliberately use adverbs. Long, descriptive, meaningful chains of modifiers can subtly and delightfully overwhelm the reader’s working memory. If you want your readers to process with abundant attention, dutifully remove adverbs. If you want your readers to be gleefully hypnotized, happily unpack your favorite adjectives and adverbs. Continue reading »

Feb 032015
 

As you probably know, there’s a very useful Excel formula called VLOOKUP() which allows you to reference lookup tables and return the appropriate value.

On an Excel user support forum, I had previously linked to some formulas that provided “fuzzy” vlookups. In the event a perfect vlookup match couldn’t be found, the custom formula FUZZYVLOOKUP() returns the closest match available. The post has since 404′d, so I was asked to rehost them.

Click here to download a sample workbook.

If you open up developer mode, you’ll see a code module containing two custom functions: LIKENESS() and FUZZYVLOOKUP(). The former compares two text strings and returns a numerical measure of how similar they are (1 is perfectly similar, 0 is completely dissimilar). The latter iterates the likeness formula across a lookup table and returns the appropriate column of the best match. Both of these functions are demo’d below:

fl-fig1

Please note that FUZZYVLOOKUP() uses four arguments:

  1. The lookup value.
  2. The lookup table.
  3. The column from the lookup table you’d like to return.
  4. The minimum acceptable likeness. (In this example, I used 0.2).
Feb 022015
 

Now that football’s over, I’m about to enter my annual “What should I do with my weekends?” phase. Before that, I’d like to revisit my predictions under the cold light of morning (but not the blue light of mourning). If you’re not interested in the Super Bowl, here’s a video of a Superb Owl. More math posts are on the way.

On January 27th I wrote a six point list entitled “Reasons the Pats will win.” Let’s see how I did in hindsight. Continue reading »

Jan 302015
 

This post is part of the “Matrix Multiplication in Excel” series. It’s composed of a math introduction, a silly interlude and an interactive tutorial (you are here). By the end of the series, you’ll learn how to perform Markov Chain calculations, which are used in some damage calculations.

Now that we know some of the basics, I’m going to introduce a toy problem where one would use matrix multiplication, step through how to calculate it in Excel and then give an example used forensic economics.

Click here to download Matrix Multiplication.xlsx.

Scenario 1: Ping Pong Problem

Suppose two ping pong players (labelled left and right) are tied near the end of a game. In order to win, one of them has to have a two point lead. Suppose that, on any given volley, the left player has a 55% chance of winning.

The game can be thought of as having five states:

  1. (2,0) – The left player wins.
  2. (1,0) – The left player is winning by one.
  3. (0,0) – The game is tied.
  4. (0,1) – The right player is winning by one.
  5. (0,2) – The right player wins.

Graphically, the transitions between these states can be seen as follows.

ppFig1

The left player increases his score with the probability p(LW), in this case 55%. How do we calculate the probability that the left player wins? Continue reading »

Jan 232015
 

This post is part of the “Matrix Multiplication in Excel” series. It’s composed of a math introduction, a silly interlude (you are here) and an interactive tutorial. By the end of the series, you’ll learn how to perform Markov Chain calculations, which are used in some damage calculations.

‪‎Trigger Warnings‬: Authorial Self-Insertion, In Medias Res, Movie References, Fake Trigger Warnings

neo_morpheus

Just a few days ago, I had been lying on my back, surrounded by doctors, atrophied and struggling to gasp for breath. This man wanted billions of humans to experience the same process. A note of discord rang through my heart as I tried to imagine the whole of humanity simultaneously squinting as they adjusted to their new eyes.

Morpheus misinterpreted my discomfort and didn’t miss a beat. Continue reading »

Jan 162015
 

This post is part of the “Matrix Multiplication in Excel” series. It’s composed of a math introduction (you are here), a silly interlude and an interactive tutorial. By the end of the series, you’ll learn how to perform Markov Chain calculations, which are used in some damage calculations.

A matrix (plural matrices) is a rectangular array of numbers, symbols or expressions arranged in m rows and n columns. For matrix A below, the element at row i and column j is indexed as a_{i,j}.

mmFig1 Continue reading »

Jan 072015
 

I recently answered the following question on Quora:

What are the strengths of Coasian Bargaining?

Coasian Bargaining says that agents can negotiate away the effects of externalities if transaction costs are sufficiently low. Ideally, this will lead to an efficient outcome.

wellwellwellSuppose you want to drill an oil well that will make you $100. Suppose it’ll make the lives of 20 neighbors $1 worse. How is this problem approached in different countries?

  • In Non-Coasian Anacapistan, you drill the well and create $100 of personal utility and $80 of total utility. The twenty neighbors are $1 worse off, but they all read Ayn Rand, flex their forearms, and carry on with their grim resolve to build the kind of buildings they want to build.
  • In Coastopia, the neighbors say you can drill the well iff you pay them $2 each. You drill the well and gain $60 of value. The neighbors gain $1 of value each.
  • In Coasistan, the neighbors demand $6 each. The well doesn’t get drilled. No one wins except for the lawyers who negotiated the failed deal.
  • In StatusQuoVille, the neighbors all vote on whether or not the well should be drilled. Depending on who shows up to the polls, it’s either drilled or not. The winner takes all, and everyone hates each other.

Coastopia is clearly an unrealistic fantasy, but it has some enviable features and real-world take-aways. In my experience, those who spend time thinking about Coasian Bargaining are more likely to be impartial when assessing real-world externalitites. While some are quick to say that fracking should be outlawed because it disturbs the locals, those from the Coasian school of thought will consider other possibilities. Maybe oil companies should pay money to the locals. Maybe locals should pay oil companies to not drill. Maybe oil companies should pay locals to move. Coasian bargainers are more likely to consider creative solutions rather than simply banning productive economic activity of which they disapprove. This leads to more economically efficient outcomes. In my toy example, the drilling clearly should happen. Any outcome that doesn’t result in a new well misses out on $80 of total utility.

All that said, I wouldn’t want to live in Coastopia. Incentives work both ways, and you wouldn’t want to live in a world where the prevalence of Coasian Bargaining encourages potential externalizers to seek out situations to threaten. “That’s an awfully nice stream you have there. It’d be a shame if someone were to dump runoff into it. Perhaps you should pay me to threaten someone from the next town instead.” On net, the average man’s distaste of naked Coasian Bargaining may be a good thing.

In DanielMorganTopia, all questions like these are solved through Pigovian Taxes, an approach which doesn’t require perfect bargaining and has decent efficiency if the government is reasonably competent. But I don’t rule the world. Not yet.

Dec 172014
 

I was asked to review another forensic accountant’s workpapers as a part of a consulting engagement. When I received the file, it totaled over 18 MB. By making a single change, I was able to lower its size to 53 KB. The next time you come across an oddly bloated Excel file, follow these steps.

fileComparison

  1. On each sheet, press Ctrl + End. This moves the cursor to the last cell Excel stores. In this case, one of sheets took me to column BO, row 1,048,576. Although only the first 39 rows contained meaningful data, the remaining rows stored formatting information, which Excel dutifully saved.
  2. Select all rows you don’t need (in this case, I pressed Ctrl + G and entered “40:1048576″) and delete the information (Ctrl + -). Make sure you select and delete the entire row / column as appropriate (Shift + Spacebar and Ctrl + Spacebar, respectively).
  3. Enjoy your faster load times and lower storage costs.
Sep 252014
 

Johnny Voltz, an old college friend of mine who was once voted most-likely to have a superhero named after him, send in a great question about the recent, tragic Ebola outbreak in West Africa:

I know very little about math, and even less about medicine. From the data I have, it would suggest that the Ebola virus is growing at a logarithmic pace. Would it be fair to predict continued growth at this rate considering lack of medical care in Africa? Would 100,000 be an exaggerated number for March 2015? What are your thoughts?

He then linked to a chart which showed the logarithm of Ebola Deaths and an Excel fit.

10635959_10103770303239115_8695286090319037235_n

This is a classic time series problem, and I’d like to use it to illustrate the process, merits and accuracy of fitting time trends through regressions. As a final step, we’ll produce an estimate of cumulative Ebola deaths in March 2015. But first, let’s talk about regressions in general. Continue reading »

Aug 202014
 
sb

Image credit: http://yourpsychotherapist.deviantart.com/

There’s an old fairy tale from Probabilia. Like all good Probabilian fairy tales, it has fair coins, maidens and -y godmothers to save us from monsters.

Sleeping Beauty volunteered for an experiment. On Sunday night she went to bed. On Monday, a fair coin was flipped. If the coin comes up heads, then sleeping Beauty is woken on Tuesday. If the coin comes up tails, then Sleeping Beauty is woken on both Tuesday and Wednesday. Whenever she is woken up, she is given a drug that prevents her from forming any memories, so whether it’s Tuesday or Wednesday, it’ll feel like it’s the first time she’s woken up. On Thursday, the experiment ends, and she continues on her way.

Whenever she is awoken, Sleeping Beauty is asked “what is the probability the coin came up heads?”

If you were Sleeping Beauty, how would you answer?

That’s confusing, so click this picture to embiggen a diagram.

SB

There’s one school of thought, “the halfer position,” which claims that she should always answer 50%. That was her belief before the experiment, and she was given no new information on Tuesday or Wednesday morning. (See this paper by David Lewis, Trigger Warning: PDF). To guess anything other than 50% feels like getting something for nothing.

But in a very real way, the halfer position is very wrong. Two times out of three, the right answer will be tails. If Sleeping Beauty were to make bets about the outcome of the coin toss, she would lose money if she believed the halfer position, and if probability theory doesn’t help us win money, then what’s the point? Continue reading »