Math

Bonus Normal Distribution Post!

Bonus Normal Distribution Post!

From the Wikipedia article on Cauchy distributions:

When U and V are two independent normally distributed random variables with expected value 0 and variance 1, then the ratio U / V has the standard Cauchy distribution.

Since I’m limbered up by making linear combinations of Cauchy distributions, I feel like this one is easy.

Edit 2025-07-20: Dr Drang mentioned this post! He did an analytical solution and found my curve fit wanting! That’s cool, I violated the assumptions, so it should be wrong!

Stable Distributions

Stable Distributions

Wikipedia says, about stable distributions:

a distribution is said to be stable if a linear combination of two independent random variables with this distribution has the same distribution, up to location and scale parameters.

Marksman Probability Puzzle

Marksman Probability Puzzle

Found a puzzle on the notorious Futility Closet web site.

Here’s Futility Closet’s puzzle. Mr or Ms Closet decided to call the puzzle “Gun Control”. I don’t know if they chose the title to skirt controversy or something.

Problem Statement

Marksman A hits a certain small target 75 percent of the time. Marksman B hits it 25 percent of the time. The two of them aim at that target and fire simultaneously. One bullet hits it. What’s the probability that it came from A?

Count number of heaps coding problem

Count number of heaps coding problem

Another programming interview question from the Daily Coding Problem email list. I received it as #1608.

Daily Coding Problem: Problem #1608 [Medium]

This problem was asked by Microsoft.

Write a program to determine how many distinct ways there are to create a max heap from a list of N given integers.

For example, if N = 3, and our integers are [1, 2, 3], there are two ways, shown below.

  3      3
 / \    / \
1   2  2   1

Repo for my code.