29
د! ن ت س ه گ ن ر م ه ها ب سم ا ما ت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.

تمام اسب ها همرنگ هستند! 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

Embed Size (px)

Citation preview

Page 1: تمام اسب ها همرنگ هستند! 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

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

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.

Page 2: تمام اسب ها همرنگ هستند! 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

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

Page 3: تمام اسب ها همرنگ هستند! 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

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

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

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

حقیقی مثبت

Page 4: تمام اسب ها همرنگ هستند! 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

شمارش پذیری

Page 5: تمام اسب ها همرنگ هستند! 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
Page 6: تمام اسب ها همرنگ هستند! 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

Chomskyسلسله مراتب

Page 7: تمام اسب ها همرنگ هستند! 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

گرامرها

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:

Page 8: تمام اسب ها همرنگ هستند! 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

گرامرها

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

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

Page 9: تمام اسب ها همرنگ هستند! 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

عبارات منظم

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

Page 10: تمام اسب ها همرنگ هستند! 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
Page 11: تمام اسب ها همرنگ هستند! 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

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

Page 12: تمام اسب ها همرنگ هستند! 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

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

Page 13: تمام اسب ها همرنگ هستند! 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

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

q0

q2

q1

1

00

1

1

0

Page 14: تمام اسب ها همرنگ هستند! 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

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

q0

q2

q1

1

00

1

1

0

q3ε

Page 15: تمام اسب ها همرنگ هستند! 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

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

q0 q1

1

1

01*00

q3ε

Page 16: تمام اسب ها همرنگ هستند! 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

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

q0 q1

1

1

01*00

q3ε

Page 17: تمام اسب ها همرنگ هستند! 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

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

q0

0

q3ε

1(01*0*)1

Page 18: تمام اسب ها همرنگ هستند! 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

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

q0

0

q3ε

1(01*0*)1

Page 19: تمام اسب ها همرنگ هستند! 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

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

q0

0

q3ε

0 U 1)01*0(*1

Page 20: تمام اسب ها همرنگ هستند! 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

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

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

Page 21: تمام اسب ها همرنگ هستند! 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

مثال

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.

Page 22: تمام اسب ها همرنگ هستند! 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

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.)

Page 23: تمام اسب ها همرنگ هستند! 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

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).

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

Page 24: تمام اسب ها همرنگ هستند! 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

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}*

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

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

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

Page 25: تمام اسب ها همرنگ هستند! 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
Page 26: تمام اسب ها همرنگ هستند! 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

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).

Page 27: تمام اسب ها همرنگ هستند! 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

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

• 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.

Page 28: تمام اسب ها همرنگ هستند! 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

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

{ai | i is a prime number}

{ 0i1j | i > j }

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

Page 29: تمام اسب ها همرنگ هستند! 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

تمرین