Brute Force Double Equation Solver
We all remember these annoying double equations from school.
It took ages to solve using arcane algebraic methods that usually involved divisions and multiplications by delightful fractions like 1/2, 1/3 etc.
What a tricky, slow and annoying way to spend your precious childhood!
But it turns out a computer program can solve these equations in a couple of seconds using brute force: trying out thousands and millions of number combinations until there is a match.
The "fish and chips" example is preloaded. Feel free to use this on any similar set of equations.
Please use only integers (numbers without decimal points).
running time: milliseconds
Values for X or Y should not exceed 3000; this program is meant for an overage desktop not a supercomputer. If either X or Y are over 3000 the program will terminate with an error message.
The program will try up to 9 million X and Y combinations before giving up. This is an artificial limit: it would be trivial to change the code so this program would run for minutes, hours and even days, crunching though many trillions of combinations. But as this webpage is for illustration purposes only, the runtime is sensibly limited to a few seconds.
If there is more than one possible solution, only the first one will be output.
Disclaimer: use in moderation - raw computing power is no substitute for learning mathematics, problem-solving skills and generally developing your brain. Just because there are calculators does not mean you no longer need to learn times tables.
© GreenFusion Enterprises