• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:31
CEST 06:31
KST 13:31
  • 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
Code S RO12 Preview: GuMiho, Bunny, SHIN, ByuN3The Memories We Share - Facing the Final(?) GSL24Code S RO12 Preview: Cure, Zoun, Solar, Creator4[ASL19] Finals Preview: Daunting Task30[ASL19] Ro4 Recap : The Peak15
Community News
Weekly Cups (May 19-25): Hindsight is 20/20?0DreamHack Dallas 2025 - Official Replay Pack8[BSL20] RO20 Group Stage2EWC 2025 Regional Qualifiers (May 28-June 1)19Weekly Cups (May 12-18): Clem sweeps WardiTV May3
StarCraft 2
General
The Memories We Share - Facing the Final(?) GSL Karma, Domino Effect, and how it relates to SC2. How does the number of casters affect your enjoyment of esports? Code S RO12 Preview: GuMiho, Bunny, SHIN, ByuN Can anyone explain to me why u cant veto a matchup
Tourneys
EWC 2025 Regional Qualifiers (May 28-June 1) DreamHack Dallas 2025 Last Chance Qualifiers for OlimoLeague 2024 Winter [GSL 2025] Code S:Season 2 - RO12 - Group B [GSL 2025] Code S:Season 2 - RO12 - Group A
Strategy
Simple Questions Simple Answers [G] PvT Cheese: 13 Gate Proxy Robo
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 475 Hard Target Mutation # 474 Futile Resistance Mutation # 473 Cold is the Void Mutation # 472 Dead Heat
Brood War
General
BW General Discussion Will foreigners ever be able to challenge Koreans? Battle.net is not working Which player typ excels at which race or match up? Practice Partners (Official)
Tourneys
[ASL19] Grand Finals [BSL 2v2] ProLeague Season 3 - Friday 21:00 CET [BSL20] RO20 Group D - Sunday 20:00 CET [BSL20] RO20 Group B - Saturday 20:00 CET
Strategy
[G] How to get started on ladder as a new Z player I am doing this better than progamers do.
Other Games
General Games
Monster Hunter Wilds Path of Exile Nintendo Switch Thread Beyond All Reason Battle Aces/David Kim RTS Megathread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
LiquidLegends to reintegrate into TL.net
Heroes of the Storm
Simple Questions, Simple Answers
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia TL Mafia Community Thread TL Mafia Plays: Diplomacy TL Mafia: Generative Agents Showdown Survivor II: The Amazon
Community
General
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread US Politics Mega-thread All you football fans (soccer)! European Politico-economics QA Mega-thread
Fan Clubs
Serral Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion!
Sports
2024 - 2025 Football Thread NHL Playoffs 2024 Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Cleaning My Mechanical Keyboard How to clean a TTe Thermaltake keyboard?
TL Community
The Automated Ban List TL.net Ten Commandments
Blogs
I was completely wrong ab…
jameswatts
Need Your Help/Advice
Glider
Trip to the Zoo
micronesia
Yes Sir! How Commanding Impr…
TrAiDoS
Poker
Nebuchad
Info SLEgma_12
SLEgma_12
SECOND COMMING
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 14687 users

A challenging riddle/question

Blogs > TadH
Post a Reply
1 2 3 Next All
TadH
Profile Blog Joined February 2010
Canada1846 Posts
March 29 2011 15:39 GMT
#1
This is NOT for school or anything like that, I simply found it online and want to know if anyone here can solve it.

I have not solved it yet.


Ponder This Challenge:

A spaceship has 100,000 bits of storage, and one of these bits is known to be faulty. You can locate the faulty bit using agents that run on any given subset of bits and return "OK" if all of the bits are good and die if they encounter the faulty bit. It takes an agent one hour to run a query, regardless of the size of the subset, but an infinite number of agents can run simultaneously. You need to find the wrong bit in two hours.

Since we must decide, in advance, how many agents to send with the spaceship, we are interested in the following questions:

A. What is the minimal number of agents needed? (Bonus question: Find a formula for the number of agents needed for n bits and t hours).

B. Suppose we want to send enough agents to be able to repeat the same task a second time with the remaining agents (i.e., those who did not die during the first invocation). How many agents are needed in that scenario?

Bonus question: Part A would require the same number of agents even if we increased the number of bits in the question by no more than X. What is this X and what is the connection between it and a recent event in IBM's history?

Different agents can access the same memory bit at the same time.

*****
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
Last Edited: 2011-03-29 15:51:41
March 29 2011 15:47 GMT
#2
my guess is you need log_2(100000) which is 16.6, so you need 17 agents. This stems from each agent effectively enabling you to sort out half of all remaining bits.

