Problem 44768. Muphry's Law of MATLAB
You're running some simple multiplication problems through MATLAB for error checking purposes, but nothing seems to come up with the answer you should be getting. After hours of going through the codes, you realize that each of your input sets has exactly one digit mistyped, so all of your answers are incorrect. You need to regenerate the actual input you used to get these numbers.
For example, the two numbers you are multiplying together are 67 and 58. Multiplying these together should result in 3886. However, the input data you provided came up with an answer of 3596 instead. Since only one digit is incorrect in your input, you can calculate the input you used was actually [62 58], because 62*58=3596. Therefore, an input of [67 58 3596] should result in an output of [62 58]. If the input was [58 67 3596] then the output should be [58 62].
You can assume that all of the numbers will have the correct number of digits, so 7 will not have to be replaced by 37, for example. Hood Lock!
Solution Stats
Problem Comments
-
3 Comments
Test case x=[11 22 132] will cause some solutions here to fail.
Great catch! Test case added; and by "some solutions" you mean "All solutions except yours and mine."
@ Tim
Well done, Tim. I noticed the bug of my solution, but it did work for the old test suit, and I was too lazy to fix the bug.
Solution Comments
Show commentsGroup

The Prime Directive
- 14 Problems
- 36 Finishers
- Find the nearest prime number
- Extra safe primes
- Prime factor digits
- Twin Primes
- Twins in a Window
- The Goldbach Conjecture
- The Goldbach Conjecture, Part 2
- Goldbach's marginal conjecture - Write integer as sum of three primes
- Sophie Germain prime
- Mersenne Primes vs. All Primes
- Circular Primes (based on Project Euler, problem 35)
- Numbers spiral diagonals (Part 2)
- Pernicious Anniversary Problem
- Prime Ladders
Problem Recent Solvers40
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!