1 of 24

1

What does a math and data analysis instructor do for fun?  As an example - he cheats at Wordle.

​

​

​

​

​

​

Jerry Tuttle, FCAS, CPCU, MA, MA, MS

Retired insurance company actuary

Adjunct instructor, SNHU

​

2 of 24

2

Outline

​

  1. What number comes next?
  2. State life expectancy & voting – playing with data
  3. Baseball trivia – database querying
  4. Facial attractiveness and the Golden Ratio Φ
  5. Taylor Swift lyrics – text analysis
  6. Cheating at Wordle
  7. Yelling at the TV for illogical statements

​

3 of 24

3

1a. What number comes next?

You’ve seen these on the Internet, right?

What would you answer?

​

​

4 of 24

4

1b. What number comes next?

The right side is being multiplied by 4, 5, 6, and 7, so maybe the next numbers are multiplied by 8, then 9.

Is 45 THE answer?

​

​

x

times

y

10

4

40

9

5

45

8

6

48

7

7

49

6

8

48

5

​

9

45

5 of 24

5

1c. What number comes next?

But any number can be the next number. Why not -14?

​

​

​

​

​

​

​

​

​

Sometimes I can be a nuisance …

​

​

6 of 24

6

2a. State life expectancy & voting

I found some life expectancy data by state, and I was curious whether it correlated with each state’s political climate. I allocated LE by quartile, and I used R to plot.

​

​

​

7 of 24

7

2b. State life expectancy & voting

I found 2024 presidential popular vote by state, I grouped the states into 4 bins by vote margin, and I used R to plot.

​

​

​

8 of 24

8

2c. State life expectancy & voting

The correlation coefficient r is -0.50. States with higher Rep. vote margins tend to have lower life expectancy.

​

​

​

9 of 24

9

3a. Baseball trivia – database querying

Suppose someone asks, “Which NY Yankee had the all-time third highest number of doubles in a season?

​

  • Load Lahman (Relational Database)
  • Load Batting, People (tables)
  • In Batting, filter rows for Yankees, sort descending by number of doubles
  • Merge with People to get

first & last name

​

​

​

​

​

Player

Year

Doubles

1

Don Mattingly

1986

53

2

Lou Gehrig

1927

52

3

Alfonso Soriano

2002

51

10 of 24

10

4a. Facial attractiveness and the Golden Ratio Φ

​

​

​

​

​

  • (a + b)/a = a/b = Φ Φ = (1 + √5)/2 ≈ 1.618
  • A biostatistician* believes attractive people have various facial ratios close to Φ, and the rest of us do not.
  • Well, game on! * Schmid, K. (2008). Computation of a Face Attractiveness Index. Pattern Recognition. 41.

11 of 24

11

4b. Facial attractiveness and the Golden Ratio Φ

​

​

​

​

​

​

​

  • This is Jade. She is not so close to 1.618.
  • “Beauty is in the phi of the beholder.”* * Original from Plato, Shakespeare, others.
  • But then I measured celebrities and non-celebrities.

12 of 24

12

4c. Facial attractiveness and the Golden Ratio Φ

​

​

​

​

​

​

  • Attractive celebrities do measure close to Φ. JT - eh.
  • My class had mixed ratings on non-celebrities.
  • Nevertheless, I had fun.

13 of 24

13

5a. Taylor Swift lyrics

​

  • Words are data too!
  • Text analysis used in customer sentiment, writing style and authorship, unusual language patterns (AI cheating), potential criminal activity, etc.
  • Did Shakespeare really write all the works attributed to him? Did Alexander Hamilton?
  • I once compared my original short story to Shakespeare (numerically).

​

​

​

​

14 of 24

14

5b. Taylor Swift lyrics

​

  • Did you study her Taylor Series in Calc III?
  • And what is Beyonce’s contribution to math?

​

​

​

​

​

15 of 24

15

5c. Taylor Swift lyrics

I analyzed 240 of her songs for:

​

  • emotional words, and types of emotions
  • most frequent words per song
  • trend in emotions over time
  • examine theory that 5th song in every album is most emotional
  • are her songs becoming more r-rated?
  • Just as with numerical data, her lyrics required a lot of data cleaning before I could use it, e.g. “wanna”.

​

​

​

​

16 of 24

16

5d. Taylor Swift lyrics

​

Most freq emotional words Most freq emotions

​

​

​

​

​

​

17 of 24

17

6a. Wordle

Choose 5-letter word, get feedback, let R narrow down the list of 2300 possible Wordle words to make next guess

​

  • Green: correct letter, correct position.
  • Yellow: letter is in the word, but in wrong position.
  • Gray: word does not contain that letter in any position.
  • Cheating: make a guess, get feedback, filter possible Wordle words, get letter frequency of remaining words, guess again. (Another R program.)

​

​

​

​

​

18 of 24

18

6b. Wordle

Choose 5-letter word, get feedback, let R narrow down the list of 2300 possible Wordle words to make next guess

​

  • Guess 1: GAMER
  • 1 A is green: correct spot.

2 E is yellow: in word, wrong spot.

3 G, M, R grey: totally wrong.

  • Use 1,2,3 to reduce words from 2300 to 30, whose highest letter frequency are: A (20%), E (20%), l (9.3%), T (9.3%), S (8.7%).
  • Should help for next guess.

​

​

​

​

​

​

19 of 24

19

7a. Anyone see a problem here?

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

Chart from Reuters, data from Florida Department of Law Enforcement (FDLE). But these are homicide offenses by guns, not deaths.

20 of 24

20

7b. A slight change in the graph shows a different conclusion

​

​

​

21 of 24

21

7c. Yelling at the TV for illogical statements

TV detectives are sometimes illogical

​

  • A statement S: “If P then Q” is not necessarily equivalent to its converse C: “If Q then P”.
  • “When people are guilty (P), they lie to the police (Q). You just lied to me about where you were last night (Q), which means you're our killer (P).”
  • Observing that a person lied (Q) does not automatically mean they are the killer (P).

​

22 of 24

22

7d. Yelling at the TV for illogical statements

TV detectives are sometimes illogical

​

  • A statement S: “If P then Q” is not necessarily equivalent to its inverse I: “If not P then not Q”.
  • “If an outsider broke in to steal the jewels, there would be signs of forced entry at the front door. But the lock is intact and the window isn't broken. Therefore, it was an inside job.”
  • An outsider could have picked the lock, copied the key, found a door left unlocked, or posed as a delivery worker to be let inside.

​

​

​

​

​

​

23 of 24

23

7e. Yelling at the TV for illogical statements

Sometimes the math is wrong

​

  • Pi is an irrational number, which means it is an infinite, non-repeating decimal.
  • In TV show Person of Interest, Mr. Finch declared that every finite sequence of digits is contained somewhere within the infinite digits of pi. (2013, Season 2, Ep. 11).
  • A number having this property is called a normal number. Pi is suspected to be normal, but this has never been proven.

​

​

​

​

​

​

24 of 24

24

7f. Yelling at the TV for illogical statements

Sometimes the math is really wrong

​

  • A graduate of the Wharton School of the University of Pennsylvania with a degree in Economics promised to reduce drug prices more than 100 percent. *
  • What do you think about the math of this, and what would it imply?

​

* https://apnews.com/article/fact-check-trump-prescription-drug-prices-drop-b3e5bf8a98310de45e39d3911d112979

​

​

​

​

​

​