Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper...

25
Getting Married Getting Married The Mathematical way The Mathematical way

Transcript of Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper...

Page 1: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Getting MarriedGetting Married

The Mathematical wayThe Mathematical way

Page 2: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

The simulation gameThe simulation game

• N numbers are written on N pieces of paper which are then shaken up in a box.

• The numbers are drawn one by one.

• We can stop when we like and take the last number …

• But we can’t go back 7

4

9

Page 3: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

The objectiveThe objective

• We want to select the largest number

• (We want the strategy which gives us the best chance of choosing the largest number).

• i.e. We want to MAX the probability.

Page 4: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

The problemThe problem

We have no idea of the order in which the numbers will be drawn

E.g. 7, 9, 4, 3, 5, 8, 6, 1, 3, 3, 0, 2

It is only when the pth number drawn is

the biggest so far

That we will even consider stopping.

Page 5: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

ProbabilitiesProbabilities

• P(pth number drawn is highest so far)

• P(pth number is highest of all)

• P(pth is highest given highest so far)

p

1

N

1

)(

)(

farsohighestP

farsohighestallofhighestP

p

N

/1

/1

N

p

Page 6: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Decision timeDecision time

Suppose there are t numbers left to be drawn.

We have to decide whether ….

(a) To stop on number just chosen,

Or (b) To continue “sampling”.

Page 7: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Defining useful variablesDefining useful variables

Let be the probability of winning

if we continue

(i.e. selecting the highest number of all).

So, the probability of winning if we stop is

tg

N

tN

Page 8: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

The objective variableThe objective variable

Let be the probability of winning by adopting the best strategy

when there are t numbers left.

tf

N

tNgMax tt ,f (1)

Page 9: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Considering the strategyConsidering the strategy

Either the number we draw next is the highest so far

AND

We adopt the best strategy when (t -1) are left ………

)1(

1

tN

1tf

Page 10: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Considering the strategyConsidering the strategy

OR ….

The number we draw next is not the highest so far

AND

We therefore must continue

)1(

1))1((

tN

tN

1tg

Page 11: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

The iteration formulaThe iteration formula

For t > 1,

We first need

then

then

then

1

)(

111

tN

gtN

tN

fg ttt

0f

1g

1f2g

(2)

Page 12: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Starting valuesStarting values

Ng

Nf

1,

110

N

N

N

N

NMaxf

11,

11

NN

N 11

From equation (1), (For N > 2)

So when t = 1, STOP if

i.e. 1

11

N

Or N >2 and number just drawn is highest so far

Page 13: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Using the iteration formulaUsing the iteration formula

• From equation (2) when t = 2,

• So from (1),

2

1

1

12

1.

1

21.

1

1

)1(

)2(

111

2

NNN

NNN

N

N

N

N

N

gN

N

fg

N

N

NNN

NMax

N

NgMaxf

2,

2

1

1

12

2,22

Page 14: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

TerminationTermination

So when t = 2,

STOP if

And the number just drawn is the highest so far

2

1

1

11

NN

Page 15: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

More iterationsMore iterations

In the same way we can obtain

And of course

Then, when t = 3 we STOP if

And number drawn is highest so far

3

1

2

1

1

133 NNNN

Ng

N

NgMaxf

3,33

3

1

2

1

1

11

NNN

Page 16: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

The optimum strategyThe optimum strategy

When there are t numbers left, we should

STOP if

And the number just drawn is the highest so far

tNNN

1......

2

1

1

11

Page 17: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Example timeExample time

• Click here to see the example

• Click here to skip the example

Page 18: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Example: Taking Example: Taking NN = 8 = 8

1 left

2 left

3 left

4 left

In each case above, we STOP if the number just drawn is highest so far

7

11

8

7,

8

111 fg

42

13

6

1

7

11

8

6,

56

1322 fg

210

107

5

1

6

1

7

11

8

5,

336

10733 fg

420

3191

2

1,

840

31944 fg

Page 19: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Example continuedExample continued

But when there are 5 left,

And

So we would continueNote that with 6 left,

And with 7 left,

420

459

3

1...

6

1

7

11

1120

45955 fg

1120

45966 fg

1120

45977 fg

Page 20: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

““Courting”Courting”

R = N – t is the number we select for information and experience.

N 2 3 4 5 6 7 8 9

R 1 1 1 2 2 2 3 3

N 10 11 12 13 14 15 20 25 30 35 40

R 3 4 4 5 5 5 7 9 11 13 15

N 45 50 60 70 80 90 100

R 16 18 22 26 29 33 37

Page 21: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

OutcomeOutcome

• For large values of N, the probability of winning by adopting this strategy is

• Where t is the smallest integer such that

tNNNN

tN 1...

2

1

1

1

tNNN

1......

2

1

1

11

Page 22: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

Using the MathsUsing the Maths

But for large N (and t),

N

tNdxxtNNN

11...

2

1

1

1

tN

NxN

tNlnln

Page 23: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

InterpretationInterpretation

We need to choose t so that

Or, in other words:

So that the probability of “winning” is

But the part in brackets is unity so

1ln

tN

N

eN

tN 1

etNNNN

tN 11...

2

1

1

1

37.01

N

R

eN

tN

Page 24: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

The man’s conclusionThe man’s conclusion

Most men marry by 40, so between 15 and 40 there are 25 years to choose a wife.

So R = 9 years.

So “court” until the age of 24 for “experience” only.

37.025

R

Page 25: Getting Married The Mathematical way The simulation game N numbers are written on N pieces of paper which are then shaken up in a box. The numbers are.

The woman’s conclusionThe woman’s conclusion

Most women marry by 30, so between 15 and 30 there are 15 years to choose a husband.

So R = 6 years

So “court” until the age of 21 for “experience” only.

37.015

R