Question: Compute the following sums. a . 1 + 3 + 5 + 7 + cdots + 9 9 9 b . 2 + 4 +

Compute the following sums.
a.1+3+5+7+cdots+999
b.2+4+8+16+cdots+1024
c.i=3n+11
d.i=3n+1i
e.i=0n-1i(i+1)
f.j=1n3j+1
g.i=1nj=1nij
h.i=1n1i(i+1)
Find the order of growth of the following sums. Use the (g(n)) notation with
the simplest function g(n) possible.
a.i=0n-1(i2+1)2
b.i=2n-1lgi2
c.i=1n(i+1)2i-1
d.i=0n-1j=0i-1(i+j)
The sample variance of n measurements x1,dots,xn can be computed as either
i=1n(xi-(x))2n-1, where x=i=1nxin
or
i=1nxi2-(i=1nxi)2nn-1
Find and compare the number of divisions, multiplications, and additions/
subtractions (additions and subtractions are usually bunched together) that
are required for computing the variance according to each of these formulas.
Consider the following algorithm.
ALGORITHM Mystery(n)
//Input: A nonnegative integer n
Slarr0
for ilarr1tondo
,SlarrS+i*i
return S
a. What does this algorithm compute?
b. What is its basic operation?
c. How many times is the basic operation executed?
d. What is the efficiency class of this algorithm?
e. Suggest an improvement, or a better algorithm altogether, and indicate its
efficiency class. If you cannot do it, try to prove that, in fact, it cannot be
done.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!