To do this a second time, well best case none of the initial ones died, so you still need only 17, but worst case they all died, so you'd need 34 to be safe.

X would be 31072. no clue what IBM has to do with that number though.^^


/edit: yay solving this riddle enabled me to procrastinate learning for my exam tomorrow long enough for my video download to finish, so i can procrastinate another 45 minutes :D thanks! xD

/secondedit: and i completely ignored the time constraints, sorry.. nvm this post i guess -.-
Gold isn't everything in life... you need wood, too!
TadH
Profile Blog Joined February 2010
Canada1846 Posts
March 29 2011 15:50 GMT
#3
Anything to help!
THE_DOMINATOR
Profile Blog Joined April 2010
United States309 Posts
March 29 2011 15:55 GMT
#4
Hamming codes derp de der http://en.wikipedia.org/wiki/Hamming_code
MisterD is right you need 17 placed at each power of 2
DOMINATION
Sayle
Profile Joined October 2010
United Kingdom3685 Posts
March 29 2011 15:56 GMT
#5
On March 30 2011 00:47 MisterD wrote:
my guess is you need log_2(100000) which is 16.6, so you need 17 agents. This stems from each agent effectively enabling you to sort out half of all remaining bits.

To do this a second time, well best case none of the initial ones died, so you still need only 17, but worst case they all died, so you'd need 34 to be safe.

X would be 31072. no clue what IBM has to do with that number though.^^


/edit: yay solving this riddle enabled me to procrastinate learning for my exam tomorrow long enough for my video download to finish, so i can procrastinate another 45 minutes :D thanks! xD

/secondedit: and i completely ignored the time constraints, sorry.. nvm this post i guess -.-


That would only work if you had an infinite amount of time. You only have 2 hours and an agent takes 1 hour to run a query, so you only have enough time for 2 iterations, so the binary search won't work.

You definetely don't need 34 to be safe (assuming 17 was the correct number to begin with). That would make the riddle pointlessly trivial. Basically, you are guaranteed that not all agents will die from the search. You need to figure out how many are guaranteed to live.

How did you get 31072?
TadH
Profile Blog Joined February 2010
Canada1846 Posts
March 29 2011 15:59 GMT
#6
And also it's not guaranteed that each agent will go to a different bit, they could all take the same path (theoretically) That's what's messing me up.
Scorch
Profile Blog Joined March 2008
Austria3371 Posts
Last Edited: 2011-03-29 16:19:27
March 29 2011 16:04 GMT
#7
My approach:
+ Show Spoiler +
Arrange bits in a table of dimensions sqrt(100000) x sqrt(100000). Have an agent work on each line and on each column, that's 2*sqrt(100000) ~ 632 agents. The two agents which do not return OK will yield the coordinates of the faulty bit. The result is calculated in one hour, the second hour isn't even needed.
If you want to be very exact, 100000 doesn't have an integer as its square root, so the table doesn't cover all bits or contains some blanks. In the unlikely case that the faulty bit is among those few leftovers, use the second hour to run agents on the remaining few bits to find the solution.

Probably not an optimal solution, but not too bad for a quick naive approach.

Edit: decreased number of agents, but 2 hours required:
+ Show Spoiler +
Again, separate the bits into sqrt(100000) groups with an agent working on each subset. After one hour, you know that the bit is among one of the groups of sqrt(100000) bits. In the second hour, use the method in the first spoiler to find the faulty bit in this smaller subset. Agents used: sqrt(100000) for the first hour plus 2*(sqrt(sqrt(100000)) for the second hour. That's ~352 agents.


Yet another edit:
I don't know why I didn't think of this before. I used 2 dimensions for my approach. Of course you can use any number of dimensions. The question is what's the optimal number of dimensions for a given number of bits. I don't want to try to solve that question now though.
THE_DOMINATOR
Profile Blog Joined April 2010
United States309 Posts
Last Edited: 2011-03-29 16:10:40
March 29 2011 16:05 GMT
#8
you still only need 17...no "queries" are even needed. All the agents have to do is run to their own subset and write down if each bit is a 0 or 1. Then they all meet up at the crew quarters(they can all go at once simultaneously) create the syndrome bits and compare.
DOMINATION
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
Last Edited: 2011-03-29 16:07:45
March 29 2011 16:05 GMT
#9
On March 30 2011 00:56 Sayle wrote:
Show nested quote +
On March 30 2011 00:47 MisterD wrote:
my guess is you need log_2(100000) which is 16.6, so you need 17 agents. This stems from each agent effectively enabling you to sort out half of all remaining bits.

To do this a second time, well best case none of the initial ones died, so you still need only 17, but worst case they all died, so you'd need 34 to be safe.

X would be 31072. no clue what IBM has to do with that number though.^^


/edit: yay solving this riddle enabled me to procrastinate learning for my exam tomorrow long enough for my video download to finish, so i can procrastinate another 45 minutes :D thanks! xD

/secondedit: and i completely ignored the time constraints, sorry.. nvm this post i guess -.-


That would only work if you had an infinite amount of time. You only have 2 hours and an agent takes 1 hour to run a query, so you only have enough time for 2 iterations, so the binary search won't work.

You definetely don't need 34 to be safe (assuming 17 was the correct number to begin with). That would make the riddle pointlessly trivial. Basically, you are guaranteed that not all agents will die from the search. You need to figure out how many are guaranteed to live.

How did you get 31072?


2^17 - 100000 = 131072 - 100000 = 31072

and yeah if you don't run a complete binary search but use more agents so you can do the whole task in 2 hours, some will be guaranteed to stay alive. But if you do a full binary search, well you don't meet the time constraint, but in worst case, you'd kill your agent on every half you test, down till the last two bits where you let him test the wrong one and even that one dies. In that case, you really would need the double amount.


also the guy above me is right: you can let all agents start at once, the first checks half the grid, the second checks the first and third quarter, the third checks every uneven eigth part of all the bits, and in the end you can determine the faulty bit depending on which agent is still alive after one hour.

however, having two hours time, you could try to find a way to use up less agents by using those that survived a second time. That could enable you to need less agents.
Gold isn't everything in life... you need wood, too!
Sayle
Profile Joined October 2010
United Kingdom3685 Posts
Last Edited: 2011-03-29 16:09:10
March 29 2011 16:08 GMT
#10
@Scorch: Yes, that method is a quick solution but not optimal. The bonus question pretty much shows that that's not the 'right' answer since in that method, any increase in the number of bits (beyond some tiny fraction due to non-integer roots) would require more agents.
Hynda
Profile Blog Joined June 2010
Sweden2226 Posts
Last Edited: 2011-03-29 16:15:12
March 29 2011 16:13 GMT
#11

If the thing was a square, or a cube this is what I would do, if it was a square all you need to do is send everyone in a line on both sides note down the ones missing and you have your coordinates for a 100.000 unit square you would need 317 or so if it was cubical you would only need 94. Silly me I was imagining a pirateship storage and a James Bond agent... I'm still 8 years old it seems.
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
March 29 2011 16:15 GMT
#12
On March 30 2011 01:04 Scorch wrote:
My approach:
+ Show Spoiler +
Arrange bits in a table of dimensions sqrt(100000) x sqrt(100000). Have an agent work on each line and on each column, that's 2*sqrt(100000) ~ 632 agents. The two agents which do not return OK will yield the coordinates of the faulty bit. The result is calculated in one hour, the second hour isn't even needed.
If you want to be very exact, 100000 doesn't have an integer as its square root, so the table doesn't cover all bits or contains some blanks. In the unlikely case that the faulty bit is among those few leftovers, use the second hour to run agents on the remaining few bits to find the solution.

Probably not an optimal solution, but not too bad for a quick naive approach.


to use the 2nd hour efficiently, you can just evolve this process, by giving every agent 18 lines (thats about the 4th root of 100000) or 18 columns in the 1st hour.
Leaves you with an 18x18 block, where the faulty block is. Now repeat the game in 2nd hour again with your approach.

Brings us down to 36+2 = 38 Agents. (plus 2 because 2 die in the first hour)
General solution by this aproach would be for x bits in h hours.

n = x ^ -(2^h) + 2(h-1) (rounded up)
THE_DOMINATOR
Profile Blog Joined April 2010
United States309 Posts
March 29 2011 16:16 GMT
#13
...No one looked at the link I posted.... The first guy checks every other bit the second guy checks every other 2 bits then 2 bits the third guy checks every other 3 bits then 3 bits etc...
When they meet back in the control room they each calculate whether the number of ones they encountered is odd or even. This creates the syndrome bit which they then can compare to the original syndrome bit that was calculated on earth before they left. The OR operation on the two syndrome bits gives the position of the faulty bit.
DOMINATION
Sayle
Profile Joined October 2010
United Kingdom3685 Posts
March 29 2011 16:20 GMT
#14
Why would the bonus question ask what the formula was in terms of both bits and hours then. If your solution is correct, dominator, then the number of hours is irrelevant.
THE_DOMINATOR
Profile Blog Joined April 2010
United States309 Posts
Last Edited: 2011-03-29 16:26:12
March 29 2011 16:23 GMT
#15
Indeed they are :p the total number of hours with my solution would be 1 or however long it takes for the agents to make a single pass like this. My guess is that the creator of the puzzle wasn't very familiar with computer architecture.
DOMINATION
Sayle
Profile Joined October 2010
United Kingdom3685 Posts
March 29 2011 16:33 GMT
#16
http://domino.watson.ibm.com/Comm/wwwr_ponder.nsf/challenges/March2011.html

Clearly, IBM is not at all familiar with computer architecture.
heishe
Profile Blog Joined June 2009
Germany2284 Posts
March 29 2011 16:41 GMT
#17
I don't get it. Can't you just let one agent search a subset of 100000 bits and wait one hour to get the result?
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
TheAura
Profile Joined November 2010
96 Posts
March 29 2011 16:43 GMT
#18
no he will just die, and all you will know is that one of those 100000 bits is bad, which we already know. The agent will only tell you if the bad bit is in the subset he is searching(by dying or not), but not where in that subset.
TadH
Profile Blog Joined February 2010
Canada1846 Posts
March 29 2011 16:43 GMT
#19
On March 30 2011 01:33 Sayle wrote:
http://domino.watson.ibm.com/Comm/wwwr_ponder.nsf/challenges/March2011.html

Clearly, IBM is not at all familiar with computer architecture.


What makes you say that?

And yes that is where I got it from, I'm going to try and keep up with these monthly quizzes, they seem fun.
blankspace
Profile Blog Joined June 2010
United States292 Posts
March 29 2011 16:50 GMT
#20
I think the hamming code link the_dominator posted is the fastest in general (or maybe variations of it). With that method it would take 17 agents in one hour. I'm not sure how to use the two hours though.

This is definitely not the intended way but it's another method to do it with fairly few agents.

Let us label the bits 1-100,000.
Send one agent to labels 0 mod 2,
One agent to 0 mod 3, another to 1 mod 3, etc.

mod 2 uses 1
mod 3 uses 2
mod 5 uses 4
mod 7 uses 6
mod 11 uses 10
mod 13 uses 12.

In the first set, we use 35 agents to get (using the chinese remainder theorem) the unique mod
of the error bit mod 30,300 (which is 2x3x5x7x11x13). Then in the second hour we need at most 3 more agents to get the error bit.

This is not as good as the hamming code though. The "price" of dividing 100,000 by p is p-1 agents while the price of dividing by two is only one agent in the other method.
Hello friends
1 2 3 Next All
Please log in or register to reply.
Live Events Refresh
Road to EWC
22:00
Americas Closed Qualifiers
EnkiAlexander 111
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nina 208
CosmosSc2 115
StarCraft: Brood War
PianO 362
Aegong 65
Mind 48
Jaeyun 31
Shinee 22
Bale 7
Dota 2
LuMiX1
League of Legends
JimRising 785
Counter-Strike
Stewie2K931
Heroes of the Storm
Khaldor128
Other Games
summit1g8072
FrodaN5541
WinterStarcraft484
C9.Mang0429
ViBE237
RuFF_SC293
Mew2King88
Has30
PPMD25
Organizations
Other Games
gamesdonequick1086
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Azhi_Dahaki40
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1183
• Stunt467
Upcoming Events
Road to EWC
4h 29m
Road to EWC
11h 29m
BSL Season 20
13h 29m
Sziky vs Razz
Sziky vs StRyKeR
Sziky vs DragOn
Sziky vs Tech
Razz vs StRyKeR
Razz vs DragOn
Razz vs Tech
DragOn vs Tech
Online Event
23h 29m
Clem vs ShoWTimE
herO vs MaxPax
Road to EWC
1d 4h
Road to EWC
1d 11h
BSL Season 20
1d 13h
Bonyth vs Doodle
Bonyth vs izu
Bonyth vs MadiNho
Bonyth vs TerrOr
MadiNho vs TerrOr
Doodle vs izu
Doodle vs MadiNho
Doodle vs TerrOr
Replay Cast
2 days
Replay Cast
3 days
The PondCast
5 days
[ Show More ]
Replay Cast
5 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2025-05-28
DreamHack Dallas 2025
Calamity Stars S2

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
KCM Race Survival 2025 Season 2
NPSL S3
Rose Open S1
CSL Season 17: Qualifier 1
2025 GSL S2
Heroes 10 EU
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
ECL Season 49: Europe
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025
PGL Bucharest 2025
BLAST Open Spring 2025

Upcoming

CSL Season 17: Qualifier 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
CSLPRO Last Chance 2025
CSLAN 2025
K-Championship
SEL Season 2 Championship
Esports World Cup 2025
HSC XXVII
Championship of Russia 2025
Bellum Gens Elite Stara Zagora 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 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.