Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 4. Suppose you are given a set of small boxes, numbered 1 to n, identical in every aspect except that each of the first
Problem 4. Suppose you are given a set of small boxes, numbered 1 to n, identical in every aspect except that each of the first i contains a pearl whereas the remaining n i are empty. You can have two magic wands that can each test if a box is empty or not in a single touch, except that a wand disappears if you test it on a box that is empty. Show that, without knowing the value of i, you can use the two wands to determine all the boxes containing pearls using at most no more than 2 wand touches. Hint: For a suitable parameter k that you choose consider using one wand on boxes 1, k, 2k, 3k, find the value i where the empty box is among (1-1)k+1, ik. Then use the second wand sequentially from (i 1)k +1 to ik 1 to the empty box. The total number of touches will be at most: n/k +k
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started