# Automata Set Theory

A **set** is a collection of distinct elements in which the order of elements does not matter. If **S** is the set, then the size of a set is denoted as **|S|**. If x is a member in a set S, then it is denoted as **x ∈ A** and y is a member not in set S, it is denoted as **y ∉ A**.

## Set Union

In set theory, the union of a collection of sets is the set of all elements in the collection. If **A** and **B** are two sets, then their union is defined as -

##### A ∪ B := {x : x ∈ A or x ∈ B}

### Example of Union

```
A = {2,4,5}
B = {6,9,7}
A ∪ B = {2,4,5,6,7,9}
```

## Set Intersection

In set theory, the intersection of two given sets is the largest set which contains all the elements that are common to both the sets. If **A** and **B** are two sets, then their intersection is defined as -

##### A ∩ B := {x : x ∈ A and x ∈ B}

### Example of Intersection

```
A = {2,4,5}
B = {4,5,6}
A ∩ B = {4,5}
```

## Set Difference

In set theory, the set difference returns a set that is the difference between two sets. If **A** and **B** are two sets, then their difference is defined as-

##### A - B := {x : x ∈ A and x ∉ B}

### Example of Set Difference

```
A = {2,4,5}
B = {4,5}
A - B = {2}
```

## Set Symmetric Difference

The symmetric difference of two sets is the set of elements which are in either of the sets, but not in their intersection. If **A** and **B** are two sets, then their symmetric difference is defined as-

##### A Δ B := {x : x ∈ A or x ∈ B, but x ∉ (A ∩ B)}

### Example of Set Difference

```
A = {2,4,5}
B = {4,5,6}
A Δ B = {2,6}
```

## Set Cartesian Product

If **A** and **B** are two sets, then their cartesian product is defined as-

##### A X B := {(x,y): x ∈ A, y ∈ B}

### Example of Set Cartesian Product

```
A = {1,2}
B = {a,b}
A X B = {(1,a),(1,b),(2,a),(2,b)}
```

Automata Theory

Finite Automata