Odds Algorithm An Online Algorithm Group Fibonado 20. Dec 2016 - - PowerPoint PPT Presentation

odds algorithm
SMART_READER_LITE
LIVE PREVIEW

Odds Algorithm An Online Algorithm Group Fibonado 20. Dec 2016 - - PowerPoint PPT Presentation

Odds Algorithm An Online Algorithm Group Fibonado 20. Dec 2016 Group Fibonado Odds Algorithm 20. Dec 2016 1 / 21 Outline Introduction 1 Online Algorithm The Secretary Problem Optimal Stopping 2 Odds Algorithm 3 Algorithm Proof


slide-1
SLIDE 1

Odds Algorithm

An Online Algorithm Group Fibonado

  • 20. Dec 2016

Group Fibonado Odds Algorithm

  • 20. Dec 2016

1 / 21

slide-2
SLIDE 2

Outline

1

Introduction Online Algorithm The Secretary Problem

2

Optimal Stopping

3

Odds Algorithm Algorithm Proof

Group Fibonado Odds Algorithm

  • 20. Dec 2016

2 / 21

slide-3
SLIDE 3

Online Algorithm

Page replacement algorithm (LRU, Marking algorithm) Insertion sort Perceptron Odds algorithm

Group Fibonado Odds Algorithm

  • 20. Dec 2016

3 / 21

slide-4
SLIDE 4

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates.

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-5
SLIDE 5

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates. Giant Schnauzer

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-6
SLIDE 6

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates. Giant Schnauzer Fair

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-7
SLIDE 7

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates. Giant Schnauzer Fair English Springer Spaniel

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-8
SLIDE 8

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates. Giant Schnauzer Fair English Springer Spaniel Nice Husky

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-9
SLIDE 9

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates. Giant Schnauzer Fair English Springer Spaniel Nice Husky No way

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-10
SLIDE 10

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates. Giant Schnauzer Fair English Springer Spaniel Nice Husky No way Miniature Schnauzer

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-11
SLIDE 11

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates. Giant Schnauzer Fair English Springer Spaniel Nice Husky No way Miniature Schnauzer Great

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-12
SLIDE 12

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates. Giant Schnauzer Fair English Springer Spaniel Nice Husky No way Miniature Schnauzer Great Border collie

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-13
SLIDE 13

The Secretary Problem on dog planet

Description Interview n candidates for a position one at a time. After each interview decide if the candidate is the best so far and hire him/her. Goal Maximize the probability of choosing the best among all n candidates. Giant Schnauzer Fair English Springer Spaniel Nice Husky No way Miniature Schnauzer Great Border collie ...

Group Fibonado Odds Algorithm

  • 20. Dec 2016

4 / 21

slide-14
SLIDE 14

Outline

1

Introduction Online Algorithm The Secretary Problem

2

Optimal Stopping

3

Odds Algorithm Algorithm Proof

Group Fibonado Odds Algorithm

  • 20. Dec 2016

5 / 21

slide-15
SLIDE 15

Optimal Stopping (Discrete time case)

The problem concerns with: When to stop?? How to maximize the reward?

Group Fibonado Odds Algorithm

  • 20. Dec 2016

6 / 21

slide-16
SLIDE 16

Dice Toss

Dice Toss

Consider a game that consists of throwing a fair, six-sided die n times, and whose aim is to stop at the last 6 obtained.

Group Fibonado Odds Algorithm

  • 20. Dec 2016

7 / 21

slide-17
SLIDE 17

Dice Toss

Dice Toss

Consider a game that consists of throwing a fair, six-sided die n times, and whose aim is to stop at the last 6 obtained. After each toss, you can choose either stop or continue.

  • Reward. 0 if you didn’t stop on the last

. Otherwise, you get 1million

Group Fibonado Odds Algorithm

  • 20. Dec 2016

7 / 21

slide-18
SLIDE 18

Dice Toss

Dice Toss

Consider a game that consists of throwing a fair, six-sided die n times, and whose aim is to stop at the last 6 obtained. After each toss, you can choose either stop or continue.

  • Reward. 0 if you didn’t stop on the last

. Otherwise, you get 1million Let’s play!

Group Fibonado Odds Algorithm

  • 20. Dec 2016

7 / 21

slide-19
SLIDE 19

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-20
SLIDE 20

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-21
SLIDE 21

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-22
SLIDE 22

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-23
SLIDE 23

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-24
SLIDE 24

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-25
SLIDE 25

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-26
SLIDE 26

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-27
SLIDE 27

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-28
SLIDE 28

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-29
SLIDE 29

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-30
SLIDE 30

Dice Toss

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-31
SLIDE 31

Dice Toss

How to maximize the probability that we stop at the last ?

Group Fibonado Odds Algorithm

  • 20. Dec 2016

8 / 21

slide-32
SLIDE 32

P(Obtaining one in last ` throws ) = C 1

`

1 6 · (5 6)`−1 = ` 6 · (5 6)`−1

Group Fibonado Odds Algorithm

  • 20. Dec 2016

9 / 21

slide-33
SLIDE 33

P(Obtaining one in last ` throws ) = C 1

`

1 6 · (5 6)`−1 = ` 6 · (5 6)`−1 Differentiating this expression and setting it to 0, we find it is maximized at ` = 6(or ` = 5).

Group Fibonado Odds Algorithm

  • 20. Dec 2016

9 / 21

slide-34
SLIDE 34

P(Obtaining one in last ` throws ) = C 1

`

1 6 · (5 6)`−1 = ` 6 · (5 6)`−1 Differentiating this expression and setting it to 0, we find it is maximized at ` = 6(or ` = 5). Intuitively, the most sensible strategy therefore seems to wait till we only have 6 throws left, and then choose the first that occurs after that.

Group Fibonado Odds Algorithm

  • 20. Dec 2016

9 / 21

slide-35
SLIDE 35

P(Obtaining one in last ` throws ) = C 1

`

1 6 · (5 6)`−1 = ` 6 · (5 6)`−1 Differentiating this expression and setting it to 0, we find it is maximized at ` = 6(or ` = 5). Intuitively, the most sensible strategy therefore seems to wait till we only have 6 throws left, and then choose the first that occurs after that. P(Strategy leads to the last ) = P(Obtaining one in last 6 throws ) = (5 6)5 = 0.4018

Group Fibonado Odds Algorithm

  • 20. Dec 2016

9 / 21

slide-36
SLIDE 36

