CSCI 587 Test1 February 18, 1997

  1. Design a Huffman code for the following symbols with the given frequencies.
    Symbol frequency
    a .3
    b .24
    c .2
    d .16
    e .1

    First combine d and e yielding a cumulative Frequency of .26
    Next combine b and c yielding a cumulative Frequency of .44
    Next combine a and (d e) yielding a cumulative Frequency of .56
    Next combine (a d e) and (b c) yielding a cumulative Frequency of 1.00
    This yoelds the tree in list notation
    (1.00 (.56 (.3=a) (.26 (.16=d)(.1=e)))
          (.44 (.24=b) (.2=c))
    )
    
    And then using the convention of 0 to the left 1 to the right
    
    Symbol Huffman-code
    a       00
    b       10
    c       11
    d       010
    e       011
    There are other solutions based on the convention for labeling left and right
    but all of them will have the lengths of the ones above.
    
  2. In the formulation of rules for Eliza explain how the rank is used. Give Eliza rules to handle both of the responses below:
    My brother gave me a birthday present.
    Oh was there a birthday party.
    My brother gave me a headache.
    Tell me more about your family.

  3. Given the grammar below
       S    -> NP VP
       NP   -> art ADJL noun | art noun
       ADJL -> adj ADJL | adj
       VP   -> verb NP | verb
       
    1. Give a parse tree for ``The big blue marble is the earth.''

    2. Give an example of a noun phrase that is not handled by the grammar above.

    3. Show how to extend the grammar to handle this example.

  4. Given the prolog database:
    father(sam, bill)
    father(ben, bill)
    father(bill, joe)
    father(mary, joe)
    mother(ralph, mary)
    parent(X,P) :- father(X,P).
    parent(X,P) :- mother(X,P).
    sibling(X,Y) :- parent(X,P), parent(Y,P).
    
    1. What would the response be to the goal ?- father(X,bill).?

    2. Give a cousin rule in prolog, where for the purpose of this question cousins are individuals that have parents that are siblings.

    1. What is a concordance?

    2. Describe briefly the data structures and algorithms used to construct a concordance.

    3. What is meant by authorship analysis?

    4. Explain one approach used in authorship analysis.

    1. Encode USC using ROT5

    2. Describe an approach to deciphering a substitution cipher message.

  5. Consider the sentence ``the blue waters are cold.''
    1. What lexical ambiguity occurs in this sentence?

    2. Show the trace of the top down parse of this sentence. Do only 6 steps where a step is a match of a lexical item or the application of a rule.

  6. In RSA encryption given the choices p = 7 and q = 11:
    1. What is n?

    2. What is phi(n)?

    3. Given e = 13, exteuclidean(77, 13) = 37 and exteuclidean(60, 13) = 6 (you need only one of these values), What is the public key?

    4. What is the private key?

    5. Explain how the encoding would work.

    6. Explain how the decoding would work.

  7. Extra Credit Describe the operation of the Enigma machine