
Is it cheating...
to do my daughter's math homework through C++ code?<BR><BR>She has this 3 problems to do in her class.. they can't get it. I'm getting to write code to do it. They (wife and kid) call it cheating.<BR><BR>Given 1, 2, 3, 4, 5, 6, 7, 8, write each number once so that all columns and rows equal 12. The grid looks like (NONE is a blank cell):<BR><BR>X X X<BR>X NONE X<BR>X X X<BR><BR>Given 1, 2, 3, 4, 5, 6, 7, all columns equal 12 up and down:<BR><BR>X X X<BR>NONE X NONE<BR>X X X<BR><BR><BR>Given 1, 2, 3, 4, 5, 6, 7, 8, 9 all columns and rows should equal 15:<BR><BR>X X X<BR>X X X<BR>X X X<BR><BR><BR><BR><BR>THis isn't cheatin', is it? Shall I give the teacher the code to prove it???

I give up...
...how does giving the teacher the code prove anything??? Other than that you cheated.<BR><BR>The last problem is the classic version. Except that the diagonals should total 15, as well.<BR><BR>And if you write it via code, will your code eliminate all the reflections and rotations that are actually the same answer?<BR><BR>HEY! I just did number 3!!!<BR><BR>Tell her that secret is that the 9 has to go in the middle of one side. After you get that, the other numbers just fall into place! (There's only two ways to go after you put the 9 there. One works, one quickly falls apart.)<BR><BR>Oh, and the diagonals do add up to 15.<BR><BR>

RE: I give up...
LOL!<BR><BR>Well, to impress upon the teacher that code is the way to do it (and to confuse her)<BR><BR>You did the diagonals as well???<BR><BR>Ah well, I just spent the whole time trying to vamp up .Net, and I can't even create a simple console program in C++. I'm gonna do the vbs version right now..

And I just looked at her homework...
and it did say the "classic" diagnols should equal 15 as well.<BR><BR>****.

By the by...
...if you try 9 in any of the other positions (there are only two: corner or center...and which I did), you quickly realize that there isn't any possible solution. So it's no big leap to put the 9 in the middle of a side.<BR><BR>And I don't think you *can* get a solution with rows and columns equal to 15 without diagonals happening, too.<BR><BR>

And #1 is just as trivial.
I assumed that you had to treat the whole in the middle as a zero, no?<BR><BR>So just try putting 8 in one corner: That means that you need numbers adding up to 4 along both of the adjacent sides. CAN'T BE. Only 1+3 add up to 4.<BR><BR>Okay, so put 8 in the middle of one side. Then the number opposite (across the NONE square from it) has to be 4. Yes?<BR>And 1 and 3 have to be beside 8, yes? And the rest just falls out automatically. Takes about 30 seconds.<BR><BR><BR><BR>

I'm trying in Java now...
just for the fun of it.<BR><BR>This has now become *my* project.<BR><BR>(I love sometimes proving her teachers wrong, and I'll have the code to prove it ;))

RE: And #1 is just as trivial.
Heh, for you and me it's trivial. My daughter is having huge problems, and my wife can't get it either. I have to write code just so I "told them so". Who else can do thousands of permutations per second than a computer?<BR><BR>I'd like to talk to you personally also Bill, concerning a business... I knew you had problems, and I'd like to avoid any pitfalls. If you can send me a number to s c i m i n o @ c o x dot NET I'd give ya a ring.

#2 is impossible!
You have two columns where the total must be 12 in only two numbers.<BR><BR>Yet you have only two numbers in the entire set of {1 2 3 4 5 6 7} that add up to 12!<BR><BR>7 and 5. <BR><BR>So how do you get the other column to add up to 12???<BR><BR>6 and 4 fall a couple short.<BR><BR>This one is provably impossible.<BR><BR>

I *think* there is only one solution...
...barring reflections and rotations.<BR><BR>In fact, I'd bet on it.<BR><BR>I'll get in touch from home, later.<BR><BR>
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

