Question: Below is the psuedo code, I need it in Python, thanks. Given N coins that look identical and should be the same weights. However, one

Below is the psuedo code, I need it in Python, thanks.

Given N coins that look identical and should be the same weights. However, one is a fake coin, which is lighter than the others. Design a recursive algorithm in python to find the fake coin by dividing N coins in three groups and weight them.

Below is the psuedo code, I need it in Python, thanks. Given

INPUT integer n ifn= 1 then the coin is fake else separate the coins into piles of A = ceiling(n/3), B = ceiling(n/3), and C = n-2"ceiling(n/3) weigh A and B if the scale balances then iterate with C else iterate with the lighter of A and B

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!