SlideShare a Scribd company logo
1 of 5
Download to read offline
Solution
Week 16 (12/30/02)
Letters in envelopes
First Solution: (This solution is due to Aravi Samuel.) We will use induction on
N. Let BN denote the number of “bad” configurations where none of the N letters
end up in the correct envelope. We claim that BN+1 = N(BN + BN−1). This can
be seen as follows. In proceeding inductively from N to N + 1 letters, there are two
possible ways we can generate bad configurations:
• Given a bad configuration with N letters, we can create a bad configuration
with N + 1 letters by simply placing down the (N + 1)st letter in its envelope,
and then trading that letter with any of the other N letters. This provides us
with NBN bad configurations.
• We can also create a bad configuration with N +1 letters by taking a configu-
ration of N letters where exactly one letter is in the correct envelope (there are
NBN−1 such configurations) and then trading that letter with the (N + 1)st
letter. This provides us with NBN−1 bad configurations.
We therefore see that BN+1 = N(BN + BN−1). The probability of obtaining a bad
configuration with N letters is PN = BN /N!. Hence, BN = N! PN , and so
(N + 1)! PN+1 = N N! PN + (N − 1)! PN−1
=⇒ (N + 1)PN+1 = NPN + PN−1. (1)
To solve this recursion relation, we can write it in the more suggestive form,
PN+1 − PN = −
1
N + 1
PN − PN−1 . (2)
Since P1 = 0 and P2 = 1/2, we have P2 − P1 = 1/2. We then find inductively that
Pk − Pk−1 = (−1)k/k! . Therefore,
PN = P1 +
N
k=2
(Pk − Pk−1)
= 1 − 1 +
N
k=2
(−1)k
k!
=
N
k=0
(−1)k
k!
. (3)
This is simply the partial series expansion for e−1. So for large N, it approaches
1/e ≈ 37%. This series expansion for 1/e converges very rapidly, so N does not
have to be very large for the approximation PN ≈ 1/e to be valid. For example, if
N = 5 we have P5 − 1/e ≈ 0.001.
Remark: This 1/e result in the large-N limit can also be seen in the following way. The
probability that a given letter does not end up in its corresponding envelope is 1 − 1/N.
1
Therefore, if we ignore the fact that the placements of the letters are related (they are
related because two letters cannot end up in the same envelope), then the probability that
no letter ends up in the correct envelope is
1 −
1
N
N
≈
1
e
. (4)
It is not obvious that the correlations between the letters can be neglected here, but in view
of the above result, this is apparently the case.
Second Solution: Let PN be the probability that none of the N letters end up
in the correct envelope. Let Li and Ei denote the ith letter and corresponding
envelope, respectively.
Consider a given letter, La1 , and assume that no letter ends up in the correct
envelope. Then La1 must end up in some Ea2 , with a2 = a1. La2 will then end
up in some Ea3 . La3 will then end up in some Ea4 , and so on. Eventually, one of
the envelopes in this chain must be Ea1 . Let it be Ean+1 . We may describe this
situation by saying that La1 belongs to a “loop” of length n. If no letter ends up in
the correct envelope, then n can be any number from 2 to N.
Claim: The probability that the loop containing La1 has length n is equal to 1/N,
independent of n.
Proof: La1 has an (N − 1)/N probability of ending up in some Ea2 , with a2 =
a1. La2 then has an (N − 2)/(N − 1) probability of ending up in some Ea3 , with
a3 = a2, a1. This continues until Lan−1 then has an (N − (n − 1))/(N − (n − 2))
probability of ending up in some Ean , with an = an−1, · · · , a2, a1. Finally, Lan has a
1/(N − (n − 1)) probability of ending up in Ean+1 = Ea1 . The probability that La1
belongs to a loop of length n is therefore equal to
N − 1
N
N − 2
N − 1
· · ·
N − (n − 1)
N − (n − 2)
1
N − (n − 1)
=
1
N
. (5)
Given that a loop of length n is formed, which happens with probability 1/N,
the probability that all the N − n other letters end up in the wrong envelopes is
simply PN−n. We therefore arrive at the relation,
PN =
1
N
PN−2 + PN−3 + · · · + P1 + P0 . (6)
There is no PN−1 term in this equation, because a loop of length 1 would mean that
La1 went into Ea1 . Note that P1 = 0, and that P0 = 1 here.
Multiplying eq. (6) through by N, and then subtracting the analogous equation
for PN−1 (after multiplying through by N − 1), gives
NPN − (N − 1)PN−1 = PN−2
=⇒ PN − PN−1 = −
1
N
(PN−1 − PN−2) . (7)
This is the same as eq. (2), with N + 1 replaced by N. The solution proceeds as
above.
2
Third Solution: We will find PN by counting the number of cases that have no
letter in the correct envelope, and then dividing this by the total number of possible
arrangements, N! .
We may count these cases in the following manner. There are N! total com-
binations. To count the number that have no letter in the correct envelope, we
must subtract from N! the number of combinations with, for example, (at least)
L1 in the correct envelope; there are (N − 1)! of these combinations. Likewise for
the situations where another letter is in the correct envelope. So there seem to
be N! − N(N − 1)! combinations with no letter in the correct envelope. However,
we have double-counted some of the cases. For example, a combination which has
(at least) L1 and L2 in the correct envelopes has been subtracted twice; there are
(N − 2)! of these. Likewise for all the other pairs of letters. So we must add on
N
2 (N − 2)! combinations. But now a combination which has (at least) L1, L2, and
L3 in the correct envelopes has not been counted at all (because we have subtracted
it off three times, and then added it on three times); there are (N − 3)! of these.
Likewise for the other triplets. So we must subtract off N
3 (N − 3)! combinations.
Now, however, the combinations with (at least) L1, L2, L3, and L4 in the correct
envelopes have been counted − 4
1 + 4
2 − 4
3 = −2 times. Likewise for the other
quadruplets. So we must add on N
4 (N − 4)! combinations.
In general, if we have done this procedure up to (k −1)-tuplets, then a combina-
tion having (at least) k letters in the correct envelopes has been counted T times,
where
T = −
k
1
+
k
2
− · · · + (−1)k−1 k
k − 1
. (8)
However, the binomial expansion gives
0 = (1 − 1)k
= 1 −
k
1
+
k
2
+ · · · + (−1)k−1 k
k − 1
+ (−1)k
= 1 + T + (−1)k
. (9)
Therefore, T = −2 for even k, and T = 0 for odd k. So we have either undercounted
by one, or overcounted by one. Hence, the total number of combinations having no
letter in the correct envelope is
N! −
N
1
(N − 1)! +
N
2
(N − 2)! + · · · =
N
k=0
(−1)kN!
k!
. (10)
To obtain the probability, PN , that no letter is in the correct envelope, we must
divide this result by N! . Therefore,
PN =
N
k=0
(−1)k
k!
. (11)
3
Remarks:
1. What is the probability (call it Pl
N ) that exactly l out of the N letters end up in the
correct envelopes? (With this notation, P0
N equals the PN from above.) We can find
Pl
N as follows.
The probability that a given set of l letters goes into the correct envelopes is 1/ N(N−
1)(N −2) · · · (N −l + 1) . The probability that the remaining N −l letters all go into
the wrong envelopes is P0
N−l. This situation can happen in N
l ways. Therefore,
Pl
N =
N
l
N(N − 1) · · · (N − l + 1)
P0
N−l
=
1
l!
PN−l. (12)
Hence, using eq. (3),
Pl
N =
1
l!
N−l
k=0
(−1)k
k!
. (13)
For large N, we have Pl
N ≈ 1/(l!e). The fact that this falls off so rapidly with l means
that we are essentially guaranteed of having just a few letters in the correct envelopes.
For example, we find (for large N) that the probability of having four or fewer letters
in the correct envelopes is about 99.7%.
2. It is interesting to note that the equality, Pl
N = 1
l! PN−l, may directly yield the large-N
result, PN ≈ 1/e, without having to go through all the work of the original problem.
To see this, note that
1 =
N
l=0
Pl
N =
N
l=0
1
l!
PN−l. (14)
Since the terms with small l values dominate this sum, we may (for large N) replace
the PN−l values with limM→∞ PM . Hence,
1 ≈
N
l=0
1
l!
lim
M→∞
PM . (15)
Therefore,
lim
M→∞
PM ≈
N
l=0
1
l!
−1
≈
1
e
. (16)
3. Let’s check that the Pl
N given by eq. (13) do indeed satisfy
N
l=0 Pl
N = 1. This may
be done as follows:
N
l=0
Pl
N =
N
l=0
N−l
k=0
1
l!
(−1)k
k!
=
N
l=0
N
s=l
1
l!
(−1)s−l
(s − l)!
(with s = l + k)
=
N
s=0
s
l=0
1
l!
(−1)s−l
(s − l)!
(rewriting the limits in the s, l plane)
4
=
N
s=0
1
s!
s
l=0
s!
l!(s − l)!
(−1)s−l
=
N
s=0
1
s!
(1 − 1)s
= 1 (only s = 0 contributes). (17)
4. What is the average number, A, of letters in the correct envelopes? If the setup of
the problem is repeated many times, then the average number of times a given letter
ends up in the correct envelope is 1/N. Since there are N letters, the average total
number of correct envelopes is N(1/N) = 1.
You can check that the expression for Pl
N in eq. (13) leads to A = 1. For finite N,
the sum gets a little messy, but the result in eq. (17) will help simplify things a bit if
you want to work it out.
For large N, where we have Pl
N ≈ 1/(l!e), the sum is easy, and we obtain
A =
N
l=0
lPl
N ≈
1
e
N
l=1
1
(l − 1)!
≈ 1. (18)
5

