Due in-class on 2/28

  1. Do problems R-3.2, R-3.3, R-3.8, and R-3.29 through R-3.33 from the text. Be sure to justify your answer.
  2. Answer the following:
  3. How many times do you need to divide 482 by 2 to get a value less than 1?
  4. How many times do you need to divide 379 by 2 to get a value less than 1?
  5. If starting at 1, how many times would you need to double up to get to a value that is bigger than 1011?
  6. If starting at 1, how many times would you need to double up to get to a value that is bigger than 92?
  7. List the nearest integers (smaller and bigger) to the following: lg(25), lg(195), lg(15300), and lg(95127). Don’t use a calculator and remember that lg is logarithm in base 2.
  8. What is the time complex of the following code fragments? For each fragment the variable alist is list data. 1.
      for el in alist:
       ...
    

    2.

      for i in range(len(alist)):
       el = alist[i]
       ...
    

    3.

      for i in range(0,len(alist)):
       for j in range(i,len(alist)):
         ...