4

On an NFA, how can the empty set ∅ and {ϵ} be considered regular languages? Does it make sense that a machine that accepts no symbols or a machine that takes the empty symbol exist? I could think of a machine (laptop) that is in off mode, where no entries (symbols) are accepted, but, is that of interest? or could it still be considered as a machine? the same model could apply for a rock for example.

thanks!

Brian M. Scott
  • 616,228
mf295
  • 41
  • 1
    Brain's answer is a good one. I would like to make the following point: You ask, "could it still be considered as a machine?". We are not talking about machines at all. Finite automata are formal mathematical objects. – user259242 Nov 05 '16 at 03:23

2 Answers2

19

We will play a game. There is a machine with buttons and a green lamp. Your job is to press the right sequence of buttons that make the green lamp light up.

For example, perhaps the machine has only one button, labeled a. When you press it, the lamp lights up! Then you press the button again and the lamp turns off. Then you press a third time and the lamp turns on again. You find that pressing the button always turns the lamp on if it was off, and off if it was on. To light up the lamp and win the game all you need to do is press the button an odd number of times. We say that the machine accepts the language a(aa)*, which is a regular expression that represents the set of all strings of as of odd length—all the possible winning sequences of button presses.

Now imagine an even simpler machine: the green lamp is already lit! And there is a sign over the button that says DON'T PRESS THE BUTTON. Indeed, if you do press the button the lamp goes off and no amount of pressing makes it turn on again. Don't you wish you had followed the sign's advice? This machine accepts only the string $\epsilon$, which is the string of zero button presses. The regular expression $\epsilon$ represents the set that contains this one string and nothing else.

Now imagine the simplest machine of all: the green lamp never lights up no matter what buttons you press. Here you can't win the game. The set of strings accepted by the machine is empty, which we write $\varnothing$.

MJD
  • 65,394
  • 39
  • 298
  • 580
9

Let $M$ be a machine with any alphabet, one state, $q_0$, that is the initial state, and no transitions. If $q_0$ is not an acceptor state, $M$ accepts $\varnothing$, and if $q_0$ is an acceptor state, $M$ accepts $\Sigma^*$, where $\Sigma$ is the alphabet.

Now let $M$ have any alphabet and two states, the initial state $q_0$ and one other state $q_1$; $q_0$ is an acceptor state, and $q_1$ is not. The transitions are simple: in state $q_0$ every input sends $M$ to $q_1$, and in $q_1$ every input also sends $M$ to $q_1$. This $M$ accepts the empty word and nothing else.

Brian M. Scott
  • 616,228