Lecture 2 Operation on set Basic operation on
Lecture 2 Operation on set
Basic operation on set 1 - Union ﺍﻻﺗﺤﺎﺩ A ∪ B =def { x| x ∈ A or x ∈ B} 2 - Intersection ﺍﻟﺘﻘﺎﻃﻊ A ∩ B =def { x| x ∈ A and x ∈ B} 3 - Difference A – B =def { x| x ∈ A and x ∉ B} 4 - Complement A⁻ = { x| x ∉ A, x ∈ U } A⁻ = U – A ﺍﻻﺧﺘﻼﻑ ﺍﻟﻤﻜﻤﻞ
• Language: language is the set of all strings of terminal symbols character from alphabet. • Types of language 1 -Natural language: (e. g. : English, Arabic): It has alphabet: ={a, b, c, …. z}From these alphabetic we make sentences that belong to the language. 2 - Programming language: (e. g. : Cobol, Pascal): It has • alphabetic: ={a, b, c, . z , A, B, C, . . Z , ? , /, - , . } From these alphabetic we make sentences that belong to programming language.
Examples: Let ∑={x}, be set of alphabet of one letter x. L 1={x, xxx, xxxx, ……} We can write this in an alternate form: L 1 = {xn , for n=1, 2, 3, …. } Ex: If a = xx and b = xxx then find a. b , b. a a. b = xxxxx b. a = xxxxx Ex: If a=xx and b=xxx then ab=xxxxx by concatenation a&b Ex: L 2={x, xxxxx, …. . } ={xodd} If a = xxx and b = xxxxx are accepted But the catenation of a and b not in L 2 Ab = xxxx Ex: L = { all positive real number } L = { 0. 4, 0. 5, 0. 1, 0. 99}
Example: if ∑ = Ø ( the empty set), the ∑* = { ᴧ}. Ex: If ∑ = {a, b, c}, then ∑* = { ᴧ, a, b, c, aa, ab, ac, ba, bb, bc, ca, cb, cc, aaa. . . } Example: {"ab", "c"}* = { ε, "ab", "c", "abab", "abc", "cab", "cc", "ababab", "ababc", "abcab", "abcc", "cabab", "cabc", "ccab", "ccc", . . . }. Example : {"a", "b", "c"}+ = { "a", "b", "c", "aa", "ab", "ac", "ba", "bb", "bc", "ca", "cb", "cc", "aaa", "aab", . . . }. Example : {"a", "b", "c"}* = { ε, "a", "b", "c", "aa", "ab", "ac", "ba", "bb", "bc", "ca", "cb", "cc", "aaa", "aab", . . . }.
- Slides: 10