Consider The Set of All Programs That Take an Integer Written in Binary Format - IT Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task:

Task:

1. Using the fact that the HALTING Problem is undecidable, (that is no terminating algorithm exists for it) show that the following problem is also undecidable: The Acceptance Problem: Consider the set of all programs that take an integer written in binary format and either returns “Accept” or “Reject” or runs for ever. Can we write a program called ACCEPTANCE which takes such a program P (written in any language, say C or Python) and decides whether P accepts all integers or not? So we can imagine many such programs: one that decides if the input integer is even, another that decides if the input integer is a prime number, another that decides if the input integer is a powe of 2, etc. There are infinitely many such programs that we can think of. The question we wish to decide is that can we look at the text of a program and decide if it accepts all integers or not. You are to show that this problem, like the HALTING Problem is undecidable. (You may either prove this directly, or use the fact that the HALTING Problem is undecidable and try to “reduce” it to this problem.)

2. For the insertion sort algorithm we are implicitly using a subroutine that works as follows: Given a list L that is already sorted in increasing order, and a new number a, it will insert it into L maintaining the sorted property of L.

 2a) You are to write an algorithm for the insertion problem. Given a sorted list of numbers L and a new number a, express your algorithm “RECINSERT(L,a)” recursively. You should not use any for, while etc. loops. Only recursive calls and if, if ... else statements, arithmetic operations, assignments, and comparisons may be used.

2b) Let the time complexity of your algorithms, that is the number of comparisons and basic operations (assignment, arithmetic operations, etc.) in your algorithm be f(n) where n is the length of L. Find a recurrence relation for f(n), and also state what f(1) equals to.

2c) Solve the recurrence you derived and find the asymptotic running time of our algorithm using the O(·) notation. 2 22:544:613SEC03 & 26:711:685SEC03, Fall 2021 Homework 1 Due date: 9/20/2021 at 11:50PM 3. Write g ? f if g = O(f), but f 6= O(g). Write f ≈ g if g = Θ(f). Order the following list of functions from slowest growing to the fast growing. Insert ? or ≈ in between them when appropriate. For example, for the list of functions log(n), n 2 , n 2 + 1 and 2 n we write: log(n) ? n ? n 2 ≈ n 2 + 1 ? 2 n Here is the list of functions for you to order as stated (all logarithms are in base 2): n + log(n) n , 2n, 1.0000110n , 1, n+log(n), n, n2 , nlog(n) , 2 √ n, 1.000001n, log(n) n 1000, 22 n , n log(n) , log(n) n , 101.00001n , 1 + n n , 22 log(n)+3 , log n 100+3n50+2n20+5

4. Write a recursive algorithm for multiplying two polynomials of degree n, P(x) and Q(x), each represented by their array of coefficients P=[p0,p1,...,Pn] and Q=[q0,q1,...,qn]. To achieve this task you may call the polynomial addition algorithm POLYADD(P,Q) which returns an array [p0+q0,...,pn+qn]. Note: You can simply call POLYADD and you do not need to write a separate code for it.

4a) Express the RECPOLYMULT(P,Q) recursively. You cannot use any while for, etc. loops. You may recursively call RECPOLYMULT. You are also allowed to call POLYADD(P,Q). Use the following algebraic identity to design your algorithm: P(x) = p0 + p1x + · · · + pnx n Q(x) = q0 + q1x + · · · + qnx n P(x) × Q(x) = p0q0 + p0x(q1 + q2x + · · · + qnx n−1 ) + q0x(p1 + p2x + · · · + pnx n−1 ) + (p1 + p2x + · · · + pnx n−1 ) × (q1 + q2x + · · · + qnx n−1 ) Also, note that x(p0+p1x+· · ·+pnx n−1 ) can be computed by shifting the array [p0,p1,...,pn-1] by one position to the right and inserting 0 to the left: [0,p0,p1,...,pn-1]

4b) Derive a recurrence relation for the time complexity of the RECPOLYMULT algorithm. 4c) Solve the recurrence relation and express the complexity of the algorithm in O(·), or if appropriate in Θ(·) notatio

The above IT Assignment has been solved by our  IT Assignment  Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.