Showing posts with label Honnold Mudd Library. Show all posts
Showing posts with label Honnold Mudd Library. Show all posts

Saturday, November 8, 2014

My Morning at Honnold/Mudd Library: 2014-11-08 (Game Shows, Bravias Lattice, Prime Numbers)

My Morning at Honnold/Mudd Library

Honnold/Mudd Library - Claremont, CA


What I love about visiting the mathematics and science sections in a university library is that there is a feast of information.  Every time, there is something new to learn.   Here are some notes from today’s visit:

Game Shows and Winning

Source:  John Haigh.  “Taking Chances: Winning with Probability”  2nd Edition Oxford Press: 2003

Haigh introduces two central ideas of probability:  exclusive events and independence.  Is it impossible for two events to occur simultaneously?  Does one event have any effect on another?  Let’s explore some popular concepts of probability found in game shows.

“Find the Lady” – also known as the “Monty Hall Problem”.  You have three boxes, two are worthless and one has the prize.  After the contestant selects the box, the host shows one of the boxes that are worthless.  Statistically, if the contestant switches their initial choice, the contestant doubles the chance of winning.  That is, since the contestant initially is incorrect 2/3 of the time, and the host shows one of the incorrect boxes; the contestant who switches has a 2/3 chance of switching from a losing box to the winning box.

“Showcase Showdown” (The Price is Right) – spinning last may not be the most advantageous place to be.  It depends on the scores of the first two spinners, and the chance of getting the best score. 

“Who Wants to be a Millionaire” – In the classic structure of the game, before the time clock and the shuffle format, contestants were offered three lifelines:  Ask the Audience, 50:50, and Phone a Friend.  Haigh suggests using the lifelines in this order: 50:50, Ask the Audience, and Phone a Friend.  The risk between higher level questions increase as the game goes on.  

“Blockbusters”

A two-person team (white) goes against an individual player (blue in the UK, red in the US).  For each question the team has 2/3 chance of getting the question correctly, but will have to answer a minimum of five question correctly, while the individual can win the game as a few as four correct answers.

My calculation:  assuming that there are no blocks, the probability that the team wins with five consecutive answers is (2/3)^5 = .13169 versus (1/3)^4 = .01235. 

Ideal Crystals and Bravais Lattices

Source:  M.G. Cottam and D.R. Tilley  “Introduction to Surface and Superlattice Excitations”  Cambridge University Press:  Cambridge.  1989.

Ideal crystals are described as a basis of atoms (or ions) located on each point of a lattice, which is defined as a regular periodic array in space.  In an ideal crystal, all the lattice points are equivalent.

Each lattice is defined by the non-coplanar vector a1, a2, and a3.  That is, a1, a2, and a3 do not lie on one specific plane.  The space lattice is formed through a collection of vectors, symbolized as R, as:

R = n1*a1 + n2*a2 + n3*a3, where n1, n2, and n3 are integers. 

Since the ideal crystal has translational symmetry, the transition f(r+R)=f(r) is satisfied for all points in space, which such a point is represented by r. 

The reciprocal lattice vector of R, symbolized by Q, takes the form:

Q = v1*b1 + v2*b2 + v3*b3, where v1, v2, and v3 are integers, and

b1 = ((2*π*a2) x a3) / dot(a1, a2 x a3)
b2 = ((2*π*a3) x a1) / dot(a1, a2 x a3)
b3 = ((2*π*a1) x a2) / dot(a1, a2 x a3)

Where x represents the vector cross product and dot(v,u) represents the dot product.
Two-Dimensional Lattices

Let a1 and a2 be two translation vectors and the set R be defined as:

R = n1*a1 + n2*a2, where n1 and n2 are integers

The ends points of R from what is called the Bravais lattice.  There are five Bravais lattices which take the shape of one of these five forms:

1.    Square, |a1| = |a2|, θ = 90°
2.    Primitive Rectangle (general rectangle), |a1| ≠ |a2|, θ = 90°
3.    Centered Rectangle (rhombic), |a1| ≠ |a2|, θ = 90ׄ°
4.    Hexagonal, |a1| = |a2|, θ = 60° or 120°
5.    Oblique, all other cases

Cottam and Tilley illustrates the concept of bulk and surface excitation by using how Rayleigh’s descriptions of waves in a semi-infinite isotropic elastic medium.  In searching for plane-wave solution, in which the wave propagates parallel to the surface with vector q with velocity v and frequency w:

f’’(z) – (q^2 – w^2/v^2)*f(z) = 0

If q^2 < w^2/v^2, we have a bulk wave where

f(z) = B1*e^(i*√(w^2/v^2-q^2)*z) + B2*e^(-i*√(w^2/v^2-q^2)*z) where B1 and B2 are constants.

If q^2 > w^2/v^2, we have a decaying surface wave where

f(z) = B3*e^(√(q^2-w^2/v^2)*z)


Prime Number Goodies

Source:  Richard Carndall and Carl Pomeance.  “Prime Numbers: A Computational Perspective.  Second Edition” Springer.  2005

Twin Primes:  

Two primes that differ by 2.  Examples include 3 and 5, 29 and 31, and 311 and 313.  Is there an upper bound on twin primes, or is there an infinite set of pairs? 

V. Brun showed the upper bound for the number of twin prime sets under the integer x is:

‘π(x) = O(x*(ln ln x/ln x)^2) -> x*(ln x)^-2

Brun also showed that the sum of the reciprocal of the twin primes is finite.  That sum is denoted as the Brun constant which is:

B = (1/3 + 1/5) + (1/5 + 1/7) + (1/11 + 1/13) + …

The Brun constant is at least 1.71077 (using twin primes from 1 to 1,000,000).  As imagined, this series converges slowly.

Formulas to Produce Primes:

Euler used the polynomial x^2 + x + 41 to produce primes, which worked for all integers 0 to 39.  After x = 39, the polynomial continues produce primes at a remarkable probability. 

Mersenne Primes:

Mersenne primes, in the form of 2^q – 1 where q is a prime greater than 2.  It has been proven that if 2^q – 1 is prime, then so is q.  This form does not always produce primes (see q = 11 or q = 23).  In fact, the distribution of Mersenne primes gets scarce quickly as q increases.

Perfect numbers, integers in which the sum of its divisors except itself equals that integer (example: 6 = 1 + 2 + 3), can be characterized by Euler and Euclid:

An even number is perfect if and only if n = 2^(q-1)*(2^q-1) where 2^q-1 is prime.

Quadratic Residues:

The integer a is said to be a quadratic residue of coprime integer m if the congruence

x^2 ≡ a mod m

can be solved such as x is an integer and gcd(a, m) = 1. 

For example, 19 is a quadratic residue mod 5 since 19 mod 5 = 4 = 2^2 and gcd(19,5) = 1.

The next two basic definitions play a role in solving polynomials and equations involving prime numbers.

Legendre Symbol defined as (a/p) [normally written vertically]:

Let p be an odd prime.  Then:

(a/p) = legendresymbol(a,p) =
0 if a ≡ 0 mod p
1 if a is a quadratic residue of p
-1 if a is not a quadratic residue of p

Example:  p = 19.  The Legendre symbols of (4/19), (5/19), and (19/19) are 1, -1, and 0, respectively. (corrected on 2014-11-10 - with apologizes)

Jacobi Symbol defined as (a/m) [normally written vertically]:

Let m be any odd integer and a be any integer.  Then:

(a/m) = jacobisymbol(a, m) =  product( legendresymbol( a, prime factor of m )).

Example:  m = 27 = 3 * 9, a = 55

Jacobisymbol(55, 27) =

Legendresymbol(55, 3) * legendresymbol(55, 9) = 1 * 1 = 1

Is it shown that jacobisymbol(a, m) = 0 if and only if gcd(a, m) > 1.


Enjoy!  

Eddie

Blog Entry # 402

This blog is property of Edward Shore.  2014


Sunday, September 30, 2012

Honnold-Mudd Library and The Odds of Winning the World Series

Greetings everyone!

Honnold Mudd Library

Yesterday I visited the Honnold Mudd Library, which is part of the libraries of the Claremont Colleges. The library has open for most of the day and has room for the public. Amazingly, this is the first collegiate library that I have ever been to where the mathematics section is located on the first floor. The bookshelves for this section are on rollers - which allowed one aisle to be open at a time.

I spent the better part of four hours there, reading about game theory, probability, and the Zeta function.

Here is the link to the Claremont College Libraries' web page.

The Odds of Winning the World Series

Every October in the United States (and Canada should the Toronto Blue Jays be one of the contenders), Major League Baseball (a.k.a. MLB) has an annual tournament of 10 teams to determine the World Series winner. The 10 teams consists of six division winners and four "wild-card" teams. MLB started the current format this year.

Out of the 10 teams, 2 final teams, the National League Champion and American League Champion meet for the World Series. The series is a best of seven series, where the first team to win four games wins the Series and is the Championship team for that year.

We can calculate the odds of a team winning that series by using the Binomial distribution, with the following formula:

nCr × p^r × (1-p)^(n-r)

Where:
n = number of trials
r = number of successes
p = probability of success of one trail
1 - p = q = probability of failure of one trail. Note that p + q = 1.
nCr = combination of n objects taken r objects at a time = n! ÷ ((n - r)! r!)

Even Odds

Let's say two teams are evenly matched. That is, p = 0.50, and q = 1 - p = 0.50. What will be the odds whether one team wins the World Series in four games? Five games? Six games? Seven games?

Win the Series in Four Games

If a team wins a game in four games, it is said that the victorious team swept the losing team. To achieve the probability of a sweep, find the combination of winning all four games and multiply by the odds. That is:

4C4 × 0.50^4 × 0.50^0 = 1 × 0.50^4 = 0.0625

Winning the Series in Five Games

In order to win the series in five games, you must win three games and lose one in the first four games. Obviously, you have to win the fifth game. In calculating probability for this situation, it really does not matter which order you win the first three in four, but that it happens. The "lack of order" requirement allows us to use combinations.

Multiply the result of winning 3 out of 4 games by the odds of winning the fifth game to get the total probability. The total probability of winning the World Series in five games is:

P(winning 3 games out of 4) × P(winning the fifth game)
(4C3 × 0.50^3 × 0.50^1) × (0.50)
= 0.25 × 0.50
= 0.125

Winning the Series in Six Games

In order to win the series in six games, you must win three games and lose two in the first five games. Using a similar approach to the 5 game situation, the total probability of winning the World Series in six games is:

P(winning 3 games out of 5) × P(winning the sixth game)
(5C3 × 0.50^3 × 0.50^2) × 0.50
= 0.3125 × 0.50
= 0.15625

Winning the Series in Seven Games

Similarly, in order to win the series in seven games, you and your opponent win three games apiece in the first six games. Using a similar approach to the 6. game situation, the total probability of winning the World Series in seven games is:

P(winning 3 games out of 6) × P(winning the seventh game)
(6C3 × 0.50^3 × 0.50^3) × 0.50
= 0.3125 × 0.50
= 0.15625

Not surprisingly, the odds of your team winning the World Series in an evenly matched series is 50%. (0.0625 + 0.125 + 0.15625 + 0.15625 = 0.50.)

Underdogs and Favorites

What if the teams are not evenly matched? Instead, we have an underdog, whose odds of winning each game is less than 50%; and a favorite, whose odds of winning each game is greater than 50%. We can use the analysis presented above to calculate the odds of winning the World Series.

For example, say the National League Champion San Francisco Giants, the underdog, plays against the American League Champion New York Yankees. Expert odds makers estimate that the Yankees win about 55% of their games against the Giants. What are the odds of each team winning the World Series?

