Question 1
The following statements illustrate which concept below?
var1 = 1
while var1 != 0:
var1 = var1+ 1
A. A P complex problem.
B. A deterministic problem.
C. An NP problem.
D. The halting problem.
Question 2
If a function is computable,
A. both a Turing machine and a Bare Bones Language program can solve it .
B. a Turing machine can solve it, but a Bare Bones Language program cannot .
C. a Turing machine cannot solve it, but a Bare Bones Language program can .
D. it must be non-deterministic.
Question 3
Which of the following questions has not yet been answered by
researchers?
A. Is P contained in NP?
B. Is NP contained in P?
C. Are all the problems in NP solvable?
D. Are all the problems in P solvable?
Question 4
The class of problems known as NP complete
A. have no known solution
B. have clear, easily verified solutions
C. require a bare bones language to solve them
D. may have solutions, but it is not easy to verify them
Question 5
Which of the following algorithms represents an optimal solution
(in terms of time complexity) for sorting a list?
A. Insertion sort
B. Bubble sort
C. Selection sort
D. Merge sort
Question 6
Which of the following represents the most costly algorithm for solving a problem?
A. Θ(2**n)
B. Θ(n log2 n)
C. Θ(log2 n)
D. Θ(n2)
Question 7
Which of the following statements belong to the Bare Bones
language?
A. x = y
B. copy x to y
C. while x> y
D. while x not 0
E. if x == y
F. x = x + 1
G. increment x
H. decrement x
Answer:----------
Question 1 The following statements illustrate which concept below? var1 = 1 while var1 != 0: var1 = var1+ 1 A. A P complex problem. B. A deterministic problem. C. An NP problem. D. The halting probl...
ANAL UP ALUUm FINAL PART1 ouesnoN13 which ot the following is QUESTION14. Which of the following is not in P? E. Max Cut D. Minimum Spanning Tree C. Min Cut B. 2-SAT Linear Programming QUESTION15. How many NP problems did Karp include in his tree hierarchy? E. 31 D. 22 A. 1 QUESTION16. Which of the following is not one of Karp's original NP problems? C. Feedback Arc Set D. Feedback N Set E. Partition B. Node Cover Arc Cover...
6. Consider the following program: #include <stdio.h> main() { int a,b,c,d ; a=0; while (1) { printf("%d\n", a); printf("Input? "); scanf("%d",&c); if (c == 0) break; d=0; for (b=1; b<=c; b++) if (c%b == 0) d++; if (d == 2 11 C == 1) a=a+c; } } What does this program do? Rewrite the code, organizing it using sound principles. Include comments and redo variable names and indentation. Use multiple functions, blocks, and/or preprocessing if you deem it necessary.
Word Bank: a) python b) computer science c) algorithm d) program e) interpreter f) compiler g) syntax h) semantics i) value J) variable k) operator l) operand m) expression n) statement o) input p)output q)call r) arguments s) library t) bug u) variable scope v) local variable w)global variable x) variable lifetime y) relational operators z) logical operators 1) Compares operands and results in a bool: 2) The duration of a variable's existence: 3) A list of instructions to solve...
ppsMDb Youlube M Inbox- navee Question 1 6 marks he points A(a,b) and C(c,d) are the opposite vertices of square ABCD in the Cartesian plane What are the coordinates of the other two vertices? Be sure to cover all cases of where A and C could bel (a) 4 marks (b) What is the area of the square ABCD? 2 marks P A(ab) (Hint: you may find the following construction useful. Calculate both p+q and p-q) C(c,d) g Minh Pham...
UB.8;4 C. 7:5 D.14; 10 QUESTION 12 Which of the following statements is TRUE? 1. A Pigouvian subsidy reduces the market price to encourage consumption and correct for the underproduction of a good. 11. A Pigouvian tax increases the market price to discourage consumption and correct for the overproduction of a good. III. Negative externalities create deadweight losses, but positive externalities do not. A. III only B. I only C. I, II, and III D.1 and Il only QUESTION 13...
please solve all 3 Differential Equation problems 3.8.7 Question Help Consider the following eigenvalue problem for which all of its eigenvalues are nonnegative y',thy-0; y(0)-0, y(1) + y'(1)-0 (a) Show that λ =0 is not an eigenvalue (b) Show that the eigenfunctions are the functions {sin α11,o, where αη įs the nth positive root of the equation tan z -z (c) Draw a sketch indicating the roots as the points of intersection of the curves y tan z and y...
Use the reduction of order method to solve the following problem given one of the solution y1. (a) (x^2 - 1)y'' -2xy' +2y = 0 ,y1=x (b) (2x+1)y''-4(x+1)y'+4y=0 ,y1=e^2x (c) (x^2-2x+2)y'' - x^2 y'+x^2 y =0, y1=x (d) Prove that if 1+p+q=0 than y=e^x is a solution of y''+p(x)y'+q(x)y=0, use this fact to solve (x-1)y'' - xy' +y =0
The following table is partially filled. 0 1 4 0 Xi 4 D a) Explain why c[1,1] to c[1,5] and c[2,1] to c[5,1] are all 1s? b) Compute c[2,2], and which cell do you refer to when computing it? c) Compute c 2,31 and c[3,2], which cell do you refer to directly this time? d) Fill up the rest of the cells. Assume that you take c[i,j - 1] when there is a draw in line 11. (i.e., take the...
(b) (c) and (d) please Problem(5) (a) (1 pt) Let Z~ Normal(0, 1). Recall the definition of z-value, i.e., P(Z > zr) = r. Find the probability of P(-70/2 < 3 < 2a/2). (b) (4 points) Let X1, X2, ... , Xn be a random sample from some population with (un- known) mean u and (known) variance o?. Based on the Central Limit Theorem and part (a) above, show that the confidence intervals for the population mean y can be...
Question 1(a&b) Question 3 (a,b,c,d) QUESTION 1 (15 MARKS) Let X and Y be continuous random variables with joint probability density function 6e.de +3,, х, у z 0 otherwise f(x, y 0 Determine whether or not X and Y are independent. (9 marks) a) b) Find P(x> Y). Show how you get the limits for X and Y (6 marks) QUESTION 3 (19 MARKS) Let f(x, x.) = 2x, , o x, sk: O a) Find k xsl and f(x,...