Calcudoku puzzle forum
https://www.calcudoku.org/forum/

Subtraction and Division with 3 or more squares
https://www.calcudoku.org/forum/viewtopic.php?f=2&t=4
Page 3 of 3

Author:  rossiniman  [ Fri Jun 03, 2011 3:56 am ]
Post subject:  Re: Subtraction and Division with 3 or more squares

I don’t think it’s quite accurate, is it, to say the rule about order is the same for all operators? With subtraction or division, the order makes no difference in Ken Ken (even though the order DOES make a difference in the real world, where 6 divided by 2 has a different answer than 2 divided by 6).

With the modulo operator, the order does make a difference, in Ken Ken as well as in the real world. In maartensmit’s example, 5 followed by 7 is 5; reverse the order and it’s 2.

For addition and multiplication, the order of course makes no difference either in the real world or in Ken Ken. I’m not sure where the bitwise or operator goes. Order makes no difference in Ken Ken, but I’ve never bumped into it in the real world. Exponentiation I have no clue; in Ken Ken it just fries my brain.
:oops:

Author:  maartensmit  [ Fri Jun 03, 2011 9:34 am ]
Post subject:  Re: Subtraction and Division with 3 or more squares

I think the 'rule' Patrick was talking about was that any order that results in a positive integer answer is correct. I think it's hard to find a rule that works for all operators though, because this one doesn't work for exponentiation..

Author:  clm  [ Sat Jun 04, 2011 11:59 pm ]
Post subject:  Re: Subtraction and Division with 3 or more squares

pnm wrote:
maartensmit wrote:
Just to be entirely sure about this, modulo operators don't have any particular order, right?
So 5 and 7 in a cage could be either 2mod or 5mod?

Yes, absolutely, the same rule as for the other operators.


The subtraction and division with 3 or more squares do not represent a problem for the computer (the final result must be an integer of course); if no brackets are assumed and the operation starts with the higher number. That is clear. In the case of the division, for instance, when iterating in sequence, 8/4/2, the result is equivalent (arithmetically) to (8/4)/2 = 8/(4x2) = 8/8 = 1; also (8/2)/4 = 8/(2x4) = 8/8 = 1 since you have the higher number divided by the product (that is conmutative) of all the lower numbers. In the other side, for the exponentiation, ^, actually, brackets are assumed with any combination of two operands. For the logical bitwise OR (or XOR, etc.) the order of the operands is not significant since, once you have the binary expression for each operand, the operation is applied bit by bit in each independent position with the conmutative and the associative properties. The problem would appear if you try to extend the modulo operation to 3 or more squares. For instance, iterating the mod function with the 4, 5 and 7, the result can be mod0, mod1, mod2, mod3 or mod4 (the lower number makes the limit, that is, mod0… to modx, being x the lower number of the three given, in this case 4); while 3, 5 and 8 produce mod0, mod2 and mod3 but not mod1; 3, 7 and 8 however produce mod0, mod1, mod2 and mod3. If you had 3 positions, the 1 should be prevented inside because it could produce an intermediate 0 and the division by 0 is not allowed in the computers. The situation could also crash if you have numbers that are multiples the ones of the others, like in the combinations 2, 4 and 7 or 3, 5 and 6, etc. However, the modulo operation with 3 or more squares could be considered even with those limitations if: Whenever there is a 1 inside (the rest of the numbers are multiples of 1), or when a number is multiple of another, or if an intermediate result is 0, the final result assigned to the full cage is always mod0 (if the cage result is decided to be different than mod0 then the red indication could be set as soon as the wrong entry is attempted indicating the prohibition for that particular number).

Author:  sneaklyfox  [ Sun Jun 05, 2011 6:22 am ]
Post subject:  Re: Subtraction and Division with 3 or more squares

Not sure I got all that, but I'm just glad the current puzzles use the modulo operation on only 2 squares and not more. It sounds like a headache and I don't feel like worrying about it until I have to.

Author:  pnm  [ Sun Jun 05, 2011 11:00 am ]
Post subject:  Re: Subtraction and Division with 3 or more squares

sneaklyfox wrote:
Not sure I got all that, but I'm just glad the current puzzles use the modulo operation on only 2 squares and not more. It sounds like a headache and I don't feel like worrying about it until I have to.

Yes, I ended up limiting the mod operator to 2 squares because I didn't want to figure out
what to do with more..

Page 3 of 3 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/