1
$\begingroup$

Is there any conventional notation for variables that can only take the value 0 or 1? (I'm looking for something of the nature of an overbar, a caret, etc.)

$\endgroup$
2
  • 2
    $\begingroup$ To denote a boolean variable $b$, I would simply state the following before use: $b\in\mathbb{Z}:b\in[0,1]$. $\endgroup$ Jun 24, 2012 at 10:54
  • 2
    $\begingroup$ @Shaktal: That looks convoluted. Why not just $b\in\{0,1\}$? $\endgroup$ Jun 24, 2012 at 15:37

2 Answers 2

3
$\begingroup$

I don't know of such notation. You can always define that $\dot x$ means that $x$ is a Boolean variable with values in $\{0,1\}$.

Of course the dot can be replaced by other symbol. Be forewarned, though, that there are many many different contexts in which these symbols already have meaning. If you specify what you are going to use this notation for (logic, comp. sci., etc.) maybe some better suggestion will be given.

Until then, I think my first suggestion should probably fit.

$\endgroup$
1
$\begingroup$

What you call a boolean variable in CS, is essentially an element of the finite field or order 2. you could write: $$x \in F_2$$

$\endgroup$
2
  • 1
    $\begingroup$ that's so illegible and unnecesarilly compicated. This is probably correct, but who in the world would think of boolean as a finite field of order 2? You may need to know what is the field, then what is finite field, and then what is order of finite field and then that $F_2$ denotes it. Like the classical example of show-off rather than making things simple and clear. $\endgroup$ Sep 11, 2019 at 12:14
  • $\begingroup$ @Intelligent-Infrastructure - That really depends on the context. If $x\in{0,1}$, how much is $1+1$? if you know $x$ is part of the FF of order 2 the answer is $0$, but otherwise you have little way of knowing. $\endgroup$ Sep 11, 2019 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .