Mathdice Computer

Warning, the program is still buggy! Please mail me with any bugs you find.

Known Bugs

Fixed Bugs

WILL-NOT-FIX Bugs

Documentation

The basic assumptions I've made are as follows:

The general scheme of the algorithm is that I put together all combinations of the terms, with no regards as to integers, and then filter the resulting list by integer outcomes.

For one sample output to look at, click here..

That tells you integers you can make with the digits 3, 4, and 8, using no more than 1 layer of square roots per term.

I've done many, many revisions of the algorithm, trying to remove expressions that are "mathematically equivalent." More on that later.

The notation for the formula is post-fix, which means that the numbers come first, then the operators. For example, if X, Y, and Z are numbers, and + and * are binary operators, then "X Y Z + *" is what we would think of as X * (Y+Z).

The operators I have are:

"neg" : unary operator.
Takes the additive inverse of the previous number. "sqrt" : unary operator.
Takes the square root of the previous number. Note that the number of successive sqrt operators that can be taken is limited -- the first digit in the filename is the maximum number of sqrt operations that can be used. "sum2+" : binary operator.
Sums the two previous numbers. "sum3+" : trinary operator.
Sums the three previous numbers. "sumN+" : multinary operator.
same as above, see pattern. "prod_nn_x" : binary operator.
Takes the product of two previous numbers. "prod_nd_x" : binary operator.
Takes the ratio of the two previous numbers; the first one is the numerator, the second one is the denominator. "prod_dn_x" : binary operator.
Takes the ratio of the two previous numbers; the first one is the denominator, the second one is the numerator. "prod_nnn_x" : trinary operator.
Takes the product of three previous numbers. "prod_nnd_x", "prod_ndn_x", "prod_dnn_x", "prod_ndd_x", etc.:
same as above, see pattern. "pow": binary operator.
"X Y pow" means "raise X to the Yth power". "root": binary operator.
"X Y root" means "take the Yth root of X".
Concatenation and decimal point operations do not have operators, since they can only apply at the number level.

For example, let me take the program's output for "making 16 with the digits 3, 4, and 8," and express them in more readable infix form:

16 (12 ways)
 = 0.3 4.8 prod_dn_x 
 = 0.3 neg 0.8 sum2+ 4 neg pow 
 = 3 48 prod_dn_x 
 = 4 0.3 neg 0.8 sum2+ root 
 = 4 3 pow sqrt 8 sum2+ 
 = 4 8 3 neg root root 
 = 4 8 3 root pow 
 = 4 sqrt 3 pow 8 sum2+ 
 = 8 0.3 root 4 prod_nd_x sqrt 
 = 8 3 4 prod_dn_x pow 
 = 8 3 pow 4 sqrt prod_nd_x sqrt 
 = 8 sqrt 0.3 root 4 sqrt prod_nd_x 
 = 8 sqrt 3 pow 4 sqrt sqrt prod_nd_x 
As you can see, some of these are still mathematically equivalent -- the program isn't perfect yet :)

Existing Files

Request Computation


Maximum layers of radicals: (more than 3 layers is slow!)
Digits to use: (more than 3 digits is slow!)