How do we write modular notation? I have searched but other answers do not satisfy. Yes N = 1 (mod 2) means N mod 2 is 1.

But how do I write ((N mod (K +1)) - 1) in a formal paper? I want to write steps and use a variable. For example: To win, use P numbers in the game. Where, P = ((N mod (K +1)) - 1)

  • $\begingroup$ Is there any problem writing $P = (N \text{ mod } (K+1)) - 1$? $\endgroup$ – Sangchul Lee Feb 7 at 3:27
  • $\begingroup$ Can you clarify your statement question, and also use MathJax(i.e. LaTeX) if possible? $\endgroup$ – Max0815 Feb 7 at 3:34
  • $\begingroup$ It is more usual to write N \equiv 1 \mod 2 or N\equiv 1 \pmod 2 .That is, $N\equiv 1 \mod 2$ or $N\equiv 1 \pmod 2,$ reserving the Equals sign only for things that are, in fact, equal. $\endgroup$ – DanielWainfleet Feb 7 at 4:46

On second thought - there are two different things that get called "mod".

One is an equivalence relation; grammatically, we treat it as an adverb modifying the equals sign. In this form, no further arithmetic "outside" the mod is allowed, because in principle it applies to the whole equation. If you are using this, what you wrote is formally incorrect.

The other is an operation, the remainder after integer division. It's common in programming, often with the % sign in code. In this case, the remainder $(N\mod K+1)$ will specifically be between $0$ and $K$, the representative of the equivalence class in that range. Well, usually. Some programming languages will flip this to the range from $-K$ to $0$ for negative $N$.
I should also note that your specific example is problematic here, too - what happens if that remainder is zero? How can you use $-1$ numbers in the game?

If you're going to use that operation, you need to clarify what you're doing, in words. See here for more on that subject.

  • $\begingroup$ No, here $\bmod$ denotes an operation. You are confusing it with the equivalence relation of congruence. $\endgroup$ – Bill Dubuque Feb 7 at 4:03
  • $\begingroup$ No confusion. I'm refusing to accept the validity of it as an operation. $\endgroup$ – jmerry Feb 7 at 4:06
  • $\begingroup$ What does it mean for a well-defined (and widely used) operation to be "invalid"? $\endgroup$ – Bill Dubuque Feb 7 at 4:07
  • $\begingroup$ On second thought - answer completely rewritten. $\endgroup$ – jmerry Feb 7 at 4:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.