More Related Content

What's hot

20 sequences x
20 sequences x20 sequences x
20 sequences xmath266
 
Proof
ProofProof
ProofH K
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2S.Shayan Daneshvar
 
11X1 T14 09 mathematical induction 2 (2010)
11X1 T14 09 mathematical induction 2 (2010)11X1 T14 09 mathematical induction 2 (2010)
11X1 T14 09 mathematical induction 2 (2010)Nigel Simmons
 
Du1 complex numbers and sequences
Du1 complex numbers and sequencesDu1 complex numbers and sequences
Du1 complex numbers and sequencesjmancisidor
 
Ap presentation
Ap presentationAp presentation
Ap presentationviswajithb
 
The 2 Goldbach's Conjectures with Proof
The 2 Goldbach's Conjectures with Proof The 2 Goldbach's Conjectures with Proof
The 2 Goldbach's Conjectures with Proof nikos mantzakouras
 
Irrational numbers
Irrational numbersIrrational numbers
Irrational numbersKaran Dave
 
Uniform Boundedness of Shift Operators
Uniform Boundedness of Shift OperatorsUniform Boundedness of Shift Operators
Uniform Boundedness of Shift Operatorsiosrjce
 
Well-Ordering Principle
Well-Ordering Principle Well-Ordering Principle
Well-Ordering Principle Yassirdino
 
Goldbach Conjecture
Goldbach ConjectureGoldbach Conjecture
Goldbach ConjectureAnil1091
 
Inmo 2013 test_paper_solution
Inmo 2013 test_paper_solutionInmo 2013 test_paper_solution
Inmo 2013 test_paper_solutionSuresh Kumar
 

What's hot (17)

20 sequences x
20 sequences x20 sequences x
20 sequences x
 
Proof
ProofProof
Proof
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Proof by contradiction
Proof by contradictionProof by contradiction
Proof by contradiction
 
11X1 T14 09 mathematical induction 2 (2010)
11X1 T14 09 mathematical induction 2 (2010)11X1 T14 09 mathematical induction 2 (2010)
11X1 T14 09 mathematical induction 2 (2010)
 
Du1 complex numbers and sequences
Du1 complex numbers and sequencesDu1 complex numbers and sequences
Du1 complex numbers and sequences
 
Ap presentation
Ap presentationAp presentation
Ap presentation
 
The 2 Goldbach's Conjectures with Proof
The 2 Goldbach's Conjectures with Proof The 2 Goldbach's Conjectures with Proof
The 2 Goldbach's Conjectures with Proof
 
Fskik 1 nota
Fskik 1   notaFskik 1   nota
Fskik 1 nota
 
1103 ch 11 day 3
1103 ch 11 day 31103 ch 11 day 3
1103 ch 11 day 3
 
Irrational numbers
Irrational numbersIrrational numbers
Irrational numbers
 
