Unit 5
Unit 5
Instead of being designed for one specific task, the UTM takes the
description of another Turing machine and its input as its own input.
Example:
If you give a UTM the encoding of a Turing machine that adds two
numbers and an input string "2+3", the UTM will imitate that Turing
machine to produce the result "5."
Example:
Consider the language L = {strings that represent prime numbers}. A
Turing machine can check whether a number is prime and accept it, but it
might run forever for non-prime inputs.
theory.
Q.3 What is a Turing Machine? Give the formal definition of TM.
Steps:
o Replace a → b, b → a, b → a.
3. Move right and repeat.
Transitions:
1. Read a, b, b in sequence:
This TM works iteratively to find and replace occurrences of abb with baa
Q.4 How turing machine can be use to compute the functions? Design
turing
For functions like multiplication, the TM can encode numbers and perform
operations similar to how humans do, using repeated addition,
subtraction, or shifting techniques.
Objective:
Given two numbers mmm and nnn encoded in unary (e.g., 3 = "111"), the
TM should compute their product m×nm \times nm×n in unary.
Input Format on the Tape:
Input is written as m#nm \# nm#n, where mmm and nnn are in unary,
and # separates them. For example, multiplying 3×23 \times 23×2 is
encoded as 111#11.
High-Level Steps:
1. Copy mmm:
2. Use a marker:
3. After copying, move back to the beginning of nnn and repeat until
all 1s in nnn are processed.
Example:
If MMM is a Turing machine designed to check whether a number is prime,
the UTM can simulate MMM to determine if the input number is prime.
The machine will halt and accept if the string is in the language.
However, if the string is not in the language, the machine might:
o Reject explicitly.
Key Points:
Explanation:
Example of Contradiction:
Imagine a machine HHH that solves the halting problem. If HHH is fed a
description of itself as input, it leads to contradictory behavior, proving
that such a machine cannot exist.
Q.5 Write short notes on:
i) Reducibility
description.
Components of a PDA
1. Input Tape: A tape that holds the input string. The input is read
symbol by symbol.
Where:
An ID is written as:
(q,w,α)(q, w, \alpha)(q,w,α)
Where:
Transition in ID