Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You have found a treasure chest filled with n > 3 coins. Exactly 2 coins are counterfeit, the rest are genuine. All genuine coins weigh
You have found a treasure chest filled with n > 3 coins. Exactly 2 coins are counterfeit, the rest are genuine. All genuine coins weigh the same and the two counterfeit coins weigh the same, but a counterfeit coin weighs less than a genuine coin. Your task is to separate the genuine coins from the counterfeit coins. To accomplish this you will compare the weight of pairs of subsets of the coins using a balance scale. The outcome of one weighing will determine that each subset of coins weighs the same, or that one or the other subset of coins weighs more. a) Give a precise (not big-Omega) lower bound for the number of weighings required in the worst case to determine which coins are genuine and which are counterfeit for n> 3. Briefly justify. b) Describe an algorithm called FindGenuine to determine the genuine coins when n=4. Use the names C1, C2, C3, C4 for the four coins, and the function Compare Weight ({first_subset; second subset}), which returns 1 if first_subset weighs more, 0 if both subsets weigh the same, and -1 if second subset weighs more. Your function should return the set of genuine coins. Give an exact worst-case analysis of the number of weightings required by your algorithm. For full marks, this should match exactly the lower bound from Part (a). You have found a treasure chest filled with n > 3 coins. Exactly 2 coins are counterfeit, the rest are genuine. All genuine coins weigh the same and the two counterfeit coins weigh the same, but a counterfeit coin weighs less than a genuine coin. Your task is to separate the genuine coins from the counterfeit coins. To accomplish this you will compare the weight of pairs of subsets of the coins using a balance scale. The outcome of one weighing will determine that each subset of coins weighs the same, or that one or the other subset of coins weighs more. a) Give a precise (not big-Omega) lower bound for the number of weighings required in the worst case to determine which coins are genuine and which are counterfeit for n> 3. Briefly justify. b) Describe an algorithm called FindGenuine to determine the genuine coins when n=4. Use the names C1, C2, C3, C4 for the four coins, and the function Compare Weight ({first_subset; second subset}), which returns 1 if first_subset weighs more, 0 if both subsets weigh the same, and -1 if second subset weighs more. Your function should return the set of genuine coins. Give an exact worst-case analysis of the number of weightings required by your algorithm. For full marks, this should match exactly the lower bound from Part (a)
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