Uniform Boundedness of Shift Operators
Uniform Boundedness of Shift OperatorsUniform Boundedness of Shift Operators
Uniform Boundedness of Shift Operators
 
Well-Ordering Principle
Well-Ordering Principle Well-Ordering Principle
Well-Ordering Principle
 
Goldbach Conjecture
Goldbach ConjectureGoldbach Conjecture
Goldbach Conjecture
 
Inmo 2013 test_paper_solution
Inmo 2013 test_paper_solutionInmo 2013 test_paper_solution
Inmo 2013 test_paper_solution
 
Sequence function
Sequence functionSequence function
Sequence function
 

Viewers also liked

Crecimiento de la economía española en el arranque de 2015
Crecimiento de la economía española en el arranque de 2015Crecimiento de la economía española en el arranque de 2015
Crecimiento de la economía española en el arranque de 2015Ivan Bedia García
 
стань для батька нормальним сином03
стань для батька нормальним сином03стань для батька нормальним сином03
стань для батька нормальним сином03vyhrestuk
 
Place RESI 2015: Deborah McLaughlin, Manchester Place
Place RESI 2015: Deborah McLaughlin, Manchester PlacePlace RESI 2015: Deborah McLaughlin, Manchester Place
Place RESI 2015: Deborah McLaughlin, Manchester PlacePlace North West
 
Servidor de mapas en HA con Jboss, Geoserver y PostGIS.
Servidor de mapas en HA con Jboss, Geoserver y PostGIS.Servidor de mapas en HA con Jboss, Geoserver y PostGIS.
Servidor de mapas en HA con Jboss, Geoserver y PostGIS.David Tabernero Pérez
 
Digital Literacy Conference
Digital Literacy ConferenceDigital Literacy Conference
Digital Literacy ConferenceMeg Griffin
 
Jade Stone Massager
Jade Stone MassagerJade Stone Massager
Jade Stone MassagerDr. Dave HM
 
Asia Australia Top 10 Trends 2015
Asia Australia Top 10 Trends 2015Asia Australia Top 10 Trends 2015
Asia Australia Top 10 Trends 2015Roger Hamilton
 
Marketing Digital: Mercado, Tendências e Estratégias
Marketing Digital: Mercado, Tendências e EstratégiasMarketing Digital: Mercado, Tendências e Estratégias
Marketing Digital: Mercado, Tendências e EstratégiasLuiz Henrique Barros Silva
 
methods, techniques and system of costing
methods, techniques and system of costingmethods, techniques and system of costing
methods, techniques and system of costingkunalaggarwal2007
 

Viewers also liked (16)

Crecimiento de la economía española en el arranque de 2015
Crecimiento de la economía española en el arranque de 2015Crecimiento de la economía española en el arranque de 2015
Crecimiento de la economía española en el arranque de 2015
 
Programa2
Programa2 Programa2
Programa2
 
Sol14
Sol14Sol14
Sol14
 
Sol18
Sol18Sol18
Sol18
 
стань для батька нормальним сином03
стань для батька нормальним сином03стань для батька нормальним сином03
стань для батька нормальним сином03
 
Mindmap
MindmapMindmap
Mindmap
 
Sol17
Sol17Sol17
Sol17
 
Corporate governance in psu
Corporate governance in psuCorporate governance in psu
Corporate governance in psu
 
Sol19
Sol19Sol19
Sol19
 
Place RESI 2015: Deborah McLaughlin, Manchester Place
Place RESI 2015: Deborah McLaughlin, Manchester PlacePlace RESI 2015: Deborah McLaughlin, Manchester Place
Place RESI 2015: Deborah McLaughlin, Manchester Place
 
Servidor de mapas en HA con Jboss, Geoserver y PostGIS.
Servidor de mapas en HA con Jboss, Geoserver y PostGIS.Servidor de mapas en HA con Jboss, Geoserver y PostGIS.
Servidor de mapas en HA con Jboss, Geoserver y PostGIS.
 
Digital Literacy Conference
Digital Literacy ConferenceDigital Literacy Conference
Digital Literacy Conference
 
Jade Stone Massager
Jade Stone MassagerJade Stone Massager
Jade Stone Massager
 
Asia Australia Top 10 Trends 2015
Asia Australia Top 10 Trends 2015Asia Australia Top 10 Trends 2015
Asia Australia Top 10 Trends 2015
 
Marketing Digital: Mercado, Tendências e Estratégias
Marketing Digital: Mercado, Tendências e EstratégiasMarketing Digital: Mercado, Tendências e Estratégias
Marketing Digital: Mercado, Tendências e Estratégias
 
methods, techniques and system of costing
methods, techniques and system of costingmethods, techniques and system of costing
methods, techniques and system of costing
 

Similar to Sol16 (20)

Sol60
Sol60Sol60
Sol60
 
Sol60
Sol60Sol60
Sol60
 
Sol66
Sol66Sol66
Sol66
 
Sol18
Sol18Sol18
Sol18
 
Sol80
Sol80Sol80
Sol80
 
Number theory
Number theoryNumber theory
Number theory
 
Olimpiade matematika di kanada 2018
Olimpiade matematika di kanada 2018Olimpiade matematika di kanada 2018
Olimpiade matematika di kanada 2018
 
Sol38
Sol38Sol38
Sol38
 
Sol38
Sol38Sol38
Sol38
 
AJMS_490_23.pdf
AJMS_490_23.pdfAJMS_490_23.pdf
AJMS_490_23.pdf
 
Sol68
Sol68Sol68
Sol68
 
Sol68
Sol68Sol68
Sol68
 
Factorials as sums
Factorials as sumsFactorials as sums
Factorials as sums
 
Sums ADA
Sums ADASums ADA
Sums ADA
 
LPS talk notes
LPS talk notesLPS talk notes
LPS talk notes
 
Ijetr011954
Ijetr011954Ijetr011954
Ijetr011954
 
Sol86
Sol86Sol86
Sol86
 
Sol86
Sol86Sol86
Sol86
 
Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...
Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...
Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...
 
planes and distances
planes and distancesplanes and distances
planes and distances
 

More from eli priyatna laidan

Up ppg daljab latihan soal-pgsd-set-2
Up ppg daljab latihan soal-pgsd-set-2Up ppg daljab latihan soal-pgsd-set-2
Up ppg daljab latihan soal-pgsd-set-2eli priyatna laidan
 
Soal up sosial kepribadian pendidik 5
Soal up sosial kepribadian pendidik 5Soal up sosial kepribadian pendidik 5
Soal up sosial kepribadian pendidik 5eli priyatna laidan
 
Soal up sosial kepribadian pendidik 4
Soal up sosial kepribadian pendidik 4Soal up sosial kepribadian pendidik 4
Soal up sosial kepribadian pendidik 4eli priyatna laidan
 
Soal up sosial kepribadian pendidik 3
Soal up sosial kepribadian pendidik 3Soal up sosial kepribadian pendidik 3
Soal up sosial kepribadian pendidik 3eli priyatna laidan
 
Soal up sosial kepribadian pendidik 2
Soal up sosial kepribadian pendidik 2Soal up sosial kepribadian pendidik 2
Soal up sosial kepribadian pendidik 2eli priyatna laidan
 
Soal up sosial kepribadian pendidik 1
Soal up sosial kepribadian pendidik 1Soal up sosial kepribadian pendidik 1
Soal up sosial kepribadian pendidik 1eli priyatna laidan
 
Soal sospri ukm ulang i 2017 1 (1)
Soal sospri ukm ulang i 2017 1 (1)Soal sospri ukm ulang i 2017 1 (1)
Soal sospri ukm ulang i 2017 1 (1)eli priyatna laidan
 
Soal perkembangan kognitif peserta didik
Soal perkembangan kognitif peserta didikSoal perkembangan kognitif peserta didik
Soal perkembangan kognitif peserta didikeli priyatna laidan
 
Soal latihan utn pedagogik plpg 2017
Soal latihan utn pedagogik plpg 2017Soal latihan utn pedagogik plpg 2017
Soal latihan utn pedagogik plpg 2017eli priyatna laidan
 
Bank soal pedagogik terbaru 175 soal-v2
Bank soal pedagogik terbaru 175 soal-v2Bank soal pedagogik terbaru 175 soal-v2
Bank soal pedagogik terbaru 175 soal-v2eli priyatna laidan
 

More from eli priyatna laidan (20)

