An Extension of a Probability Puzzle

Consider a unit square and uniformly pick two points on its perimeter. What is the probability that the line that connects these two points has length less than 1?

I first came across this problem in the accompanying youtube video, and decided to investigate it with a bit more depth. If you ever wondered about the sum of squares of uniform distributions, or if you are an avid shape-rotator, this one’s for you.

Alternative Definitions of the Derivative

I claim that the three following definitions of the derivative are equivalent: $$ f’(x) = \begin{cases} \displaystyle \lim_{c \to x} \frac{f(c) - f(x)}{c-x} & \text{(A)} \\[10pt] \displaystyle \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} & \text{(B)} \\[10pt] \displaystyle \lim_{t \to 1} \frac{f(tx) - f(x)}{tx - x} & \text{(C)} \end{cases} $$ Most people who have taken a calculus course will be familiar with form B above, however there are contexts in which forms A and C are more convenient to use. Real analysis courses, for instance, often will prefer form A. In this post, I shall prove the equivalence claim.

On Substitution Ciphers

One of the first “real” programs I ever wrote would encrypt a message using a substitution cipher and (more impressively) decrypt an encoded message without knowing the encryption key. Perhaps the first thing I had to come up with was an algorithm to take a cipher key that was used to encode a message, and transform it so that it could then be used do decode the ciphertext back into plaintext. I was aware of ROT-13’s property that if applied once to the plaintext, and again to the output ciphertext, it would yield the original plaintext. That is, ROT-13 is its own inverse. However, this is not the case for all possible keys, so I needed to find a more general algorithm.