2

I am working on a write-up and want to say that a variable is a positive integer (including zero). Would this be said as "variable is in the set of all nonnegative integers"? Maybe there is a different notation I should be using? In the event that I do want to use set notation, how would I write it in symbols?

J. W. Tanner
  • 60,406
Breadleaf
  • 121
  • 1
    I'd just say "the variable is a non-negative integer". (Note: $0$ is not a positive number. Positive means strictly greater than $0$) There's no point is specifically saying "variable is in the set of all nonnegative integers" as every object is an element of the set that describes it. It's enough to just say "variable is non-negative integer". If you wont notation $x\in {n\in \mathbb Z| n \ge 0}$ is fine but there is also the notation $\mathbb Z^+$ which conventionally (and maybe confusedly) includes $0$. There's also $\mathbb N \cup {0}$. – fleablood Nov 28 '22 at 01:40

2 Answers2

2

Saying that a variable is a nonnegative integer does include $0$. Sometimes people define the set of natural numbers $\mathbb{N}$ so that $0 \in \mathbb{N}$, though it is usually explicitly stated.

In set builder notation, you could denote the set of nonnegative integers with $$\{x\in\mathbb{Z} \mid x \ge0\}$$

Scene
  • 1,566
2

You could say $x\in\mathbb{N}$ or $x\in\mathbb{Z^+}$. $\mathbb{N}$ is the set of natural numbers and $\mathbb{Z^+}$ is the set of positive integers, which are essentially the same thing.

Kamal Saleh
  • 6,497