# Chapter 1: Regular Languages

## For Your Enjoyment

## Chapter 1.1, Finite Automata

Machine M = (Q, Σ, δ, q_{0}, F)
**accepts** string w = w_{1}...w_{n}
where each w_{i} ∈ Σ
if a sequence of states
r_{0}...r_{n} exists with

- r
_{0} = q_{0}
- δ(r
_{i}, w_{i+1}) = r_{i+1}
- r
_{n} ∈ F

### Definition

A language is a **regular language** if some finite automaton
recognizes it.

### Active Learning Problems

- Design a finite automaton that recognizes all binary
strings that contain an even number of symbols.
- Design a finite automaton that recognizes all binary
strings that contain a number of symbols that is
evenly divisible by 3.

### Definition

Let A and B be languages. The regular operations are

**Union**: A ∪ B = {x | x ∈ A or x ∈ B}
**Concatenation**: A ◦ B = {xy | x ∈ A and y ∈ B}
**Star**: A* = {x_{1}...x_{k} | k ≥ 0 and each
x_{i} ∈ A}

### Lecture Problem

Construct a finite automaton that recognizes the union
of binary strings that contain either an even number of symbols
or a number of symbols that is evenly divisible by 3.

### Active Learning Problem

- Note: A regular language is
**closed** under an operation
if applying the operation to members of the collection returns
an object still in the collection.
- Let M
_{1} = (Q_{1}, Σ, δ_{1},
q_{1}, F_{1}) recognize A_{1} and
let M_{2} = (Q_{2}, Σ, δ_{2},
q_{2}, F_{2}) recognize A_{2}.
- Show how to construct M = (Q, Σ, δ, q
_{0}, F)
to recognize A_{1} ∪ A_{2}. Such a construction
shows that the class of regular languages is closed under
the union operation.