As much as I'm interested in theory, practice is very helpful in explanation. One problem is the following:
TWO
+ TWO
------
FOUR
This is a crypt-arithmetic puzzle where a unique value is assigned to each letter, and no word can have leading 0's. To see this for myself I quickly implemented this in ruby to see the difference between constraining the search at each level and not. Results?
Unconstrained search (should be n!*d^n):
user 0m42.769s
sys 0m0.315s
Constrained Search (should be reduced to d^n)
user 0m0.037s
sys 0m0.005s
As you can see, a huge difference. Even though I fully understood the math, I was surprised how much of a difference it made by reducing the search space (even though it involved more checks at each level).
In summary... reduce
2 comments:
What..............???????????????????????????????????????????
Isaac,
My name is Isaac Case as well. I was wondering if another person of the same name existed. Well, I've got my answer. If you are as strange as I am and ever wondered the same, then you have your answer as well. Take care.
Dr. Isaac Case
Post a Comment