P(Obtaining one in last ` throws ) = C 1

`

1 6 · (5 6)`−1 = ` 6 · (5 6)`−1 Differentiating this expression and setting it to 0, we find it is maximized at ` = 6(or ` = 5). Intuitively, the most sensible strategy therefore seems to wait till we only have 6 throws left, and then choose the first that occurs after that. P(Strategy leads to the last ) = P(Obtaining one in last 6 throws ) = (5 6)5 = 0.4018 What about general cases? The Secretary Problem?

Group Fibonado Odds Algorithm

  • 20. Dec 2016

9 / 21

slide-37
SLIDE 37

Outline

1

Introduction Online Algorithm The Secretary Problem

2

Optimal Stopping

3

Odds Algorithm Algorithm Proof

Group Fibonado Odds Algorithm

  • 20. Dec 2016

10 / 21

slide-38
SLIDE 38

Problem Restatement

Problem

You are observing a sequence of events, which may be a success or not, you are required to make the decision to stop or continue the observation.

Goal

Stop on the last success.

Theorem

Every kind of stop strategy can be reduced to the following rule: ignore all successes before the kth observation, then choose the first success encountered.

Group Fibonado Odds Algorithm

  • 20. Dec 2016

11 / 21

slide-39
SLIDE 39

Alice and Bob go biking

Alice and Bob want to go biking someday in this week, but the later, the better.

Algorithm Homework 99

Group Fibonado Odds Algorithm

  • 20. Dec 2016

12 / 21

slide-40
SLIDE 40

Alice and Bob go biking

Mon Tue Wed Thu Fri Sat Sun P( ) 0.1 0.5 0.3 0.1 0.3 0.2 0.1

Group Fibonado Odds Algorithm

  • 20. Dec 2016

13 / 21

slide-41
SLIDE 41

Alice and Bob go biking

Mon Tue Wed Thu Fri Sat Sun P( ) 0.1 0.5 0.3 0.1 0.3 0.2 0.1 Outcome 1

Æ

Group Fibonado Odds Algorithm

  • 20. Dec 2016

13 / 21

slide-42
SLIDE 42

Alice and Bob go biking

Mon Tue Wed Thu Fri Sat Sun P( ) 0.1 0.5 0.3 0.1 0.3 0.2 0.1 Outcome 1

Æ

Outcome 2

Æ

Group Fibonado Odds Algorithm

  • 20. Dec 2016

13 / 21

slide-43
SLIDE 43

Alice and Bob go biking

Mon Tue Wed Thu Fri Sat Sun P( ) 0.1 0.5 0.3 0.1 0.3 0.2 0.1 Outcome 1

Æ

Outcome 2

Æ

Outcome 3

Group Fibonado Odds Algorithm

  • 20. Dec 2016

13 / 21

slide-44
SLIDE 44

Odds Algorithm

Let I1, . . . , In be a sequence of independent indicators, s.t. Ik = ( 1 if

  • therwise (

) pk = E(Ik) = 1 − qk = P(day k is ) rk = pk/qk (the odds)

Group Fibonado Odds Algorithm

  • 20. Dec 2016

14 / 21

slide-45
SLIDE 45

Odds Algorithm

Mon Tue Wed Thu Fri Sat Sun pk 0.1 0.5 0.3 0.1 0.3 0.2 0.1

Group Fibonado Odds Algorithm

  • 20. Dec 2016

15 / 21

slide-46
SLIDE 46

Odds Algorithm

Mon Tue Wed Thu Fri Sat Sun pk 0.1 0.5 0.3 0.1 0.3 0.2 0.1 rk 1/9 1 3/7 1/9 3/7 1/4 1/9

Group Fibonado Odds Algorithm

  • 20. Dec 2016

15 / 21

slide-47
SLIDE 47

Odds Algorithm

Mon Tue Wed Thu Fri Sat Sun pk 0.1 0.5 0.3 0.1 0.3 0.2 0.1 rk 1/9 1 3/7 1/9 3/7 1/4 1/9 Σn

j=krj

2.44 2.33 1.33 0.90 0.79 0.36 0.11

Group Fibonado Odds Algorithm

  • 20. Dec 2016

15 / 21

slide-48
SLIDE 48

Odds Algorithm

Mon Tue Wed Thu Fri Sat Sun pk 0.1 0.5 0.3 0.1 0.3 0.2 0.1 rk 1/9 1 3/7 1/9 3/7 1/4 1/9 Σn

j=krj

2.44 2.33 1.33 0.90 0.79 0.36 0.11 ↑ starts from this day, choose the first day.

Optimal Rule of the Odds Algorithm

Ignore all successes before kth observation, then stop at the first success. Where k is the largest k s.t. Σn

j=krj ≥ 1.

Group Fibonado Odds Algorithm

  • 20. Dec 2016

15 / 21

slide-49
SLIDE 49

Proof of the Odds Theorem

Let Sk = Ik + · · · + In.

Observation

Sk = 1 ⇐ ⇒ exactly 1 day after the k − 1th day.

Claim

let k∗ be optimal rule, k∗ maximize P(Sk = 1).

Group Fibonado Odds Algorithm

  • 20. Dec 2016

16 / 21

slide-50
SLIDE 50

Actually, we can find the precise formula for P(Sk = 1) using basic proba- bility theory: P(Sk = 1) = (Σn

j=krj)( n

Y

j=k

qj) = Vk(n) Vk(n) increasing in k ⇔ Vk(n) < Vk+1(n) ⇔∗ Σn

j=k+1rj > 1

Observation

1 Σn

j=k+1rj is monotonically decreasing as k increases.

2 P(Sk = 1) increases up to a certain value of k and then decrease 3 There is therefore a single maximum attained at the largest k for

which Σn

j=krj ≥ 1.

Group Fibonado Odds Algorithm

  • 20. Dec 2016

17 / 21

slide-51
SLIDE 51

Group Fibonado Odds Algorithm

  • 20. Dec 2016

18 / 21

slide-52
SLIDE 52

Secretary Problem Revisited

Let I1, . . . , In be indicators s.t. Ik = 1 if secretary k is the best secretary seen so far and Ik = 0 otherwise. Clearly, pk = 1/k, rk = 1 k − 1 Rs = 1/(n − 1) + 1/(n − 2) + · · · + 1/(s − 1), stopped at 1. As n → ∞, s/n → 1/e ≈ 37% V (n) = ((s − 1)/n)Rs → 1/e.

Group Fibonado Odds Algorithm

  • 20. Dec 2016

19 / 21

slide-53
SLIDE 53

Secretary Problem Revisited

Let I1, . . . , In be indicators s.t. Ik = 1 if secretary k is the best secretary seen so far and Ik = 0 otherwise. Clearly, pk = 1/k, rk = 1 k − 1 Rs = 1/(n − 1) + 1/(n − 2) + · · · + 1/(s − 1), stopped at 1. As n → ∞, s/n → 1/e ≈ 37% V (n) = ((s − 1)/n)Rs → 1/e.

37% Rule

reject the first n/e secretaries and to then accept the best secretary so far, if any.

Group Fibonado Odds Algorithm

  • 20. Dec 2016

19 / 21

slide-54
SLIDE 54

Q&A

Group Fibonado Odds Algorithm

  • 20. Dec 2016

20 / 21

slide-55
SLIDE 55

Thanks.

Group Fibonado Odds Algorithm

  • 20. Dec 2016

21 / 21