CPSC 110 Spring 2012 Quiz 5
Answer Key

    Choose the best answer from among the choices given.

    1. A symmetric key cipher ______________________.
      1. is one in which the key reads the same way backwards and forwards.
      2. is exemplified by the public key encryption algorithm.
      3. is one in which the same key is used for encrypting and decrypting messages.
      4. is also known as the Rivest Shamir Adelman (RSA) algorithm.
      5. all of the above.

    2. We say that the Traveling Salesman Problem is intractable because ________.
      1. it is theoretically impossible to solve.
      2. it can't practically be solved for more than 4 or 5 cities.
      3. it requires exponential running time.
      4. it requires a brute force search.
      5. all of the above.

    3. A class list contains names in alphabetical order. The best algorithm for looking up a name would be to repeatedly divide the list in half based on the first letter of the target name. As the length of the list, N grows, the running time of this algorithm would grow proportional to which of the following functions?
      1. logarithmic: f(N) = log2N
      2. linear: f(N) = N
      3. quadratic: f(N) = N2
      4. cubic: f(N) = N3
      5. exponential: f(N) = 2N

    4. Which of the following is an example of persistent memory?
      1. A global variable
      2. An argument for a function or procedure
      3. A list
      4. A TinyWebDb
      5. A procedure

    5. In TinyWebDb, suppose you look up an item with the block TinyWebDb.GetValue( tag ). What value would be returned if there is no value stored with tag in the databases?
      1. You'd get back the empty string or empty text.
      2. You'd get back an error message "No such value".
      3. You'd get back 0
      4. You'd get back an empty list.
      5. You'd get back the tag itself as the value.

    6. A Domain Name Server is used by applications to _____________.
      1. translate a domain name, such as google.com into an IP address.
      2. translate an IP address into a domain name.
      3. determine whether a proposed domain name is available for purchase.
      4. retrieve a list of all pages in a given domain.
      5. create a route from the client to a server.

       

      For the next several questions, choose all answers that apply.

    7. Choose all answers that apply. A simple substitution cipher ____________.
      1. is an example of a symmetric key cipher.
      2. can be cracked by letter frequency analysis.
      3. is the type of cipher used in popular newspaper cryptograms.
      4. has N! possible keys for an alphabet with N letters.
      5. is used by many banks to protect online transactions.

    8. Which of the following activities uses packet switching to deliver information on the Internet. Choose all that apply.
      1. Sending an email message.
      2. Doing a Google search.
      3. Downloading a song from a file sharing site.
      4. Creating an App Inventor app.
      5. Editing your Google portfolio.

    9. Consider the following lists :

      List1: [ [1, 2], [5, 6, 7, 8] ]
      List2: [1, 2]

      Which of the following is a true statment about these lists? (Choose all that apply.)
      1. length (List1) = 6
      2. The expression Select_list_item (Select_list_item ( List1, 2), 1) would return 5.
      3. The expression is_in_list( 5, List1) would return false.
      4. The expression is_in_list( List2, List1) would return true.
      5. length(List1) = length(List2)

    10. Suppose we have a TinyWebDb that stores data about students enrolled in certain courses, including their names, majors, and graduation year where each student is modeled as a list of the form [ name, major, year].
      TagValue
      courses [ cpsc110, math131, econ101]
      cpsc110[ [abby, bio, 2012], [billy, cs, 2013], [carla, cs, 2014] ]
      math131[ [ali, econ, 2012], [bob, econ, 2014], [carl, cs, 2013] ]
      econ101[ [al, econ, 2012], [brandon, econ, 2015] ]


      Which of the following is a true statement about the database shown here?
      1. The list [george, 2012, psych] would be an appropriate entry for a student in this database.
      2. The list [georgia, ahis, 2015] would be an appropriate entry for a student in this database.
      3. The expression Select_list_item (TinyWebDb.GetValue(cpsc110), 2) would return [billy, cs, 2013].
      4. The list [ sam, 2013, phil ] would be an appropriate value for a new tag named phil.
      5. The list [ [ sally, 2014, chem ] ] would be an appropriate value for a new tag named chem.