Edit this page Backlinks This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Laborator AA ====== ==== Masina Turing ==== Key concepts: - computation (the output of the tape) and acceptance (acceptare); - mechanical description of an algorithm - (Answers online - discussion) A **Turing Machine** consists of: * an **alphabet** $math[\Sigma] * a set of **states** $math[K] * an **initial** state $math[q_0] * a **transition function** $math[\delta : K \times \Sigma \rightarrow K \times \Sigma \times \{L,H,R\}] * a set of **final** states $math[F \subseteq K] Which of the following components of an **assembly language** would best correspond to the above? $math[K,\Sigma, \delta, q_0, F] * the processor * the memory * registers * assembly instructions - (Answers online) What does the following TM do? (**bitwise complement**) - (Answers online) Write a TM which **accepts** only if the **input** is a binary encoding of a **even** natural number. - (Answers online) Write a TM which adds **5** to a number encoded in binary on the tape. The machine will always accept. - (Answers online) Check if a symbol is present on the tape. - (Discussion) How would the following algorithm be represented as a Turing Machine: <code> Algorithm(vector V, integer M) { integer s = 0 for-each x in V s += x if (x > 1000) then return 1 else return 0 } </code> Helpful questions: * how should the tape be organised? * when should the machine accept? * how would ''foreach x in V'' be implemented? * how would ''s += x'' be implemented? * how would ''if (x > 1000) then ... else ...'' be implemented ? Homework: * Write a TM which verifies if a string has the **same number** of ones and zeroes. Give hints - live (what should the machine do?) * write a TM which **accepts** a given regular expression * write a TM which **reverses** a given binary string (always accepts) ==== Turing Machines and Solvability ==== * Exercitii simple cu MT * Exercitii cu MTU si conceptul de simulare [[https://www.bbc.co.uk/bitesize/guides/zhppfcw/revision/3#:~:text=Von%20Neumann%20architecture%20is%20the,both%20stored%20in%20primary%20storage | Von Newmann Model]] * Algoritmi ==== Decidabilitate ==== * Ce este o problema de decizie? * Problema si rezolvare; * Lista de probleme care (pot/nu pot) fi rezolvate; * Reduceri * Further work: coRE, complement, dovetailing ==== Notatii asimptotice ==== * Implementari care sa ilustreze faptul ca constanta conteaza/nuconteaza * Implementari care sa ilustreze faptul ca log n >> n >> n2 >>> n3 * Grafice (in ?!) * Exercitii clasice ==== Recurente ==== * Cativa algoritmi si recurentele lor * Exercitii clasice ==== NP completitudine ==== * Implementare care sa ilustreze exponentiala (backtracking); legatura cu MTN. * Reduceri pentru SAT solvere * Exercitii clasice cu reduceri ==== TDA-uri ==== * Conceptul de operator vs cel de functie (exercitiu in C, exercitiu in Haskell, pe Liste) * Exercitii clasice