Question

Suppose you want to calculate the average of 2^n different n-bit numbers. Give your (divide and...

Suppose you want to calculate the average of 2^n different n-bit numbers. Give your (divide and conquer) algorithm, the running time, and the additional space requirements (how many intermediate values does your algorithm store, and how large are these values). Provide a proof.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Suppose you want to calculate the average of 2^n different n-bit numbers. Give your (divide and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (13 pts) Given an array AlI,2,. .. ,n] integers, design and analyze an efficient Divide-and-Conqu...

    (13 pts) Given an array AlI,2,. .. ,n] integers, design and analyze an efficient Divide-and-Conquer algorithm to find some i and j, where j > 1, such that A[j]-Ali] is maximized. For example, given A 6, 1,3,8,4,5, 12,6], the maximum value of AL] - Ali] for j > i is 12-1 11 where j -7 and i 2. Give the underlying recurrence relation for your algorithm and analyze its running time. You should carefully state all details of your algorithm:...

  • 2gcd(a/2, b/2) if a, b are both even ged(a, b/2)if a is odd, b is even...

    2gcd(a/2, b/2) if a, b are both even ged(a, b/2)if a is odd, b is even ged(a,bged(a/2, b) if a is even, b is odd gcd(a -b)/2, b) if a, b are both odd (b) Give an efficient divide-and-conquer algorithm for greatest common divisor, based on the above. (c) Express the running time of your algorithm for the case where a and b are both n-bit numbers. Recall that dividing by two results in the removal of one bit from...

  • the question from the course COMP 4040 that Analysis of Algorithms if you want to answer it by code please use C or C++...

    the question from the course COMP 4040 that Analysis of Algorithms if you want to answer it by code please use C or C++ 5. Algorithm Design (20 points) Input: array A contains n distinct numbers from 1 to n, in arbitrary order. Output: number of inversions (defined as the number of pair(i, j) of array indices with i < j and A[i] > Aj]) (a) (5 points) What array with elements from the set {1, 2, ..., n) has...

  • Suppose that P[1 · · · n] records the daily net profit GreatStore earns from days...

    Suppose that P[1 · · · n] records the daily net profit GreatStore earns from days 1 to n. As with most stores, sometimes a P[i] is negative (i.e., when the store lost money that day) and sometimes it is positive (i.e., when the store made money that day). Alice, the owner of the store wants to use the information in P[1 · · · n]to plan for her vacation next year. Since she always has to worry about the...

  • Suppose you have an array S indexed from 1 to n which contains n numbers, not...

    Suppose you have an array S indexed from 1 to n which contains n numbers, not in any particular order, and you wish to count how many times a given number x occurs in S. Consider the recursive algorithm below for this which finds the number of occurrences of x in the index range i...j in S. Of course, solving the problem would involve an initial call to the algorithm for the range 1.n: int CountOccur (int i,j) { int...

  • 1. How many different characters could be encoded using a six-bit code? 2. What is the numerical difference between ASCI a and ASClI 'AN if you treaj them as hexadecimal (hex) numbers? 3. The...

    1. How many different characters could be encoded using a six-bit code? 2. What is the numerical difference between ASCI a and ASClI 'AN if you treaj them as hexadecimal (hex) numbers? 3. The ASCII codes for the characters 'O' through '9' are what hex numbers? If an asynchronous frame is used to send ASCII characters in the form of bytes (8 bits), what is the shortest time it could take to send 1000 characters if each bit in a...

  • Assume you want to determine a weight of an object. Your weighing scales show a random...

    Assume you want to determine a weight of an object. Your weighing scales show a random number X at each measurement, Var X=1 g. You take a measurement n times and compute the average of the results: X¯ n = (X1 + .... + Xn)/n. a) Use the Law of Large Numbers to compute the probability that |Xn − E(X)| < 0.5 when n=20. b) Use Cenral Limit Theorem to compute the probability that |Xn − E(X)| < 0.5 when...

  • Now that the semester is over, I want to ask you how you would divide 100%...

    Now that the semester is over, I want to ask you how you would divide 100% among your group members (excluding yourself): For example (for a group of 4 people, this could look like this and remember you are not including yourself so a group of 4 would require you to give me 3 percentages totaling a 100%): Jane 30 Harry 40 Betty 30 OR for a group of 5 (you would divide the total of 100% among 4 people):...

  • 2. You are making a new account on your favorite social media website. This great new...

    2. You are making a new account on your favorite social media website. This great new website offers the most fun way to steal all of your personal information! Long story short, you need a new password. ords can include upper-case letters, lower-case letters, numbers and the symbols you can r. Characters may be repeated. Please do not simplify your answers. get by holding Shift + a numbe (a) Suppose you want to make a 7, 8 or 9-character long...

  • Multivariable need help and some word explanation Iam a little bit confused on how to set up hy 2 dr xplain why the answers to parts (a) and (b) give the formula we want. e Distance Walked to...

    Multivariable need help and some word explanation Iam a little bit confused on how to set up hy 2 dr xplain why the answers to parts (a) and (b) give the formula we want. e Distance Walked to an Airport Gate orts up in a terminal like points along a line. If you arriv , departure gates are often lined ate and proceed to another gate for a connecting flight, what propor inal will you have to walk, on average?...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT