A 24 Game card



You certainly know the popular 24 Game, in which you're given four 1 to 9 numbers and the objective is to come up with some combination of arithmetic operations that will end up using all the numbers and which the result is 24. In my country there are (or used to be) some serious tournaments around it and I had the chance to reach a regional stage of the national tournament when I was in my 6th grade. However, my school didn't had that much cards so my training was limited because no matter how good you are at math the memory part of the brain will always reach the solution to a puzzle before the arithmetic part does a single operation, so having less cards means less memorization/training.

So recently, as my brother now reaches that level I just thought I could put in practice my programming skills (which would have been very helpful if I had them back then) and generate all the possible cards for that game. The program returns exactly 195 390 unique cards and presents the way of solving (there could be others). Just take it, memorize it and do your best if there are some tournaments you can participate in.

Click to browse all the cards

EDIT: My friend Pedro Diogo (many thanks to him) took the data and created ready to print cards. So,

Click here to download the ready to print cards.

 

If you want to check out the code feel free to here.




I found this interesting issue (bug?) in the well known Wolfram Mathematica ® system.

 When you have something like sqrt(x)^2 (where sqrt means the square root, and ^ an exponentiation), what would you expect it to be in a graphic?  Well, some might say it's the graphic of x, but that would be wrong. Although the square root may be associated with the power by two as its inverse function, that's only true for the non-negative side of the x axis.  There's no inverse of x^2, the result is not a function, so you can't simply cancel the functions and return x.

 So, the graphic of this would only be x on the positive side of the x axis, on the negative side the graphic is as possible as the square root of a negative number (mnham, mnham, complexes...), which is impossible if we're in the plane that we're supposed to, the real plane.

Now, here's the Mathematica's graphic of that:

 

graph of sqrt(x)^2 in Mathematica

 



So, or Mathematica simplified the sqrt(x)^2 in x^(1/2)^2, canceled the exponents and returned x, or it simply processed the square root of negative numbers as complexes, which, of course, squared, returns x, but that's not a valid operation in the real plane. 

I find it interesting how respectful systems have bugs like these. 




Go to Blog