the game of barcelona databases, evolution, and reverse tessellation through the eyes of a gambler...

51
The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Upload: elmer-mclaughlin

Post on 22-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

databases, evolution, and reverse tessellation

through the eyes of a gambler Keith Clay GRCC

Page 2: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

First a word from…

Excessive Gambling

is not cool!

Page 3: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

And now a word from…

Excessive study of gambling is a time honored tradition.

Laplace Poisson Cauchy

Excessive study of gambling is a time honored tradition.

Page 4: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game

of Barcel

ona

Page 5: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

According to legend…It was invented on a Mediterranean

island when two brilliantmathematicians were shipwrecked. ( island )

Page 6: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

Their names are lost to history.

We know them only as Mr. Red and Mr. Blue.

Page 7: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

They played a game using only blue and red seashells…

… drawn blindly, one at

a time.

Page 8: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

Shells are drawn one at a time. Whichever color has more shells

showing after a given draw wins that round.

What was the score for this game?

Let’s do it again.

Page 9: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

Shells are drawn one at a time… … so we draw one.

The score is: RED BLUE

The first shell is red. There are more red shells than blue shells.Red wins round one.

1 0

The second shell is blue. There is one red shell and one blue shell.Round two is a tie. The score is unchanged.

The third shell is blue. There is one red shell and two blue shells.Nblue > Nred. Blue scores one point.

1

The fourth shell is red. There are 2 red shells and 2 blue shells.Nblue = Nred. The score is unchanged.

The fifth shell is blue. There are 2 red shells and 3 blue shells.Nblue > Nred. Blue scores one point.

2

The sixth shell is red. There are 3 red shells and 3 blue shells.Nblue = Nred. The score is unchanged.

This could also be called • a score of -1 for red• or a score of +1 for blue

This game can be played solitaire.

Or against a casino.

Page 10: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

In a casino: • The game can be played with

cards.• Only the color matters.

If you are betting in a casino… • Do you want to be red or black?• Does it matter? (If not why

not?)

Page 11: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

This game would not be very interesting... …if it were not for a seagull.

Now would you want to be blue or red?

Page 12: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With n blue shells and n + 1 red shells,

Mr. Red had an advantage.

To even the odds,it was agreed thatblue would score

onturns when

drawing a shell produced a

tie.

Page 13: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of BarcelonaUnder the new rules,

who has the advantage?

The score is: RED BLUE1 21032

This new game is called Barcelona.

Would you rather be blue or red?

Page 14: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

Casinos can play Barcelona with

decks of 51 cards (26 red, 25 black)

You get $1 for each round you win.

You lose $1 for each round you lose.

Do you want red? Black?What are your odds?

Page 15: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With 26 red cards and 25 black…• Do you want to be red or black?• What is the probability of winning $51?• What is the probability of winning $11?• Which scores are most likely?• What will be the average score?• Who cares? Is this any more than a

game?

Page 16: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With 26 red cards and 25 black…• Do you want to be red or black?• What is the probability of winning $51?• What is the probability of winning $11?• Which scores are most likely?• What will be the average score?• Who cares? Is this any more than a

game?

Page 17: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Red or Black?

POSSIBLE SCORES:With 26 red cards and 25 black…• You can win 51 rounds ( +$51 ahead)• You can win 50 and lose 1 ( + $49 )• You can win 49 and lose 2 ( + $47 )• …• You can lose 51 rounds ( - $51 )Can BOTH COLORS win $51? Lose $51?

Page 18: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Red or Black?Observation:

Given (n+1) red cards and (n) black cards,• Red can win 2n+1 rounds.• Black cannot.

Red wins $5, loses $0. Score = +$5 for red.

Now reverse the order.

Red wins $1, loses $4. Score = - $3 for red.

Red can win (2n+1) dollars but can only lose (2n-1) dollars. Both appear equally likely.

Page 19: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Red or Black?

Remember these shells?Try reversing the order again.

The score was: RED BLUE 32

The score is: RED BLUE 14

Page 20: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Red or Black?Conjecture (not a proof): • Reversing the order of a set of cards

turns a “good” hand into a “bad” hand.• The midpoint of “good” and “bad” is:

[ (2n+1) + (-(2n-1)) ] / 2 = 1 net win for red.

• “Forward” and “Reverse” orders of a set of cards are equally likely.

• So on average, red gains 1 win per hand.Does Barcelona favor Red?

Page 21: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With 26 red cards and 25 black…• Do you want to be red or black?• What is the probability of winning $51?• What is the probability of winning $11?• Which scores are most likely?• What will be the average score?• Who cares? Is this any more than a

game?

Page 22: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Running the Table

• To win $51, red has to win every round.• That means there will always be more red

cards showing than black. How likely is that?

• One way to find an answer:• Count the number of arrangements where there

are always more red the black ( reading right to left)

• Divide by the number of possible arrangements.

Page 23: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Running the Table

• How many ways are there to arrange 51 cards?• 51 choices for the first card, 50 choices for the

second card, 49 choices for the third…• 51 50 49 … 3 2 1 = 51! 1066

• But wait! Not all of those 1066 arrangements are different!We might not need to check 1066 arrangements.

Page 24: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Running the Table

• Rearranging the cards (or seashells) of one color does not change the score.

All 3! arrangements of these shells produce the same score.

All 2! arrangements of these shells produce the same score.

• So the number of distinct arrangements of these five shells is:

5!10

3!2!possibleN

Page 25: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Running the Table

• The number of distinct arrangements of 26 red cards and 25 black cards is:

51!250,000,000,000,000

26!25!possibleN

• Calculating the Barcelona score of each arrangement would take a very long time.

Page 26: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Running the Table

CRUCIAL QUESTION:• How many ways are there to run

the table in a Barcelona game with (2n+1) cards?

