• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:18
CET 02:18
KST 10:18
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL20] Finals Preview: Arrival10TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9
Community News
Merivale 8 Open - LAN - Stellar Fest3Chinese SC2 server to reopen; live all-star event in Hangzhou22Weekly Cups (Oct 13-19): Clem Goes for Four3BSL Team A vs Koreans - Sat-Sun 16:00 CET10Weekly Cups (Oct 6-12): Four star herO8
StarCraft 2
General
Could we add "Avoid Matchup" Feature for rankgame RotterdaM "Serral is the GOAT, and it's not close" Chinese SC2 server to reopen; live all-star event in Hangzhou The New Patch Killed Mech! Weekly Cups (Oct 13-19): Clem Goes for Four
Tourneys
Crank Gathers Season 2: SC II Pro Teams Merivale 8 Open - LAN - Stellar Fest $5,000+ WardiTV 2025 Championship $3,500 WardiTV Korean Royale S4 Tenacious Turtle Tussle
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment
Brood War
General
ASL Runner-Up Race Stats ASL20 Pre-season Tier List ranking! [ASL20] Finals Preview: Arrival Is there anyway to get a private coach? BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[ASL20] Grand Finals ASL final tickets help [ASL20] Semifinal A Small VOD Thread 2.0
Strategy
Soma's 9 hatch build from ASL Game 2 Simple Questions, Simple Answers Roaring Currents ASL final Relatively freeroll strategies
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile General RTS Discussion Thread Nintendo Switch Thread Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread YouTube Thread The Chess Thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Korean Music Discussion Series you have seen recently... Movie Discussion!
Sports
Formula 1 Discussion 2024 - 2026 Football Thread MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
The Benefits Of Limited Comm…
TrAiDoS
Sabrina was soooo lame on S…
Peanutsc
Our Last Hope in th…
KrillinFromwales
Certified Crazy
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1450 users

Difficult Math Puzzle !

Blogs > kdog3683
Post a Reply
1 2 Next All
kdog3683
Profile Blog Joined January 2007
United States916 Posts
May 14 2009 19:01 GMT
#1
A man buys two boxes of matches and puts them in his pocket. Every time he has to light a match, he selects at random one box or the other. After some time, he takes one of the boxes from his pocket, and finds it is empty (after absentmindedly placing the box back in his pocket after using the last match). Supposing that each box originally had n matches, what is the probability that there are now k matches in the other box? (Here, 0 ≤ k ≤ n.)

*
Multiply your efforts.
Muirhead
Profile Blog Joined October 2007
United States556 Posts
Last Edited: 2009-05-14 19:24:08
May 14 2009 19:08 GMT
#2
+ Show Spoiler +
2*(2n-k-1 C n-1)*(1/2)^(2n-k)

From the first 2n-k-1 matches pulled, you must choose which n-1 are pulled from the box that first runs out.
starleague.mit.edu
Fontong
Profile Blog Joined December 2007
United States6454 Posts
May 14 2009 19:12 GMT
#3
I'm assuming Difficult Math Puzzle = Homework Problem that you need help solving?
[SECRET FONT] "Dragoon bunker"
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2009-05-14 19:12:45
May 14 2009 19:12 GMT
#4
lol math is confusing!
im curious how this will be answered
it seems like it might be easier than a couple of the other ones lately, tho
Jonoman92
Profile Blog Joined September 2006
United States9104 Posts
May 14 2009 19:27 GMT
#5
Yea I'd like to see the solution and hear the logic but I'm not quite sure how to do it myself.
naonao
Profile Blog Joined November 2008
United States847 Posts
May 14 2009 19:47 GMT
#6
+ Show Spoiler +
1-(1/2)^n
since having k<n only means that at least 1 match was pulled out of the other box. Then (1/2)^n is the probability that all of the matches were pulled from one box, which is the only possible way for k >= n. So you subtract it from 1 to find the probability of k<n
Pliers
Profile Joined October 2008
Canada42 Posts
Last Edited: 2009-05-14 19:50:05
May 14 2009 19:49 GMT
#7
On May 15 2009 04:08 Muirhead wrote:
+ Show Spoiler +
2*(2n-k-1 C n-1)*(1/2)^(2n-k)

From the first 2n-k-1 matches pulled, you must choose which n-1 are pulled from the box that first runs out.


Not sure If I agree with you. (1/2)^(2n-k) I think you're assuming that for every match drawn till 2n-k you would have 1/2 probability for the matches in either box however when a match is drawn it is not replaced therefore the probability changes. Not sure how you have (2n-k-1 C n-1) since the OP asked what the probability of the box having k matches left when the other box is empty.

My logic is one box must run out therefore there is 2 choose 1 boxes and n choose n matches for one of the boxes and n choose n-k for the other. While the total probably is 2n choose 2n-k giving:

[2*1*(n C n-k)]/(2n C 2n-k)
Muirhead
Profile Blog Joined October 2007
United States556 Posts
May 14 2009 19:51 GMT
#8
Yes the question depends on if matches are selected at random or boxes are selected at random. I assume from his wording that he meant the latter.
starleague.mit.edu
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
Last Edited: 2009-05-14 19:55:09
May 14 2009 19:52 GMT
#9
On May 15 2009 04:08 Muirhead wrote:
+ Show Spoiler +
2*(2n-k-1 C n-1)*(1/2)^(2n-k)

From the first 2n-k-1 matches pulled, you must choose which n-1 are pulled from the box that first runs out.

+ Show Spoiler +
Where do you get that initial factor of 2 from, and why choosing n-1? Shouldn't you be choosing which n come from the empty box, since if I read the question right, he doesn't know exactly when he emptied it? I feel like it should just be (2n-k C n) * .5^(2n-k)

Edit: Oh, the 2 comes from the fact that he could be pulling either box to find empty I guess?
Muirhead
Profile Blog Joined October 2007
United States556 Posts
May 14 2009 19:56 GMT
#10
On May 15 2009 04:52 Macavenger wrote:
Show nested quote +
On May 15 2009 04:08 Muirhead wrote:
+ Show Spoiler +
2*(2n-k-1 C n-1)*(1/2)^(2n-k)

From the first 2n-k-1 matches pulled, you must choose which n-1 are pulled from the box that first runs out.

+ Show Spoiler +
Where do you get that initial factor of 2 from, and why choosing n-1? Shouldn't you be choosing which n come from the empty box, since if I read the question right, he doesn't know exactly when he emptied it? I feel like it should just be (2n-k C n) * .5^(2n-k)



+ Show Spoiler +
The factor of 2 comes from the fact that there are two boxes. The n-1 comes from the fact that the box of the (2n-k)th match is fixed.
starleague.mit.edu
Pliers
Profile Joined October 2008
Canada42 Posts
May 14 2009 20:05 GMT
#11
On May 15 2009 04:56 Muirhead wrote:
Show nested quote +
On May 15 2009 04:52 Macavenger wrote:
On May 15 2009 04:08 Muirhead wrote:
+ Show Spoiler +
2*(2n-k-1 C n-1)*(1/2)^(2n-k)

From the first 2n-k-1 matches pulled, you must choose which n-1 are pulled from the box that first runs out.

+ Show Spoiler +
Where do you get that initial factor of 2 from, and why choosing n-1? Shouldn't you be choosing which n come from the empty box, since if I read the question right, he doesn't know exactly when he emptied it? I feel like it should just be (2n-k C n) * .5^(2n-k)



The factor of 2 comes from the fact that there are two boxes. The n-1 comes from the fact that the box of the (2n-k)th match is fixed.


How is it fixed if it wasn't specified which box he drew it from? All we know is that once he drew the 2n-kth match one of the boxes is empty.
Muirhead
Profile Blog Joined October 2007
United States556 Posts
May 14 2009 20:06 GMT
#12
Just work out some small cases like n=3, k=2 and you'll see what I mean
starleague.mit.edu
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
May 14 2009 20:11 GMT
#13
On May 15 2009 04:56 Muirhead wrote:
Show nested quote +
On May 15 2009 04:52 Macavenger wrote:
On May 15 2009 04:08 Muirhead wrote:
+ Show Spoiler +
2*(2n-k-1 C n-1)*(1/2)^(2n-k)

From the first 2n-k-1 matches pulled, you must choose which n-1 are pulled from the box that first runs out.

+ Show Spoiler +
Where do you get that initial factor of 2 from, and why choosing n-1? Shouldn't you be choosing which n come from the empty box, since if I read the question right, he doesn't know exactly when he emptied it? I feel like it should just be (2n-k C n) * .5^(2n-k)



+ Show Spoiler +
The factor of 2 comes from the fact that there are two boxes. The n-1 comes from the fact that the box of the (2n-k)th match is fixed.

+ Show Spoiler +
I don't see how the (2n-k)th match is fixed according to the problem statement, though. The way I read it, he pulls a box out (I assume when he needs another match) and finds it was already empty; that the last match must have come from that box is not specified. For all we know, he could have just emptied it, or he could have emptied it 2 draws ago, or he could have pulled the first n matches from that box and then the remaining n-k from the second before discovering the first was empty. Thus, we should be able to choose any n of the 2n-k matches as coming from that box, no?
Pliers
Profile Joined October 2008
Canada42 Posts
May 14 2009 20:26 GMT
#14
On May 15 2009 05:06 Muirhead wrote:
Just work out some small cases like n=3, k=2 and you'll see what I mean


No I don't see what you mean and you should read my response to your logic like I did yours. Either prove me wrong or defend your logic; simple.

Having said that, can we focus on the correct solution to this problem now?
qrs
Profile Blog Joined December 2007
United States3637 Posts
Last Edited: 2009-05-14 21:15:12
May 14 2009 20:42 GMT
#15
Didn't look at the other answers yet, so I'm probably duplicating something that someone has said.
+ Show Spoiler +
Let's call the matchboxes Head and Tail and count the number of ways to make n selections from each box. That would be (2n)!(/n!n!).

Now let's count the number of ways to make n selections from each box, where the last k selections are all "heads". That's easy: we just remove k heads from the scenario, and one "tail" (for the last match picked from Tail) and count how many ways there are to arrange the remainder. That would be (n-k + n-1)!/(n-k)!(n-1)! By symmetry, it's the same number for the case where the last k are tails.

So dividing the number of cases we are looking for by the number of possible cases, we get the probability:

2*[(2n - k - 1)! * n! * n! ]/ [2n! * (n - k)! * (n-1)!]

We can simplify that a little bit, at least:

2*[(2n - k - 1)! * n! * (n-1)]/ [2n! * (n - k)!]

I don't know if there is a way to simplify it further.

PS: the formula breaks down when k = 0. That's the only case where the specification "first box to empty" makes a difference. In every other case, we guarantee that the box we are looking at empties first by making k of its matches the last to be chosen, but when k=0, of course, that doesn't work. For that case, I'll have to just specify separately that f(0) = 0, since there is no way to finish both boxes at the same time while picking one match at a time. I wonder if anyone's formula was general enough to encompass that case.

Muirhead, your answer is (partly) wrong on a technicality...
'As per the American Heart Association, the beat of the Bee Gees song "Stayin' Alive" provides an ideal rhythm in terms of beats per minute to use for hands-only CPR. One can also hum Queen's "Another One Bites The Dust".' —Wikipedia
aznmathfreak
Profile Joined March 2009
United States148 Posts
Last Edited: 2009-05-14 21:07:24
May 14 2009 20:54 GMT
#16
The person had to have picked 2n-k+1 times. n times from the empty box of matches and n-k times from the box of matches with k matches left, and the +1 is from the last time the person picks and ends up picking out the empty box.

