Monday, January 5, 2009

Math Poozle


Dais poozle haz bin trainslatted into Tobee Speek foah an added degree ov difficulty.

Eweree two-digit numbah cayne be represented az AB, wheah B iz da wuns digit and A iz da tens digit. Zo foah eggzample da numbah 43, A iz 4 and B iz 3.

Imagine denn dat u tuk dais two-digit numbah and u squared id, AB x AB, and whin u did dat da result wuz a three-digit numbah, CAB.

Here's da quezhun: wat iz da value ov C, zo dat AB(squared)= CAB?

12 comments:

BuBe said...

c=6
a=2
b=5

25x25=625

do I finally get a star??

Chip Bradley said...

Wow! Nuhow datz wat Ize kawl impressive. Zur luks ryet tah mee. Whaddiya za TcT and Tobee? Duz BuBe getz da gowuld stah?

Tinyc Tim said...

Holy Cannoli! BuBe is da Math Queen! I was about to post something along the lines of

"No way would I actually try to figure this out without using a computer program."

I am happy to say that I nailed this on my first shot with math.tc which displayed the following output

a = 2 b = 5 c = 6

100*a*a+20*a*b+b*b = 400 + 200 + 25 = 625 = 100*c+10*a+b = 600 + 20 + 5

but I must admit, BuBe most definitely deserves a gold star. Would it be too much to ask the guy over at M4C to knock out another masterpiece?

Question for Max: Why is the expression on the LHS (Left Hand Side) of the above equation relevant here?

Nice job BuBe. You never cease to amaze us!

Chip Bradley said...

It would be my pleasure to knock out a specially designed star for our Math Queen, Bube. Please wait for Math4Chip Enterprises (M4CE) to install special star-making machinery. Shouldn't take too long.

Now, as for the relevance of the expression on the LHS of

100*a*a+20*a*b+b*b = 400 + 200 + 25 = 625 = 100*c+10*a+b = 600 + 20 + 5

I am still tinking about that. I'll get back to you soon on this.

I would also like to look further into your math.tc program which "knocked out" what Bube nailed so nicely. Nice comment, TcT.

Chip Bradley said...

My short answer would be: It is relevant because it demonstrates the use of the Distributive Law in mathematics.

An example of the Distributive Law in math is as follows:

2 x (1 + 3) = (2 x 1) + (2 x 3)

In our Tobee example, we see that

(ab)squared = cab

This can also be written in the following way

(a x b) x (a x b) = c x a x b

In looking at the LHS (left hand side) of the equation, I can see where this "Distributive Law" comes into play because:

(a x b) x (a x b) can also be written as:

(a x a) + (a x b) + (b x b)

This appears to be what is happening in the way you have written the following since it too is following the Distributive Laws of mathematics.

100*a*a+20*a*b+b*b = 400 + 200 + 25 = 625 = 100*c+10*a+b = 600 + 20 + 5

Do I get 4-leaf clovah?

Tinyc Tim said...

Please see

Notation, Notation, Notation!

TcT

BuBe said...

all I did was square dual digits until I found the last two digits to match AB - nothing fancy on my part - just my usual slow but steady progression on things. Perhaps a simple star will do. hehehe

Chip Bradley said...

Oooops! Thanks for the notation note. I would like to take this opportunity to warn readers of my computation above. If you build bridges for a living and you use this kind of logic, you will most certainly be carried away by the river before you even pick up the first 2 x 4. But I am better now and might be able to build a door frame after having been sighted by the math police. Thanks for my 2-leaf clovah!

Tobee 'n DeeDee said...

Good job BuBe! You definately deserve a stah! I leave the star up to Max to design.

Tinyc Tim said...

Motivated by my tiny-c program that solved DeeDee's (AB)^2=CAB cryptarithm, I have written crypt.tc, a program that solves the SEND+MORE=MONEY cryptarithm. Here's what the output looks like: crypt.png. It takes only about a minute to run. This program could be changed to solve the XMAS+MAIL+EARLY=PLEASE problem fairly easily. Although the program is not a "generic" cryptarithm solver, it does have the basic elements you'd need to attack specific problems. It took me about 4 hours to write and debug.

Probably the most interesting aspect of this for me was that I have been thinking about how to do these problems for about a month, off and on. I scribbled out "pseudocode" on several occasions only to get bogged down in complexity. It was DeeDee's new, fairly simple problem and my solution to it that made me revisit this problem with a new sense of confidence that it could be done.

Chip Bradley said...

Tinyc and Bube both need gowuld stahs I think. Bube's "simple" math skills were probably not so simple when it came down to her thinking it through. [Your star will, as mentioned, be coming soon]. Tinyc though appears to have cracked the SEND+MORE=MONEY problem [with a program] in a major way. Tobee & DeeDee were the original winners with this and we should not forget her effort and / or the Zen Mastah's. I took a look at his program though and it sure looked like he pulled out all the stops! Wow! I tried to understand it, but it was pretty complex. I have a feeling he must have really thought about it and that ADDING things involved lots of "testing as you go" sort of logic -- since, after all, the SUM of the SEND+MORE letters (on top of one another)HAD to end up equaling MONEY. It looks like the program actually does ALL columns of addition and tests as it goes. Kind of obvious I guess, but I bet not so trivial mathematically. Anyway, just felt like congratulating Tinyc on what appears to be a major effort. It sure must have been fun to see it work! Nice job!!

Tinyc Tim said...

I think your "summary" of the various people that jumped in on this problem (cryptarithm / alphametic) is really good. Each of us is a winner, in our own way. Thanks in particular for talking about my own recent "victory." You are right; it pleased me very much to be able to write this. I have sent a note to Truman Collins (whom I may have mentioned early on). He is the fellow who wrote the online cryptarithm solver.

Max's remark

"It looks like the program actually does ALL columns of addition and tests as it goes"

is "kind of true" (are there shades of true?) but "kind of false" also (are there shades of false?). I don't actually add the numeric counterparts in each column, like we do when we do addition problems. I compute "expressions" like

x=1000*s+100*e+10*n+d
w=1000*m+100*o+10*r+e
z=10000*m+1000*o+100*n+10*e+y

(where the individual letters are allowed to range, in a well-controlled way, over ALL legal possibilities)

and then ask the purely numeric question

is x+w equal to z?

One final remark. After getting this program to work, I of course couldn't leave it alone and have "improved it" in a "major way" (as well as in a few other "minor ways"). These improvements are reflected by a dramatic reduction in the size of the source code, which dropped from 2126 bytes to 1585 bytes. The program "screams" now, taking about 57 seconds. All variables were made "global" so none of the "functions" needs to have "arguments" any more. This eliminated the "overhead" involved in passing "parameters" to functions.

(The above is pure technobabble and is directed at God only knows.)

I expect there are other ways to "simplify" this program, but it's time to move on to other challenges.