This is a question with many applications.

Page 27: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With 26 red cards and 25 black…• Do you want to be red or black?• What is the probability of winning $51?• What is the probability of winning $11?• Which scores are most likely?• What will be the average score?• Who cares? Is this any more than a

game?

Page 28: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Barcelona-like problems:

The parentheses problem:• Given n left and n right

parentheses, how many arrangements are possible that leave all parentheses closed?

( ( ) ) ( )

Good

( ) ) ( ) (

Bad

Page 29: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Barcelona-like problems:

The parentheses problem:• In information science:

How many possible relationships are there for n categories & subcategories?

( a ( b ) ) ( c )One

relationship

( a ( b ( c ) ) ) Another

• The problem is crucial to allocation of memory in databases and networks.

Page 30: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Barcelona-like problems:

The parentheses problem:• Color coding shows this is the

same as “running the table” in Barcelona

Page 31: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Barcelona-like problems:

Evolution and Genetics:• How are creatures (or people) related?• What is the family tree of this group?• Who branched off when?

Dinosaur

ReptileAmphibian Bird

Page 32: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Barcelona-like problems:

DinosaurReptileAmphibian Bird

DinosaurReptileAmphibian Bird

A possible family tree Another possibility

How many possible trees are there?

Page 33: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Barcelona-like problems:

“Planted binomial trees”

• Start at the bottom• When you come to a

node, turn left• At the end of a

branch, turn around• Left branches are

red, right branches are blue

The number of family trees for (n+1) critters is the same as the number of ways to run the table with (2n+1) cards (or seashells).

Page 34: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Barcelona-like problems:

Reverse tessellation:• How many ways are there

to dissect a polygon into triangles using only non-intersecting diagonals?

Leonhard Euler

Euler solved the problem by induction in a process he called “quite laborious.”

Eugene Catalan returned to the problem a century later. The answers to this day are called the “Catalan numbers.”

Eugene Catalan

Page 35: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Barcelona-like problems:

Reverse tessellation:• The connection to Barcelona,

databases, and trees?

Page 36: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Solving Barcelona

• Given (n+1) red shells, and (n) blue, “cut the deck”One of the new

groups must have more red than blue. Call it group A.

A

B The other group cannot have more red than blue. Call it group B.

Page 37: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Solving Barcelona

• If A precedes B, the score (for red) must be higher…

A

B… than it would be if B preceded A.

AB

Page 38: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Solving Barcelona

For any arrangement of cards or shells,• a “cut of the deck” will change the

score.• Math lingo:

“cutting the deck” = “cyclic permutation”

• No arrangements connected by a cyclic permutation will have the same score.

Page 39: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Solving Barcelona

The “Pigeonhole Principle”

• Snow White lived with little people.

• Name them: Happy, Dopey, Sleepy, Gumpy, Sneezy, Bashful, and Doc.

• Is that all of them?

The “Pigeonhole Principle”

• Snow White lived with little people.

• Name them: Happy, Dopey, Sleepy, Gumpy, Sneezy, Bashful, and Doc.

Page 40: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Solving Barcelona

Page 41: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Solving Barcelona

The “Pigeonhole Principle”• If you need N answers, all different…• And you find N answers, all

different…• You’re done.

Page 42: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Solving Barcelona

Given (n+1) red cards and (n) black cards:• There are (2n+1) possible scores for red:

• +(2n+1), +(2n-1), +(2n-3), … -(2n-3), -(2n-1)

• Every cyclic permutation (cut of the cards) produces a different score.

• There are (2n+1) cyclic permutations.• Every possible score appears once.• Each cyclic permutation is equally likely.

Page 43: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Solving Barcelona

Every possible score is equally likely!

Every score has a probability of 1/(2n+1).

Page 44: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With 26 red cards and 25 black…• Do you want to be red or black?• What is the probability of winning $51?• What is the probability of winning $11?• Which scores are most likely?• What will be the average score?• Who cares? Is this any more than a

game?

There are 51 possible scores.The probability is 1/51.

Page 45: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With 26 red cards and 25 black…• Do you want to be red or black?• What is the probability of winning $51?• What is the probability of winning $11?• Which scores are most likely?• What will be the average score?• Who cares? Is this any more than a

game?

There are 51 possible scores.The probability is 1/51.

Page 46: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With 26 red cards and 25 black…• Do you want to be red or black?• What is the probability of winning $51?• What is the probability of winning $11?• Which scores are most likely?• What will be the average score?• Who cares? Is this any more than a

game? None.All scores are equally

likely.

Page 47: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With 26 red cards and 25 black…• Do you want to be red or black?• What is the probability of winning $51?• What is the probability of winning $11?• Which scores are most likely?• What will be the average score?• Who cares? Is this any more than a

game?

Each score is equally likely.

Add the scores and divide by (2n+1).

The scores add up to (2n+1).

On average, red wins a dollar.

Page 48: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

The game of Barcelona

With 26 red cards and 25 black…• Do you want to be red or black?• What is the probability of winning $51?• What is the probability of winning $11?• Which scores are most likely?• What will be the average score?• Who cares? Is this any more than a

game?

How many databases, family trees, reverse tessellations,

and all that?

2 1 ! 2 !1

1 ! ! 2 1 1 ! !

n n

n n n n n

Page 49: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Acknowledgements:

• Probability• Combinatoric

s• Graph theory• Group theory

• Information theory

• Formal logic• Set theory• Fun

I’d like to thank the following branches of mathematics for

appearing in this talk:

Page 50: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Acknowledgements:

Martin Gardner

Possibly the world’s best mathematical

author.

Read his books.

Most of all I’d like to thank …

Page 51: The game of Barcelona databases, evolution, and reverse tessellation through the eyes of a gambler Keith Clay GRCC

Questions?