Consider the function defined by f(n) = 2 nwhere n is a positive integer.
(i) Can this function be computed by a Turing machine? Why or why not?
(ii) Is this function primitive recursive? Why or why not?
1. The idea behind a turing machine is that it can simulate ANY computer algorithm, no matter how complicated it is. A turing machine can perform any computation which is capable of being performed by a modern day computer. Since the above function can be easily computed by a modern computer it can be computed by a turing machine as well.
2. A primitive recursive function a function that can be computed by a program whose loops are all "for" loops. The upper bound for the iterations of the loop is pre determined. The function can be written using a for loop, by adding the value of n to a sum variable initialised to 0 and running it 2 times. Hence it is a primitive recursive function.
Hope this helped. Please do upvote and if there are any queries please ask in comments section.
Consider the function defined by f(n) = 2 nwhere n is a positive integer. (i) Can...
Question 10. Consider the function defined by f(n) = 2n where n is a positive integer. (i) Can this function be computed by a Turing machine? Why or why not? ( ii) Is this function primitive recursive? Why or why not?
Question 9. Consider the language {a"b" : n >0}. (i) Is this a regular language? Why or why not? (ii) Is this a recursively enumerable language? Why or why not? Question 10. Consider the function defined by f(n) = 2 where n is a positive integer. (i) Can this function be computed by a Turing machine? Why or why not? (ii) Is this function primitive recursive? Why or why not?
Consider Fibonacci number F(N), where N is a positive integer, defined as follows. F(1) = 1 F(2) = 1 F(N) = F(N-1) + F(N-2) for N > 2 a) Write a recursive function that computes Fibonacci number for a given integer N≥ 1. b) Prove the following theorem using induction: F(N) < ΦN for integer N≥ 1, where Φ = (1+√5)/2.
Write a Haskell function integerSqrt that returns the integer square root of a positive integer n. (The integer square root is defined to be the largest integer whose square is less than or equal to n, i.e. the result of integerSqrt 15 is 3.). integerSqrt :: Integer -> Integer
Let us consider the following three statements: I. Recursively enumerable languages are those that can be accepted by a Turing machine; II. Recursive languages are those that can be decided by a Turing machine; III. A recursively enumerable language accepted by a Turing machine that halts is recursive. Which of the following holds? a.Only I; b.Only II; c.Only I and II; d.Only II and III; e. All I, II, and III.
Prove using mathematical induction that for every positive integer n, = 1/i(i+1) = n/n+1. 2) Suppose r is a real number other than 1. Prove using mathematical induction that for every nonnegative integer n, = 1-r^n+1/1-r. 3) Prove using mathematical induction that for every nonnegative integer n, 1 + i+i! = (n+1)!. 4) Prove using mathematical induction that for every integer n>4, n!>2^n. 5) Prove using mathematical induction that for every positive integer n, 7 + 5 + 3 +.......
1. Let n be a positive integer. Classify the languages (i) R = {(M)IM is a TM and L(M) contains exactly n strings) (ii) S- (M)|M is a TM and L(M) contains more than n strings as (a) decidable, (b) Turing-recognizable but not co-Turing-recognizable, (c) co-Turing-recognizable but not Turing-recognizable, (d) neither Turing-recognizable nor co-Turing-recognizable. Justify your answers.
For an integer n > 0, consider the positive integer F. = 22 +1. (a) Use induction to prove that F. ends in digit 7 whenever n 2 is an integer (b) Use induction to prove that F= 2 + IT- Fholds for all neN. (c) Use (b) to prove that ged(F, F.) = 1 holds for all distinct nonnegative integers m, na (d) Use (e) to give a quick proof that there must be infinitely many primes! That is...
5. Consider the following N-N function f: 4n+1 ifn is odd if n is even. Representing numbers in binary: (a) give an implementation level description in English of a Turing machine that computes this f; (b) give the complete transition table of this Turing machine. (4 marks) (6 marks)
Consider the following statements concerning a positive integer : (i.) if n is a multiple of 3, then n2 is a multiple of 3 [ii.) if n' is a multiple of 12, then n is a multiple of 12 (iii.) if nis a multiple of 6, then nis a multiple of 6 Which of the statements are true? Select one: O i. and iii. O All the statements None of the statements Only ii.