Solving problems with near infinite potential solutions
- by Zonda333
Today I read the following problem:
Use the digits 2, 0, 1, 1 and the
operations +, -, x, ÷, sqrt, ^ , !,
(), combinations, and permutations to
write equations for the counting
numbers 1 through 100.
All four digits must be used in each expression.
Only the digits 2, 0, 1, 1 may be used, and each must be used exactly once.
Decimals may be used, as in .1, .02, etc.
Digits may be combined; numbers such as 20 or 101 may be used.
Example: 60 = 10*(2+1)!, 54 = ¹¹C2 - 0!
Though I was able to quickly find around 50 solutions quite easily in my head, I thought programming it would be a far superior solution. However, I then realized I had no clue how to go about solving a problem like this.
I am not asking for complete code for me to copy and paste, but for ideas about how I would solve this problems, and others like it that have nearly infinite potential solutions.
As I will be writing it in python, where I have the most experience, I would prefer if the answers were more python based, but general ideas are great too.