Assuming that either box has equal chance of being picked. Each time he picks, he has a 1/2 chance of picking a certain box, either box A or box B. Let's ignore the order that he picks for a second. He has to pick box A n+1 times and box B n-k times. Each one's odd of being picked is 1/2. Therefore, the chance of him picking that is (1/2)^(n+1) x (1/2)^(n-k), or... (1/2)^(2n-k+1).

Now, if we factor in the order. Since it doesn't matter which order the matches are picked, so long as the last pick was the empty box, we can think of it as out of 2n-k picks, we have to pick n of which are from box A. So it's a combination of 2n-k picks, n of which has to be from box A. There are (2n-k C n) ways to pick it.

Therefore the solution is
(2n-k C n) x (1/2)^(2n-k+1)

Edit: If you switch box A and box B, you have another set of symmetrical cases that would also satisfy the conditions,

So there is a factor of 2 like Muir suggested earlier.

2(2n-k C n) x (1/2)^(2n-k+1) or (2n-k C n) x (1/2)^(2n-k)
qrs
Profile Blog Joined December 2007
United States3637 Posts
Last Edited: 2009-05-14 20:58:51
May 14 2009 20:58 GMT
#17
On May 15 2009 05:11 Macavenger wrote:
+ Show Spoiler +
The way I read it, he pulls a box out (I assume when he needs another match) and finds it was already empty; that the last match must have come from that box is not specified. For all we know, he could have just emptied it, or he could have emptied it 2 draws ago, or he could have pulled the first n matches from that box and then the remaining n-k from the second before discovering the first was empty. Thus, we should be able to choose any n of the 2n-k matches as coming from that box, no?
Ah, that's an interesting point, but unless we assigned some kind of probability function to his absent-mindedness, it would not be possible to give an answer for that case, so since the question was posed as a puzzle, it's probably fair to assume that he discovers that the box is empty as soon as he tries to pull a match from it (or at any rate when his pipe refuses to light).
'As per the American Heart Association, the beat of the Bee Gees song "Stayin' Alive" provides an ideal rhythm in terms of beats per minute to use for hands-only CPR. One can also hum Queen's "Another One Bites The Dust".' —Wikipedia
qrs
Profile Blog Joined December 2007
United States3637 Posts
Last Edited: 2009-05-14 21:49:01
May 14 2009 20:59 GMT
#18
On May 15 2009 05:05 Pliers wrote:
Show nested quote +
On May 15 2009 04:56 Muirhead wrote:
On May 15 2009 04:52 Macavenger wrote:
On May 15 2009 04:08 Muirhead wrote:
+ Show Spoiler +
2*(2n-k-1 C n-1)*(1/2)^(2n-k)

From the first 2n-k-1 matches pulled, you must choose which n-1 are pulled from the box that first runs out.

+ Show Spoiler +
Where do you get that initial factor of 2 from, and why choosing n-1? Shouldn't you be choosing which n come from the empty box, since if I read the question right, he doesn't know exactly when he emptied it? I feel like it should just be (2n-k C n) * .5^(2n-k)



The factor of 2 comes from the fact that there are two boxes. The n-1 comes from the fact that the box of the (2n-k)th match is fixed.


How is it fixed if it wasn't specified which box he drew it from? All we know is that once he drew the 2n-kth match one of the boxes is empty.

