تمام اسب ها همرنگ هستند! Basis: h = 1 We have only one horse. Clearly all horses...

Preview:

Citation preview

تمام اسب ها همرنگ هستند!

Basis: h = 1 We have only one horse. Clearly all horses in the set are the

same color.

Inductive hypothesis: In any set of up to h horses all the horses have the same color.

Inductive step: Consider a set of h + 1 horses. Discard one horse; by the

induction hypothesis all the remaining horses have the same color. Put that horse back and discard a different horse; again all the remaining horses have the same color. So all the horses have the same color as the ones that were not discarded either time and so they all have the same color.

یک رابطه تهی روی یک مجموعه ناتهی چه خصوصیاتی از خواص رابطه هم ارزی را دارد؟

آیا می توان تناظر یک به یک برقرار کرد؟

نقاط یک نیم دایره و یک خط راستنقاط هر دو پاره خط دلخواه و مجموعه اعداد 1 و 0مجموعه اعداد حقیقی بین

حقیقی و مجموعه اعداد 1 و 0مجموعه اعداد حقیقی بین

حقیقی مثبت

شمارش پذیری

Chomskyسلسله مراتب

گرامرها

Design a grammar that generates the set of all strings over alphabet {a, b} that are not palindromes.

Design a context free grammar for the following language:

گرامرها

برای هر یک از زبان های زیر یک گرامر بنویسید:

زبان زیر یک گرامر مستقل از متن مکملبرای بنویسید.

عبارات منظم

: بنویسید ممکن شکل ترین ساده به را زیر عبارت({a,aaaa}{aa,aaaaa} )*

آیا جهت وارد شدن ورودی مؤثر است؟

چیست؟ C3عبارت منظم متناظر با

به عبارت منظم متناظرDFAتبدیل

q0

q2

q1

1

00

1

1

0

به عبارت منظم متناظرDFAتبدیل

q0

q2

q1

1

00

1

1

0

q3ε

به عبارت منظم متناظرDFAتبدیل

q0 q1

1

1

01*00

q3ε

به عبارت منظم متناظرDFAتبدیل

q0 q1

1

1

01*00

q3ε

به عبارت منظم متناظرDFAتبدیل

q0

0

q3ε

1(01*0*)1

به عبارت منظم متناظرDFAتبدیل

q0

0

q3ε

1(01*0*)1

به عبارت منظم متناظرDFAتبدیل

q0

0

q3ε

0 U 1)01*0(*1

به عبارت منظم متناظرDFAتبدیل

(0 U 1)01*0(*1*)

مثال

Consider the following DFA over {0, 1}: Q = {p, q, r, s}, start state p, accepting state p.

With the following transition table: d (p,0) = s, d (p,1) = p d (q,0) = p, d (q,1) = s d (r,0) = r, d (r,1) = q d (s,0) = q, d (s,1) = r

Write the regular expression recognized by this DFA.

constructiveاثبات منظم بودن – روش

Let L be a regular language. Show that the following languages are also regular:

L1 = {v | vw L}, (L1 is the set of all prefixes of the strings in L.)

L2 = {v | uv L}(L2 is the set of all suffixes of the strings in L.)

A:• alphabet S, • start state q0,• a single accepting state qf,• transition function d that is such that for all symbols a in S, d (q0, a) = d (qf, a).

Show that if x is a nonempty string in L(A), then xx, xxx, ... xk is also in L (A).

ماشین های حالت متناهی

Give DFAs for the following languages:

• The set of all binary strings which do not have 010 as a substring • The complement of {1,10}*

آیا این عبارت درست است:• تنها یک زبان متناهی وجود دارد که توسط یک ماشین حالت

متناهی با یک حالت پذیرفته می شود.

ماشین های حالت متناهی

Minimal-size DFA

• Show that there is a DFA over {0, 1} with n+1 states that recognizes the language (1n)*.

• Show that there does not exist a smaller DFA for this language. (smaller = fewer states).

درست یا نادرست؟

• If L is a nonregular language and M is a regular language then their concatenation LM is not regular.

• All finite languages L are regular.

اثبات نامنظم بودن – برهان خلف

{ai | i is a prime number}

{ 0i1j | i > j }

The set of words that contain twice as many 0’s as 1’s.

تمرین

Recommended