We have a function F : {0, . . . , n − 1} → {0, . . . , m − 1}. We know that, for 0 ≤ x, y ≤ n − 1, F((x + y) mod n) = (F(x) + F(y)) mod m. The only way we have for evaluating F is to use a lookup table that stores the values of F. Unfortunately, an Evil Adversary has changed the value of 1/5 of the table entries when we were not looking. Describe a simple randomized algorithm that, given an input z, outputs a value that equals F(z) with probability at least 1/2. Your algorithm should work for every value of z. Your algorithm should use as few lookups and as little computation as possible. Suppose you are allowed to repeat your initial algorithm three times. What should you do in this case, and what is the probability that your enhanced algorithm returns the correct answer?
0/1 point (graded X, Y have the joint probability density function f (z,y)-1 , 0 < z < 1, z < y < z + 1 . Please enter a number. Cov (X,Y) SubmitYou have used 2 of 3 attempts Save Incorrect (O/1 point) 1 point possible (graded) x ~ f(z) 2be-HA, z є R, b > 0 and Y-sign (X) Cov (X, Y)- SubmitYou have used 0 of 3 attempts Save We were unable to transcribe this image 0/1...
Prove the given definition, for parts a) through c). Lemma 9.3.5 (Orthogonality Lemma). Fir N and let w-wN-e2mi/N be the natural primitive Nth root of unity in C. Fort Z/(N), we have: N-1 ktN ift-0 (mod N), 0 otherwise. Lukt (9.3.5) k-0 9.3.2. (Proves Lemma 9.3.5) Fix N є N, and let w-e2m/N. Let f(x)-r"-1. o510 (a) Explain why N-1 (9.3.9) (Suggestion: Try writing out the sum as 1 +z+....) (b) Explain why for any t є z/(N), fw)-0. (c)...
Advanced Calculus (3) Let the function f(x) 0 if x Z, but for n e z we have f(n) . Prove that for any interval [a3] the function f is integrable and Ja far-б. Hint: let k be the number of integers in the interval. You can either induct on k or prove integrability directly from the definition or the box-sum criterion. (3) Let the function f(x) 0 if x Z, but for n e z we have f(n) ....
1. Suppose that N is finite and suppose that we have a probability mass function f on N. For this problem assume that for all w EN we have f(w) > 0. Consider the vector space 12(12) consisting of all functions 6:1 + R, and also equip the vector space with the inner-product (9, 4) = $(w)*(w)f(w). WEN Suppose that we have a function X : 2 + R. Let X = {x ER : JW EN, s.t. X(w) =...
3. 1. Count from 0 to N We will pass in a value, N. You should write a program that outputs all values from 0 up to an including N. # Get N from the command line import sys N = int(sys.argv[1]) # Your code goes here
(Matlab) Suppose we have a function “hw5f.m” that takes as input x and outputs the value for a function f(x). Write a Matlab program that inputs: • interval [a, b]; • m, the number of data points with evenly spaced nodes from x1 = a to xm = b, and values from f(x); • location z satisfying x2 < z < xm−1, where h = (b − a)/(m − 1); and outputs the value of the interpolaton polynomial using only...
1. (25 pts) Let f(x) be a continuous function and suppose we are already given the Matlab function "f.", with header "function y fx)", that returns values of f(x) Given the following header for a Matlab function: function [pN] falseposition(c,d,N) complete the function so that it outputs the approximation pN, of the method of false position, using initial guesses po c,pd. You may assume c<d and f(x) has different signs at c and d, however, make sure your program uses...
(1 pt) For n a nonnegative integer, either n = 0 mod 3 or n = 1 mod 3 or n = 2 mod 3. In each case, fill out the following table with the canonical representatives modulo 3 of the expressions given: n mod 3 nº mod 3 2n mod 3 n3 + 2n mod 3 From this, we can conclude: A. Since n+ 2n # 0 mod 3 for all n, we conclude that 3 does not necessarily...
We have N i.i.d random variables from the uniform distribution between 0 and 1. If N=1, what is the probability that the nth order statistic is less than or equal to the value x? (In other words, what is Pr(X(n)1≤x)?)
1) a) Write MATLAB function that accepts a positive integer parameter n and returns a vector containing the values of the integral (A) for n= 1,2,3,..., n. The function must use the relation (B) and the value of y(1). Your function must preallocate the array that it returns. Use for loop when writing your code. b) Write MATLAB script that uses your function to calculate the values of the integral (A) using the recurrence relation (B), y(n) for n=1,2,... 19...