HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Notation in NFA, DFA diagrams and language

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
dfanfalanguagenotationanddiagrams

Problem

I've only recently started learning about deterministic/nondeterministic finite automata and languages and I'd like some clarification on common notation used to describe languages. A 0 or 1 raised to an nth power just means that 0 or 1 occurs n times, correct?

For example: the language $L = \{ 0^n \mid n ≥ 1 \} \cup \{ 1^m 0^k \mid m,k ≥ 0 \}$.

My interpretation of this represents strings with at least one zero or any number of ones followed by any number of zeroes. Strings like 001111000 and 0000110 would not be accepted. What confuses me here is that anything raised to the 0th power is 1, so I'm not sure if a string accepted by this language must have at least 1 one and 1 zero. I've included images of my state diagrams if that helps:

Another language I am having trouble understanding is $L = \{ w ∈ \{0,1\}^ \mid w = 0x0, ∀x ∈ \{0,1\}^ \}$.

My interpretation is as follows: the * star means zero or more, and the ∀ means 'for all, for every', so this language accepts any string that starts and ends with 1 zero, with any number of ones and zeroes in between. I originally thought this was the set of strings that was just a single one or zero between 2 zeroes, so either 010 or 000. I'm still not entirely sure which one is right. I'd be so grateful for any advice. Thank you!

Solution

You need to distinguish between three kinds of operations:

  • Operations on numbers such as 0 and 1. $0^3 = 0$ when $0$ is taken to be a number. Here, $0^3 = 0 ⋅ 0 ⋅ 0$, where $⋅$ is integer multiplication.



  • Operations on strings of characters. $0^3 = 000$ when $0$ is a string of characters of length 1. Here, $0^3 = 0 ⋅ 0 ⋅ 0$, where $⋅$ is string concatenation. (Usually, concatenation is written without any symbol at all, so the $⋅$ does not appear, but that is just a notational shorthand. You need to think of it as an operation anyway.)



  • Operations on languages (sets of strings). Operations on strings can be "lifted" to work on sets of strings. For instance, $⋅$ when applied to sets of strings is pairwise application of $⋅$ on the individual elements. Hence, $\{0\}^3 = \{0\} ⋅ \{0\} ⋅ \{0\} = \{xyz \mid x,y,z \in \{0\}\} = \{000\}$.

Context

StackExchange Computer Science Q#165595, answer score: 8

Revisions (0)

No revisions yet.