Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 5. (20 marks) You have n coins of the same weight, except for special one which is slightly heavier. You want to find out

Problem 5. (20 marks) You have n coins of the same weight, except for "special" one which is slightly heavier. You want to find out this special coin. The only thing you have is a scale on which you can weigh any set of coins against another set of coins.

a. (7 marks) Design an algorithm to nd out which one is the special coin, your algorithm should minimize the number of weighings required until the special coin is found.

b. (7 marks) Prove your algorithm is optimal. That is, if the algorithm that you design makes in the worst-case w weighings, then show that any other algorithm that is guaranteed to find the special coin must also make w or more weighings in the worst-case.

c. (6 marks) Consider the case that the special coin could either be heavier or lighter than the others. That is, you know its weight is different from the others, but whether it is heavier or lighter is unknown. In the worst-case, what is the minimum number of weighings you will need to find the special coin among 12 coins? Describe your algorithm.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions