10 items are filed under this topic.
|
|
|
|
|
|
|
|
Mod versus Rem in Turing |
2013-01-01 |
|
From Eric: I am a teacher teaching computer science using Turing. I am having
difficulty understanding why one would use the mod operator versus the rem
remainder operator.
Mod seems to make the resulting sign depend on the sign of the divisor,
whereas rem makes the resulting sign depend on the dividend.
Examples:
11 mod 5 = 1 and 11 rem 5 =1
-11 mod 5 = 4 and -11 rem 5 = -1
11 mod -5 = -4 and 11 rem -5 =1
-11 mod -5 = -1 and -11 rem -5 = -1
What I can't understand is why this would matter. For example, -11 / 5 =
-2.2 and 11 / -5 = -2.2 get the same result.
So how is a remainder dependent on the sign of one of the parts?
What benefit would using one over the other have?
Any insight would be most helpful!
Eric Answered by Harley Weston. |
|
|
|
|
|
Modular arithmetic |
2011-10-30 |
|
From Kim: Hello,
I am editing a resource for students, and I think some of the answers may be incorrect.
The text I was given and my questions are in the attachment.
Any help you could give would be appreciated.
Thanks,
Kim Answered by Harley Weston. |
|
|
|
|
|
Two modular equations |
2008-10-08 |
|
From Mhiko: please solve this Chinese remainder problem..and give me a solution or rule in order to solve this problem/
x=2mod15
x=1mod25 Answered by Stephen La Rocque. |
|
|
|
|
|
Remainders |
2008-06-30 |
|
From vivek: what is the remainder when 2050*2071*2095 is divided by 23 ?
this question needs to be done in as less time as possible. Answered by Penny Nom. |
|
|
|
|
|
The number is increased by the sum of its digits |
2005-11-07 |
|
From Ernesto: The number 1 is written on a blackboard. After each second the number on the blackboard is increased by the sum of its digits. is it possible that at some moment the number 123456 will be written on the blackboard? Answered by Claude Tardif. |
|
|
|
|
|
The sum of the digits of 2^100 |
2005-06-11 |
|
From Richard: The sum of the digits was calculated for the number 2100, then the sum of the digits was calculated for the resulting number and so on, until a single digit is left. Answered by Penny Nom. |
|
|
|
|
|
Divisibility of a^2 + b^2 |
2005-05-16 |
|
From Ampa: given natural numbers a and b such that a2+b2 is divisible by 21, prove that the same sum of squares is also divisible by 441. Answered by Penny Nom. |
|
|
|
|
|
Take It! |
2002-04-03 |
|
From Bryan: You are playing Take It! for $180,00 with a total stranger. There are 180 identical balls in a big vase. Each player in his turn, reaches into the vase and pulls out 1,5,or8 balls. These balls are discarded. The player who takes the last ball from the vase wins the $180,000. A flip of the coin determines that you will go first. Are you glad? How many will you take out on the first move, and how will you proceed to win the prize? Answered by Claude Tardif. |
|
|
|
|
|
Finding a formula |
2000-05-05 |
|
From Erica Hildebrandt: If a farmer has a field and his plots are laid out in the following grid where each # represents a plot: 4 | 5 | 12 | 13 | 20 | 3 | 6 | 11 | 14 | 19 | 2 | 7 | 10 | 15 | 18 | 1 | 8 | 9 | 16 | 17 | Of course the plot numbers aren't meaningful as I have described above. In fact they may not be numbers at all. The only constants I have are the total number of rows and columns. Using the total number of rows and columns and my current position row and column, how can I write a formula that tells me column 3 row 3 = 10, column 4 row 2 = 14, etc. I can see the pattern but can't quite get the formula. I believe I will need 2 different formulas one for even and one for odd rows. Answered by Paul Betts and Penny Nom. |
|
|
|
|
|
Divisibility by 9 |
1999-02-21 |
|
From Razzi: I've been having a hard time trying to solve the following problem and I was wondering if you could help me. For any positive integer a let S(a) be the sum of its digits. Prove that a is divisible by 9 if and only if there exist a positive integer b such that S(a)=S(b)=S(a+b). Answered by Chris Fisher and Harley Weston. |
|
|