Up ppg daljab latihan soal-pgsd-set-2
Up ppg daljab latihan soal-pgsd-set-2Up ppg daljab latihan soal-pgsd-set-2
Up ppg daljab latihan soal-pgsd-set-2
 
Soal utn plus kunci gurusd.net
Soal utn plus kunci gurusd.netSoal utn plus kunci gurusd.net
Soal utn plus kunci gurusd.net
 
Soal up sosial kepribadian pendidik 5
Soal up sosial kepribadian pendidik 5Soal up sosial kepribadian pendidik 5
Soal up sosial kepribadian pendidik 5
 
Soal up sosial kepribadian pendidik 4
Soal up sosial kepribadian pendidik 4Soal up sosial kepribadian pendidik 4
Soal up sosial kepribadian pendidik 4
 
Soal up sosial kepribadian pendidik 3
Soal up sosial kepribadian pendidik 3Soal up sosial kepribadian pendidik 3
Soal up sosial kepribadian pendidik 3
 
Soal up sosial kepribadian pendidik 2
Soal up sosial kepribadian pendidik 2Soal up sosial kepribadian pendidik 2
Soal up sosial kepribadian pendidik 2
 
Soal up sosial kepribadian pendidik 1
Soal up sosial kepribadian pendidik 1Soal up sosial kepribadian pendidik 1
Soal up sosial kepribadian pendidik 1
 
Soal up akmal
Soal up akmalSoal up akmal
Soal up akmal
 
Soal tkp serta kunci jawabannya
Soal tkp serta kunci jawabannyaSoal tkp serta kunci jawabannya
Soal tkp serta kunci jawabannya
 
Soal tes wawasan kebangsaan
Soal tes wawasan kebangsaanSoal tes wawasan kebangsaan
Soal tes wawasan kebangsaan
 
Soal sospri ukm ulang i 2017 1 (1)
Soal sospri ukm ulang i 2017 1 (1)Soal sospri ukm ulang i 2017 1 (1)
Soal sospri ukm ulang i 2017 1 (1)
 
Soal perkembangan kognitif peserta didik
Soal perkembangan kognitif peserta didikSoal perkembangan kognitif peserta didik
Soal perkembangan kognitif peserta didik
 
Soal latihan utn pedagogik plpg 2017
Soal latihan utn pedagogik plpg 2017Soal latihan utn pedagogik plpg 2017
Soal latihan utn pedagogik plpg 2017
 
Rekap soal kompetensi pedagogi
Rekap soal kompetensi pedagogiRekap soal kompetensi pedagogi
Rekap soal kompetensi pedagogi
 
Bank soal pedagogik terbaru 175 soal-v2
Bank soal pedagogik terbaru 175 soal-v2Bank soal pedagogik terbaru 175 soal-v2
Bank soal pedagogik terbaru 175 soal-v2
 
Bank soal ppg
Bank soal ppgBank soal ppg
Bank soal ppg
 
Soal cpns-paket-17
Soal cpns-paket-17Soal cpns-paket-17
Soal cpns-paket-17
 
Soal cpns-paket-14
Soal cpns-paket-14Soal cpns-paket-14
Soal cpns-paket-14
 
Soal cpns-paket-13
Soal cpns-paket-13Soal cpns-paket-13
Soal cpns-paket-13
 
Soal cpns-paket-12
Soal cpns-paket-12Soal cpns-paket-12
Soal cpns-paket-12
 

Recently uploaded

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Recently uploaded (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

Sol16

  • 1. Solution Week 16 (12/30/02) Letters in envelopes First Solution: (This solution is due to Aravi Samuel.) We will use induction on N. Let BN denote the number of “bad” configurations where none of the N letters end up in the correct envelope. We claim that BN+1 = N(BN + BN−1). This can be seen as follows. In proceeding inductively from N to N + 1 letters, there are two possible ways we can generate bad configurations: • Given a bad configuration with N letters, we can create a bad configuration with N + 1 letters by simply placing down the (N + 1)st letter in its envelope, and then trading that letter with any of the other N letters. This provides us with NBN bad configurations. • We can also create a bad configuration with N +1 letters by taking a configu- ration of N letters where exactly one letter is in the correct envelope (there are NBN−1 such configurations) and then trading that letter with the (N + 1)st letter. This provides us with NBN−1 bad configurations. We therefore see that BN+1 = N(BN + BN−1). The probability of obtaining a bad configuration with N letters is PN = BN /N!. Hence, BN = N! PN , and so (N + 1)! PN+1 = N N! PN + (N − 1)! PN−1 =⇒ (N + 1)PN+1 = NPN + PN−1. (1) To solve this recursion relation, we can write it in the more suggestive form, PN+1 − PN = − 1 N + 1 PN − PN−1 . (2) Since P1 = 0 and P2 = 1/2, we have P2 − P1 = 1/2. We then find inductively that Pk − Pk−1 = (−1)k/k! . Therefore, PN = P1 + N k=2 (Pk − Pk−1) = 1 − 1 + N k=2 (−1)k k! = N k=0 (−1)k k! . (3) This is simply the partial series expansion for e−1. So for large N, it approaches 1/e ≈ 37%. This series expansion for 1/e converges very rapidly, so N does not have to be very large for the approximation PN ≈ 1/e to be valid. For example, if N = 5 we have P5 − 1/e ≈ 0.001. Remark: This 1/e result in the large-N limit can also be seen in the following way. The probability that a given letter does not end up in its corresponding envelope is 1 − 1/N. 1
  • 2. Therefore, if we ignore the fact that the placements of the letters are related (they are related because two letters cannot end up in the same envelope), then the probability that no letter ends up in the correct envelope is 1 − 1 N N ≈ 1 e . (4) It is not obvious that the correlations between the letters can be neglected here, but in view of the above result, this is apparently the case. Second Solution: Let PN be the probability that none of the N letters end up in the correct envelope. Let Li and Ei denote the ith letter and corresponding envelope, respectively. Consider a given letter, La1 , and assume that no letter ends up in the correct envelope. Then La1 must end up in some Ea2 , with a2 = a1. La2 will then end up in some Ea3 . La3 will then end up in some Ea4 , and so on. Eventually, one of the envelopes in this chain must be Ea1 . Let it be Ean+1 . We may describe this situation by saying that La1 belongs to a “loop” of length n. If no letter ends up in the correct envelope, then n can be any number from 2 to N. Claim: The probability that the loop containing La1 has length n is equal to 1/N, independent of n. Proof: La1 has an (N − 1)/N probability of ending up in some Ea2 , with a2 = a1. La2 then has an (N − 2)/(N − 1) probability of ending up in some Ea3 , with a3 = a2, a1. This continues until Lan−1 then has an (N − (n − 1))/(N − (n − 2)) probability of ending up in some Ean , with an = an−1, · · · , a2, a1. Finally, Lan has a 1/(N − (n − 1)) probability of ending up in Ean+1 = Ea1 . The probability that La1 belongs to a loop of length n is therefore equal to N − 1 N N − 2 N − 1 · · · N − (n − 1) N − (n − 2) 1 N − (n − 1) = 1 N . (5) Given that a loop of length n is formed, which happens with probability 1/N, the probability that all the N − n other letters end up in the wrong envelopes is simply PN−n. We therefore arrive at the relation, PN = 1 N PN−2 + PN−3 + · · · + P1 + P0 . (6) There is no PN−1 term in this equation, because a loop of length 1 would mean that La1 went into Ea1 . Note that P1 = 0, and that P0 = 1 here. Multiplying eq. (6) through by N, and then subtracting the analogous equation for PN−1 (after multiplying through by N − 1), gives NPN − (N − 1)PN−1 = PN−2 =⇒ PN − PN−1 = − 1 N (PN−1 − PN−2) . (7) This is the same as eq. (2), with N + 1 replaced by N. The solution proceeds as above. 2
  • 3. Third Solution: We will find PN by counting the number of cases that have no letter in the correct envelope, and then dividing this by the total number of possible arrangements, N! . We may count these cases in the following manner. There are N! total com- binations. To count the number that have no letter in the correct envelope, we must subtract from N! the number of combinations with, for example, (at least) L1 in the correct envelope; there are (N − 1)! of these combinations. Likewise for the situations where another letter is in the correct envelope. So there seem to be N! − N(N − 1)! combinations with no letter in the correct envelope. However, we have double-counted some of the cases. For example, a combination which has (at least) L1 and L2 in the correct envelopes has been subtracted twice; there are (N − 2)! of these. Likewise for all the other pairs of letters. So we must add on N 2 (N − 2)! combinations. But now a combination which has (at least) L1, L2, and L3 in the correct envelopes has not been counted at all (because we have subtracted it off three times, and then added it on three times); there are (N − 3)! of these. Likewise for the other triplets. So we must subtract off N 3 (N − 3)! combinations. Now, however, the combinations with (at least) L1, L2, L3, and L4 in the correct envelopes have been counted − 4 1 + 4 2 − 4 3 = −2 times. Likewise for the other quadruplets. So we must add on N 4 (N − 4)! combinations. In general, if we have done this procedure up to (k −1)-tuplets, then a combina- tion having (at least) k letters in the correct envelopes has been counted T times, where T = − k 1 + k 2 − · · · + (−1)k−1 k k − 1 . (8) However, the binomial expansion gives 0 = (1 − 1)k = 1 − k 1 + k 2 + · · · + (−1)k−1 k k − 1 + (−1)k = 1 + T + (−1)k . (9) Therefore, T = −2 for even k, and T = 0 for odd k. So we have either undercounted by one, or overcounted by one. Hence, the total number of combinations having no letter in the correct envelope is N! − N 1 (N − 1)! + N 2 (N − 2)! + · · · = N k=0 (−1)kN! k! . (10) To obtain the probability, PN , that no letter is in the correct envelope, we must divide this result by N! . Therefore, PN = N k=0 (−1)k k! . (11) 3
  • 4. Remarks: 1. What is the probability (call it Pl N ) that exactly l out of the N letters end up in the correct envelopes? (With this notation, P0 N equals the PN from above.) We can find Pl N as follows. The probability that a given set of l letters goes into the correct envelopes is 1/ N(N− 1)(N −2) · · · (N −l + 1) . The probability that the remaining N −l letters all go into the wrong envelopes is P0 N−l. This situation can happen in N l ways. Therefore, Pl N = N l N(N − 1) · · · (N − l + 1) P0 N−l = 1 l! PN−l. (12) Hence, using eq. (3), Pl N = 1 l! N−l k=0 (−1)k k! . (13) For large N, we have Pl N ≈ 1/(l!e). The fact that this falls off so rapidly with l means that we are essentially guaranteed of having just a few letters in the correct envelopes. For example, we find (for large N) that the probability of having four or fewer letters in the correct envelopes is about 99.7%. 2. It is interesting to note that the equality, Pl N = 1 l! PN−l, may directly yield the large-N result, PN ≈ 1/e, without having to go through all the work of the original problem. To see this, note that 1 = N l=0 Pl N = N l=0 1 l! PN−l. (14) Since the terms with small l values dominate this sum, we may (for large N) replace the PN−l values with limM→∞ PM . Hence, 1 ≈ N l=0 1 l! lim M→∞ PM . (15) Therefore, lim M→∞ PM ≈ N l=0 1 l! −1 ≈ 1 e . (16) 3. Let’s check that the Pl N given by eq. (13) do indeed satisfy N l=0 Pl N = 1. This may be done as follows: N l=0 Pl N = N l=0 N−l k=0 1 l! (−1)k k! = N l=0 N s=l 1 l! (−1)s−l (s − l)! (with s = l + k) = N s=0 s l=0 1 l! (−1)s−l (s − l)! (rewriting the limits in the s, l plane) 4
  • 5. = N s=0 1 s! s l=0 s! l!(s − l)! (−1)s−l = N s=0 1 s! (1 − 1)s = 1 (only s = 0 contributes). (17) 4. What is the average number, A, of letters in the correct envelopes? If the setup of the problem is repeated many times, then the average number of times a given letter ends up in the correct envelope is 1/N. Since there are N letters, the average total number of correct envelopes is N(1/N) = 1. You can check that the expression for Pl N in eq. (13) leads to A = 1. For finite N, the sum gets a little messy, but the result in eq. (17) will help simplify things a bit if you want to work it out. For large N, where we have Pl N ≈ 1/(l!e), the sum is easy, and we obtain A = N l=0 lPl N ≈ 1 e N l=1 1 (l − 1)! ≈ 1. (18) 5