Question

In: Computer Science

1. Suppose there is a point x in the middle of my block of cheese, and...

1. Suppose there is a point x in the middle of my block of cheese, and all of my n straight planar cuts must go through a single common point x. Then the number of pieces is smaller than the number without that restriction, but is still a cubic polynomial in n.

2. Suppose that a and b are each powers of 2, with a > b. Then the Euclidean Algorithm, on inputs a and b, will terminate after at most log2 a steps.

3.

Recall that F(n) is the Fibonacci function defined by F(0) = 0, F(1) = 1, and F(n+1) = F(n) + F(n-1).

If I start the Euclidean Algorithm with inputs F(n+3) and F(n), for any n, it will terminate after about n/3 steps.

4. If we start the EA with any two three-digit numbers, it will finish with at most twelve divisions.

T or F questions TY :)

Solutions

Expert Solution

Sol.

part 2.

Euclidean algorithm

F(m,n){

if n==0 return m

if m=0 return n

F(m%n, m)

}

lets take an example where m = 128 , n=64

F(128,64) => F(128%64, 128) => F(0,128)

So, if both n and m are power of 2 then EA will terminate in next iteration because 2xmod2y = 0 .

False becuase it will take O(1) time to terminate in case of power of 2.

Part 3.

F : 0 1 1 2 3 5 8 13

n : 0 1 2 3 4 5 6 7

lets take n = 2

F(2) = 1 , F(5) = 5

GCD(5,1) => GCD(1,0) => return

n = 3

F(3) = 2 , F(6) = 8

GCD(8,2) => GCD(2,0) => return

SO, the upper bound of euclidean algo will be Log(n or m can take any) => Log(n) here base does not matter becuase every time we are dividing by different number so T(n) = O(logn) but in power of 2 it will be O(1).So from here we can say that taking n/3 steps to execute EA is com[pletely a guess. SO FLASE

PART 4.

we have seen that algorithm will take atmost log(n) steps to terminate so guessing the 12 division is wrong.

SO False

Part 1.

cutting cheese problem will take polynomial time i can not reduce so TRUE.


Related Solutions

In the figure, a 0.24 kg block of cheese lies on the floor of a 920...
In the figure, a 0.24 kg block of cheese lies on the floor of a 920 kg elevator cab that is being pulled upward by a cable through distance d1 = 2.1 m and then through distance d2 = 10.6 m. (a) Through d1, if the normal force on the block from the floor has constant magnitude FN = 2.97 N, how much work is done on the cab by the force from the cable? (b) Through d2, if the...
1. Suppose Betty likes to consume cheese and biscuits, consuming 3 ounces of cheese(C) per every...
1. Suppose Betty likes to consume cheese and biscuits, consuming 3 ounces of cheese(C) per every 2 biscuits(B). What is the utility function that best illustrates Betty’s preferences? a) U(C, B) = min{ C 2 , B 3 } b) U(C, B) = min{ 2C 3 , B} c) U(C, B) = min{C, B 2 } d) U(C, B) = min{ C 2 , B} 2. A consumer buys food (F) and shelter (S). If the consumer’s income doubles and...
1) Show the absolute value function f(x) = |x| is continuous at every point. 2) Suppose...
1) Show the absolute value function f(x) = |x| is continuous at every point. 2) Suppose A and B are sets then define the cartesian product A * B Please answer both the questions.
(1 point) Suppose that f(x)=(12−2x)e^x. (A) List all the critical values of f(x). Note: If there...
(1 point) Suppose that f(x)=(12−2x)e^x. (A) List all the critical values of f(x). Note: If there are no critical values, enter 'NONE'. (B) Use interval notation to indicate where f(x) is increasing. Note: Use 'INF' for ∞, '-INF' for −∞, and use 'U' for the union symbol. Increasing: (C) Use interval notation to indicate where f(x) is decreasing. Decreasing: (D) List the x values of all local maxima of f(x). If there are no local maxima, enter 'NONE'. x values...
A 10kg block is resting in the middle of the ramp frictionless ramp. The ramp has...
A 10kg block is resting in the middle of the ramp frictionless ramp. The ramp has an angle of inclination of 37 degrees with respect to the horizontal surface, and a length of 10 meters. The coefficient of static friction between the block and the ramp is .37, the coefficient of kinetic friction is .25. A string is tied from the block and moved up the ramp, over a frictionless pulley and tied to a 15kg block hanging freely 2m...
Find the potential at a point 8 cm above the middle of two point charges of...
Find the potential at a point 8 cm above the middle of two point charges of opposite charge, of magnitude Q = 28 μC, 28 cm apart. What is the magnitude of the field at this point?
(a) Suppose that the tangent line to the curve y = f (x) at the point...
(a) Suppose that the tangent line to the curve y = f (x) at the point (−9, 53) has equation y = −1 − 6x. If Newton's method is used to locate a root of the equation f (x) = 0 and the initial approximation is x1 = −9, find the second approximation x2. (b) Suppose that Newton's method is used to locate a root of the equation f (x) = 0 with initial approximation x1 = 9. If the...
A periodic point of a function f : X → X is a point x ∈...
A periodic point of a function f : X → X is a point x ∈ X for which there is a number p (a period) with (f(x))^p = x (f^p denotes the composite (f ◦...◦f) of f with itself p times). A fixpoint is a periodic point with minimal period p = 1, that is, a point x ∈ X such that f(x) = x. For X = {1,2,...,n}, count the number of functions f : X → X...
1) If a block of wood has the dimensions of 50.0cm x 50.0cm x 45.0cm. What...
1) If a block of wood has the dimensions of 50.0cm x 50.0cm x 45.0cm. What is it's volume in Liters? (Give answer in correct significant digits) 2) If one kilogram is equal to 2.2 pounds:       a.   What is the mass of a 5.0 lb bag of sugar?
Let f : Rn → R be a differentiable function. Suppose that a point x∗ is...
Let f : Rn → R be a differentiable function. Suppose that a point x∗ is a local minimum of f along every line passes through x∗; that is, the function g(α) = f(x^∗ + αd) is minimized at α = 0 for all d ∈ R^n. (i) Show that ∇f(x∗) = 0. (ii) Show by example that x^∗ neen not be a local minimum of f. Hint: Consider the function of two variables f(y, z) = (z − py^2)(z...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT