27-Jul-2021 21:48:39
counterfeit_detection_test():
MATLAB/Octave version 9.9.0.1467703 (R2020b).
Test counterfeit_detection().
counterfeit_detection_brute_test
MATLAB version
Test counterfeit_detection_brute,
which seeks to identify multiple counterfeit coins among n coins
using brute force.
There were 9 fakes; the function found 9 suspects.
Indices of fakes:
#1: 21
#2: 31
#3: 33
#4: 39
#5: 67
#6: 90
#7: 91
#8: 95
#9: 98
Indices of suspects:
#1: 21
#2: 31
#3: 33
#4: 39
#5: 67
#6: 90
#7: 91
#8: 95
#9: 98
counterfeit_detection_combinatorial_test
MATLAB version
Test counterfeit_detection_combinatorial,
which can identify one counterfeit coin among 2^logn-1 coins
using just logn comparisons.
7 coins checked using 3 comparisons
Fake = #5, Suspect = #5
counterfeit_detection_combinatorial_test
MATLAB version
Test counterfeit_detection_combinatorial,
which can identify one counterfeit coin among 2^logn-1 coins
using just logn comparisons.
63 coins checked using 6 comparisons
Fake = #29, Suspect = #29
counterfeit_detection_compressed_test
MATLAB/Octave version 9.9.0.1467703 (R2020b)
Test counterfeit_detection_compressed,
which seeks to identify multiple counterfeit coins among n coins
using compressed sensing techniques.
Optimal solution found.
100 coins were checked.
Correct coin weight is 17
There were 3 fakes;
Fake Index Weight:
#1: 11 17.9037
#2: 62 18.4128
#3: 99 17.6915
20 random subsets were weighed.
The function found 3 suspects.
Suspect Index Weight:
#1: 11 17.9037
#2: 62 18.4128
#3: 99 17.6915
The test succeeded
counterfeit_detection_test():
Normal end of execution.
27-Jul-2021 21:48:40