and not before
You are right. I was wrong.
'As per the American Heart Association, the beat of the Bee Gees song "Stayin' Alive" provides an ideal rhythm in terms of beats per minute to use for hands-only CPR. One can also hum Queen's "Another One Bites The Dust".' —Wikipedia
Muirhead
Profile Blog Joined October 2007
United States556 Posts
Last Edited: 2009-05-14 21:30:32
May 14 2009 21:28 GMT
#19
qrs I don't understand what's wrong (except in case k=0 which doesn't make any sense anyways)
The only thing I can see different about your solution is the denominator [2n! * (n - k)! * (n-1)!], but I don't understand this denominator and why it shouldn't just be 1/2^(2n-k) since he has a 50% chance of picking H or T each time.

I still like my solution except when k=0 and it seems to agree with brute force checking of small cases
starleague.mit.edu
qrs
Profile Blog Joined December 2007
United States3637 Posts
Last Edited: 2009-05-14 21:48:12
May 14 2009 21:32 GMT
#20
On May 15 2009 04:08 Muirhead wrote:
+ Show Spoiler +
2*(2n-k-1 C n-1)*(1/2)^(2n-k)

From the first 2n-k-1 matches pulled, you must choose which n-1 are pulled from the box that first runs out.
On May 15 2009 05:54 aznmathfreak wrote:+ Show Spoiler +

The person had to have picked 2n-k+1 times. n times from the empty box of matches and n-k times from the box of matches with k matches left, and the +1 is from the last time the person picks and ends up picking out the empty box.

Assuming that either box has equal chance of being picked. Each time he picks, he has a 1/2 chance of picking a certain box, either box A or box B. Let's ignore the order that he picks for a second. He has to pick box A n+1 times and box B n-k times. Each one's odd of being picked is 1/2. Therefore, the chance of him picking that is (1/2)^(n+1) x (1/2)^(n-k), or... (1/2)^(2n-k+1).

Now, if we factor in the order. Since it doesn't matter which order the matches are picked, so long as the last pick was the empty box, we can think of it as out of 2n-k picks, we have to pick n of which are from box A. So it's a combination of 2n-k picks, n of which has to be from box A. There are (2n-k C n) ways to pick it.

Therefore the solution is
(2n-k C n) x (1/2)^(2n-k+1)

Edit: If you switch box A and box B, you have another set of symmetrical cases that would also satisfy the conditions,

So there is a factor of 2 like Muir suggested earlier.

2(2n-k C n) x (1/2)^(2n-k+1) or (2n-k C n) x (1/2)^(2n-k)

Interesting, the logic of each of you seems compelling, yet you give different answers. I'm trying to decide which is wrong...

Edit: OK, azn is right. Muirhead and I both overlooked the significance of "(after absentmindedly placing the box back in his pocket after using the last match)"
'As per the American Heart Association, the beat of the Bee Gees song "Stayin' Alive" provides an ideal rhythm in terms of beats per minute to use for hands-only CPR. One can also hum Queen's "Another One Bites The Dust".' —Wikipedia
1 2 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 10h 42m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft505
Nina 39
Livibee 32
StarCraft: Brood War
Artosis 779
NaDa 25
Dota 2
monkeys_forever495
XaKoH 366
NeuroSwarm60
LuMiX0
Counter-Strike
Stewie2K487
Super Smash Bros
AZ_Axe248
Mew2King93
Heroes of the Storm
Khaldor178
Other Games
summit1g8474
FrodaN4208
Grubby2453
JimRising 388
Skadoodle204
Maynarde143
ViBE122
KnowMe108
Organizations
Other Games
gamesdonequick1185
BasetradeTV33
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• Berry_CruncH89
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21271
League of Legends
• Doublelift4656
Upcoming Events
Wardi Open
10h 42m
CrankTV Team League
11h 42m
Streamerzone vs Shopify Rebellion
TBD vs Team Vitality
Monday Night Weeklies
15h 42m
Replay Cast
1d 8h
WardiTV Invitational
1d 10h
CrankTV Team League
1d 11h
BASILISK vs TBD
Team Liquid vs Team Falcon
Replay Cast
2 days
CrankTV Team League
2 days
Replay Cast
2 days
The PondCast
3 days
[ Show More ]
CrankTV Team League
3 days
Replay Cast
4 days
WardiTV Invitational
4 days
CrankTV Team League
4 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

ASL Season 20
WardiTV TLMC #15
Eternal Conflict S1

Ongoing

BSL 21 Points
CSL 2025 AUTUMN (S18)
BSL 21 Team A
C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
CranK Gathers Season 2: SC II Pro Teams
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025

Upcoming

SC4ALL: Brood War
YSL S2
BSL Season 21
SLON Tour Season 2
BSL 21 Non-Korean Championship
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
META Madness #9
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.