Category Archives: Math and Statistics

Stop Using 6-Digit iPhone Passcodes (Implications of Combinatorics for Personal Data Security…)

The article entitled “Stop Using 6-Digit iPhone Passcodes” clearly explains passcode security; even though the odds of guessing the right 6 digit sequence is (1/6)^10 = 1 in a million, a company called “Grayshift”  distributes software called “Graykey” which apparently can crack 6 digit passcodes in 3 days time (4 digits only take 2 hours)…

More on the St. Petersburg Paradox…

During today’s class meeting, we discussed (among other things) the famous St. Petersburg Paradox. The source for this is Daniel Bernoulli’s famous article entitled “Exposition of a New Theory on the Measurement of Risk“. As was the standard practice in academia at the time, Bernoulli’s article was originally published in Latin in 1738. It was subsequently translated into English in 1954 and published a second time that same year in Econometrica (Volume 22, No. 1): pp. 22–36. Considering that this article was published 280 years ago in an obscure (presumably peer-reviewed) academic journal, it is fairly succinct and surprisingly easy to read.

Also, the Wikipedia article about Bernoulli’s article is worth reading. It provides the mathematics for determining the price at which the apostle Paul would have been indifferent about taking the apostle Peter up on this bet. The original numerical example proposed by Bernoulli focuses attention on Paul’s gamble per se and does not explicitly consider the effect of Paul’s initial wealth on his willingness to pay. However, the quote on page 31 of the article (“… that any reasonable man would sell his chance … for twenty ducats”) implies that Bernoulli may have assumed Paul to be a millionaire, since (as shown in the Wikipedia article) the certainty-equivalent value of this bet to a millionaire who has logarithmic utility comes out to 20.88 ducats.

The Birthday Paradox: an interesting probability problem involving “statistically independent” events

During last week’s statistics tutorial, we discussed (among other things) the concept of statistical independence, and focused attention on some important implications of statistical independence for probability distributions such as the binomial and normal distributions.

Here, I’d like to call everyone’s attention to an interesting (non-finance) probability problem related to statistical independence. Specifically, consider the so-called “Birthday Paradox”. The Birthday Paradox pertains to the probability that in a set of randomly chosen people, some pair of them will have the same birthday. Counter-intuitively, in a group of 23 randomly chosen people, there is slightly more than a 50% probability that some pair of them will both have been born on the same day.

To compute the probability that two people in a group of n people have the same birthday, we disregard variations in the distribution, such as leap years, twins, seasonal or weekday variations, and assume that the 365 possible birthdays are equally likely.[1] Thus, we assume that birth dates are statistically independent events. Consequently, the probability of two randomly chosen people not sharing the same birthday is 364/365. According to the combinatorial equation, the number of unique pairs in a group of n people is n!/2!(n-2)! = n(n-1)/2. Assuming a uniform distribution (i.e., that all dates are equally probable), this means that the probability that no pair in a group of n people shares the same birthday is equal to p(n) = (364/365)^[n(n-1)/2]. The event of at least two of the n persons having the same birthday is complementary to all n birthdays being different. Therefore, its probability is p’(n) = 1 – (364/365)^[n(n-1)/2].

Given these assumptions, suppose that we are interested in determining how many randomly chosen people are needed in order for there to be a 50% probability that at least two persons share the same birthday. In other words, we are interested in finding the value of n which causes p(n) to equal 0.50. Therefore, 0.50 = (364/365)^[n(n-1)/2]; taking natural logs of both sides and rearranging, we obtain (ln 0.50)/(ln 364/365) = n(n-1)/2. Solving for n, we obtain 505.304 = n(n -1); therefore, n is approximately equal to 23.[2]

The following graph illustrates how the probability that a pair of people share the same birthday varies as the number of people in the sample increases:[1] It is worthwhile noting that real-life birthday distributions are not uniform since not all dates are equally likely. For example, in the northern hemisphere, many children are born in the summer, especially during the months of August and September. In the United States, many children are conceived around the holidays of Christmas and New Year’s Day. Also, because hospitals rarely schedule C-sections and induced labor on the weekend, more Americans are born on Mondays and Tuesdays than on weekends; where many of the people share a birth year (e.g., a class in a school), this creates a tendency toward particular dates. Both of these factors tend to increase the chance of identical birth dates, since a denser subset has more possible pairs (in the extreme case when everyone was born on three days of the week, there would obviously be many identical birthdays!).