From the Giants' Point of View, the odds of winning a game is 45%, or p = 0.45. (q = 0.55) Remember each team can win the World Series in one of four ways: sweep (in four games), in 5 games, in 6 games, and in 7 games.

Sweep:
P(win 4 games of 4) = 4C4 × 0.45^4 × 0.55^0 ≈ 0.0410063

Win in 5 Games:
P(win 3 games of 4) × P(winning the 5th game)
= (4C3 × 0.45^3 × 0.55^1) × 0.45 ≈ 0.0902138

Win in 6 Games:
P(win 3 of 5 games) × P(winning the 6th game)
= (5C3 × 0.45^3 × 0.55^2) × 0.45 ≈ 0.1240439

Win in 7 Games:
P(win 3 of 6 games) × P(winning the 7th game)
= (6C3 × 0.45^3 × 0.55^3) × 0.45 ≈ 0.1364483

Total Chance of the Giants winning the World Series (with p = 0.45):
0.0410063 + 0.0902138 + 0.1240439 + 0.1364483 = 0.3917122 (approximately 39.17%)

Going to the Yankees, the favorites in this example. Now the probabilities are reversed, with p = 0.55 (q = 0.45).

Sweep:
P(win 4 games of 4) = 4C4 × 0.55^4 × 0.45^0 ≈ 0.0915063

Win in 5 Games:
P(win 3 games of 4) × P(winning the 5th game)
= (4C3 × 0.55^3 × 0.45^1) × 0.55 ≈ 0.1647113

Win in 6 Games:
P(win 3 of 5 games) × P(winning the 6th game)
= (5C3 × 0.55^3 × 0.45^2) × 0.55 ≈ 0.1853002

Win in 7 Games:
P(win 3 of 6 games) × P(winning the 7th game)
= (6C3 × 0.55^3 × 0.45^3) × 0.55 ≈ 0.1667701

Total Chance of the Yankees winning the World Series, with p = 0.55,
0.0915063 + 0.1647113 + 0.1853002 + 0.1667701 = 0.6082878 (approximately 60.83%)

Note: 0.3917122 + 0.6082878 = 1. As a check, see if the total probabilities add to 1. Being a favorite can significantly increase your chance of winning the World Series!

A RPN Program (HP 15C)

Here is a RPN (Reverse Polish Notation) keystroke program to calculate

nCr × p^r × (1-p)^(n-r)

I used a HP 15C. On the 15C (and 32S, 35S), recall arithmetic can be used to save space. Adjust accordingly.


(Key: Key Code)
LBL A: 42 21 11
RCL 3: 45 3
RCL 2: 45 2
y^x: 14
1: 1
RCL- 3: 45 30 3
RCL 1: 45 1
RCL- 2: 45 30 2
y^x: 14
×: 20
RCL 1: 45 1
RCL 2: 45 2
Cy,x: 43 40
×: 20
RTN: 43 32
(15 steps)


Input:
Preload the following memory registers: R1 = n, R2 = r, and R3 = p

Output:
Probability on the x stack level (display), with the previous contents of the x stack level on the y, z, and t stack levels.


Source of the formula: Packel, Edward. "The Mathematics of Games and Gambling". MAA 1981. New York

Before I go for today, I leave you with several fun facts:

Let z be any complex number, where z = a + bi, with a the real component and b the imaginary part

The Riemann Zeta Function has no zeros (roots) when a is greater than 1.

The Gamma Function has no zeros when a is greater than 0.

Source: Patterson, S.J. "An Introduction to the Theory of the Riemann Zeta Function" Cambridge University Press 1988.


This blog is property of Edward Shore, 2012.

Python (TI-84 Evo) and HP 32S: Shannon-Wiener Diversity Index

Python (TI-84 Evo) and HP 32S: Shannon-Wiener Diversity Index Introduction The Shannon-Wiener Diversity Index measures a leve...