Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago