How do I plot multi case function in wolfram or geogebra?

1.6k Views Asked by At

How do I plot the following multi case function in wolfram or geogebra?

$$ \begin{eqnarray*} f(x) = \begin{cases} 1, &\text{if }x \text{ is an integer}, \\ 0, &\text{if }x \text{ is not an integer}. \end{cases} \end{eqnarray*} $$

The graph would be dots and underscores?

1

There are 1 best solutions below

2
On

I can't quite do that with a nice picture, but the reverse works more or less with ceiling(x)-floor(x) and looks like

enter image description here