You are a veterinarian. You have purchased a large balance scale on e-bay, but no weights were included. You want to use the balance scale to weigh animals. Assume the weight (in pounds) of every animal is an integer value less than 100.
A friend tells you that Balance Scale Weights R Us is a good place to purchase weights for balance scales. You visit BSWRU and talk to Rico, the mathematician turned weight salesman. Sensing that you're up to a unique challenge, he offers you two deals:
1. He has a standard weight set containing the following weights: 1, 1, 1, 1, 5, 10, 20, 20, and 50 pounds. He will sell this to you for $X.
2. Alternatively, he will custom-make a set of magical math weights.
Here's how the math weights work:
Rico will sell you a combination of numbers and mathematical symbols. Then, he will combine them however you like and magically turn them into weights equal to the numerical answer. For example, if you buy a "7", a "2", and a "^" Rico could use them to create a 128-pound (2^7) or 49-pound (7^2) weight. However, once a weight is created, you are stuck with it. You can't uncombine or add to the formula.
Rico has plenty of symbols, but he is in short supply of numbers. In fact, he only has 9s. Here are the prices for his numbers and symbols:
Each "9" costs $1.00.
Each simple arithmetic expression (+,-,*,/) costs $0.25.
His other arithmetic expressions (!,sqrt,^) cost $0.50 each.
Parentheses are free.
You're not exactly a penny-pincher, but you're intrigued by Rico's challenge. You want to have enough weights to be able to be able to calculate the exact weight of any animal less than 100 pounds. (Remember they all have integer weight values.)
What value of X makes the two alternatives equal?