Loading...

PPT – Alphabet and Languages PowerPoint presentation | free to download - id: 6a0a74-MDcxM

The Adobe Flash plugin is needed to view this content

Topics

Alphabet and Strings

- Strings over alphabet
- Language Generation
- Example Languages
- Language Generation by Concatenation
- Example Grammars
- From Grammar to Language

Strings Over Alphabet

Let ? be a non-empty set of symbols, called

alphabet. A string is a finite sequences of

symbols taken from ?. The set of all strings

over ? is denoted by ? . The null string is

denoted by ?.

Inductive Constructing of

Language Generation

? is a countable (infinite) set.

Let ? 0, 1, construct ? .

? ?, row 1 0, 1 row

2 00, 01, 10, 11, row 3 000, 001,

010, 011, 100, 101, 110, 111 0000, 0001,

0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001,

1010, 1011, 1100, 1101, 1110, 1111

With exception of the first row, elements in the

current row are obtained by right-appending 0 and

1 respectively to each element in the previous

row.

Some of the languages over 0, 1 are ? a

language with no words in it! ? a language

with one word in it, which can be neither written

or pronounced!

Example Languages

1, 11, 101, 111, 1001, all odd binary

integers 0, 10, 100, 110, 1000, all even

binary integers 0000, 0011, 0101, 0110, 1001,

1010, 1100, 1111 all 4-bit binary integers with

even parity.

A set of binary integers of a given length is

said to have an even parity if it contains even

number of 1s.

Language Generation by Concatenation Examples

A a, b, c the alphabet for languages L and

M. L ab, ac and M a, bc, abc, find (i) LM

(ii)ML

Solution (i) LM aba, abbc, ababc, aca, acbc,

acabc (ii) ML aab, aac, bcab, bcac, abcab,

abcac

Exercise Find the value of L that satisfies the

equation. ?, a, abL b, ab, ba, aba, abb,

abba

L b, ab satisfies the equation.

Example Grammars

Grammars

Language

Grammar to generate it

S ? aS S ? ?

ai i? 0

b2j1 j? 0

S ? bbS S ? b

Example Grammars Continued

Language

Grammar

S ? aSc S ? b

ajbcj j? 0

S ? aBc B ? bB B ? ?

abjc j? 0

From Grammar to Language

Example 3 Let T a, b, c, V S, A, B and

let the productions be

S

aSA

aaSAA

aB

aaBA

aaaBAA

ac

aacA

aaacAA

aacb

aaacbb

Even and Odd Parities

A set of binary integers of a given length is

said to have an even parity if it contains even

number of 1s.

A set of binary integers of a given length is

said to have an odd parity if it contains odd

number of 1s.

Definition of Grammar

A grammar G is defined as a quadruple ( four

things) G (V, T, S, P), where V is a

finite set of variable (also called

non-terminals), T is a finite set of terminal

symbols, S ? V is a special symbol called the

start symbol, P is a set of productions. The

sets V and T are non-empty and V ? T F. That

is, V and T have no elements in common.

Go Back