Problem 539. Fun Race
Very entertaining puzzle.
Hint to the frustrated, as I was:
This is a "noise" exclusion problem. The 1-sigma uncertainty in the time measurement is greater than the "true" time delta between foo and goo.
The test suite method is also vey well executed.
Regardless of noise, the function sign should not be faster than the gamma function. The function Gamma is a factorial/integral calculation, while the function Sign requires looking at just one bit. Unless there is a way to evaluate the gamma function looking at just one bit, sign should be faster. I am guessing that someone's computer has optimization issues.
PS: The other two cases make sense str2num should be slower since it is working with strings, and calling a function that uses a function B should be slower than just calling the function B.
Solution CommentsShow comments
Problem Recent Solvers34
Which values occur exactly three times?
Check to see if a Sudoku Puzzle is Solved
Multiples of a Number in a Given Range
More from this Author100
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!