· web viewprincess nora bint abdulrahman university cs314- formal languages and automate...

Post on 09-Mar-2018

215 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Princess Nora Bint Abdulrahman University CS314- Formal Languages and Automate theoryFaculty of Computer and Information Sciences Second Semester 1434/1435HDepartment of the Computer Sciences Sheet #3 (Chapter 3-4-6-7 )

Name:…………………………………………………….Section:…………………..

Q1: Let M be the Turing machine defined by

a) Trace the computation for the input string BabcabB.b) Trace the first six transitions of the computation for the input string BababB.c) Give the state diagram of M.d) Describe the result of a computation in M.

Q2:Answer all parts for the following DFA M and give reason for your answer.

a. Is (M, baa ) ε ADFA?b. Is (M, bba ) ε ADFA?c. Is (M) ε ADFA?d. Is (M) EDFA?

Q3: Define wither the following formulas are in Prenex normal form or not? And why?a. qp [p > q ˄ x , y [x,y > 1 x+y ≠ p ]]b. a,b,c [[(a,b,c) > 0 ˄ n> 2 ] an + bn = cn]

Best wishes

Princess Nora Bint Abdulrahman University CS314- Formal Languages and Automate theoryFaculty of Computer and Information Sciences Second Semester 1434/1435HDepartment of the Computer Sciences Sheet #3 (Chapter 3-4-6-7 )

Q4: For the following formulas state which are sentence and which are not? And why?a. R1 (x,y) ˅ R2 (y,x) b. R1 (x,y,z) ˅ x y [R2 (x,y)]c. x y , z [X+y+z]d. x ,z [R1(x) ˄ R1 (z,y) ]e. x,y, z [x - y + z]f. zx,y [R1 (x , y , z)]

Q5: Decide wither the sentence is a member of the Th(R,<):a. x (x< x+2) b. x, y[ (x< y-3) ]

Q6: The formula y, x[x-x=y] is not a member of Th(R+,-)why? Give a suggestion of changing the formula to be a member? Give an explanation to state your answer.

Q7: give the time complexity of machine M if it's f(n) is:a. f(n)= 7n2 + 4n -1b. f(n)= n + nlognc. f(n)= 23

Q8: Find the upper bound of the following:a. f(n)= 5n5+4n4+3n3+2n2+n+1 b. f(n)= 4n2 + 4 , if c=5.

Q9: Write a simple C program that print a copy of itself.

Best wishes

top related