[2]Note that since 77 students are enrolled in two sections of Finance 4335 this semester, this implies that the probability that two Fall 2019 Finance 4335 students share the same birthday is p’(77) = 1 – (364/365)^[77(76)/2] = 99.97%, although given footnote 1’s caveats, it’s likely that there may be several shared birthday pairs.

Visualizing Taylor polynomial approximations

In his video lesson entitled “Visualizing Taylor polynomial approximations“, Sal Kahn essentially replicates the tail end of today’s Finance 4335 class meeting in which we approximated y = eˣ with a Taylor polynomial centered at x=0. Sal approximates y = eˣ with a Taylor polynomial centered at x=3 instead of x=0, but the same insight obtains in both cases, which is that one can approximate functions using Taylor polynomials, and the accuracy of the approximation increases as the order of the polynomial increases (see pp. 19-25 in my Mathematics Tutorial lecture note if you wish to review what we did during the tail end of today’s class meeting).

In honor of tomorrow’s math tutorial in Finance 4335: A much more “rigorous” way to calculate 1+1 = 2

One of my Baylor faculty colleagues pointed out an entertaining and somewhat whimsical parody on the use of math in applied economics and finance which first appeared in the Nov.-Dec. 1970 issue of The Journal of Political Economy, entitled “A First Lesson in Econometrics” (at least I found it entertaining :-)). Anyway, check it out!

File Attachment: JPEMathParody.pdf (30 KB)

On the relationship between the S&P 500 and the CBOE Volatility Index (VIX)

Besides going over the course syllabus during the first day of class on Tuesday, August 27, we will also discuss a particularly important “real world” example of financial risk. Specifically, we will look at the relationship between stock market returns (as indicated by daily percentage changes in the SP500 stock market index) and stock market volatility (as indicated by daily percentage changes in the CBOE Volatility Index (VIX)): As indicated by this graph from page 21 of the lecture note for the first day of class, daily percentage changes on closing prices for VIX and the SP500 are strongly negatively correlated. In the graph above, the y-axis variable is the daily return on the SP500, whereas the x-axis variable is the daily return on the VIX. The blue points represent 7,465 daily observations on these two variables, spanning the time period from January 3, 1990 through August 16, 2019. When we fit a regression line through this scatter diagram, we obtain the following equation:

{R_{SP500}} = 0.0588 - 0.1129{R_{VIX}},

where {R_{SP500}} corresponds to the daily return on the SP500 index and {R_{VIX}} corresponds to the daily return on the VIX index. The slope of this line (-0.1129) indicates that on average, daily VIX returns during this time period were inversely related to the daily return on the SP500; i.e., when volatility as measured by VIX went down (up), then the stock market return as indicated by SP500 typically went up (down). Nearly half of the variation in the stock market return during this time period (specifically, 48.87%) can be statistically “explained” by changes in volatility, and the correlation between {R_{SP500}} and {R_{VIX}} comes out to -0.699. While a correlation of -0.699 does not imply that {R_{SP500}} and {R_{VIX}} will always move in opposite directions, it does indicate that this will be the case more often than not. Indeed, closing daily returns on {R_{SP500}} and {R_{VIX}} during this period moved inversely 78.43% of the time.

You can see how the relationship between the SP500 and VIX evolves prospectively by entering^GSPC,^VIX into your web browser’s address field.

Calculus and Probability & Statistics recommendations…

Since many of the topics covered in Finance 4335 require a basic knowledge and comfort level with algebra, differential calculus, and probability & statistics, the second class meeting during the Fall 2019 semester will include a mathematics tutorial, and the third and fourth class meetings will cover probability & statistics. I know of no better online resource for brushing up on (or learning for the first time) these topics than the Khan Academy.

So here are my suggestions for Khan Academy videos which cover these topics (unless otherwise noted, all sections included in the links which follow are recommended):

Finally, if your algebra skills are generally a bit on the rusty side, I would also recommend checking out the Khan Academy’s review of algebra.