Chris Pollett> CS267
( Print View )

Student Corner:
[Submit Sec1]
[Grades Sec1]

[Lecture Notes]
[Discussion Board]

Course Info:
[Texts & Links]
[Description]
[Course Outcomes]
[Outcomes Matrix]
[Course Schedule]
[Grading]
[Requirements/HW/Quizzes]
[Class Protocols]
[Exam Info]
[Regrades]
[University Policies]
[Announcements]

HW Assignments:
[Hw1] [Hw2] [Hw3]
[Hw4] [Hw5] [Quizzes]

Practice Exams:
[Midterm] [Final]

CS267 Spring 2022Practice Midterm 1

Studying for one of my tests does involve some memorization. I believe this is an important skill. Often people waste a lot of time and fail to remember the things they are trying to memorize. Please use a technique that has been shown to work such as the method of loci. Other memorization techniques can be found off the Wiki Page for Moonwalking with Einstein. Given this, to study for the midterm I would suggest you:

  • Know how to do (by heart) all the practice problems.
  • Go over your notes at least three times. Second and third time try to see how much you can remember from the first time.
  • Go over the homework problems.
  • Try to create your own problems similar to the ones I have given and solve them.
  • Skim the relevant sections from the book.
  • If you want to study in groups, at this point you are ready to quiz each other.

The practice midterm is below. Here are some facts about the actual midterm: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) One problem (less typos) on the actual test will be from the practice test.

  1. Define the following terms: (a) probability ranking principle, (b) specificity, (c) exhaustivity, (d) novelty.
  2. Consider the sentence "two bees or not two fleas". What is `M_1(bees|two)`? Describe how a first order model can be smoothed by a zero'th order model.
  3. Give an example Markov Model in which it is possible to generate the string "The good and the bad" from state 1. Show how to calculate the probability of this phrase from state 1 in your model.
  4. Give the pseudo-code for the nextPhrase(t[1],t[2], .., t[n], position) algorithm from class. Give its run time under different implementations of the next(t,position) function (no need for proofs).
  5. Give the PHP code to read in a file counter.txt which stores an integer as a string. Your program should then output to the default output stream this value, increment the value, and write it back to disk.
  6. Assume we have a fully positional index. Give pseudo code for an implementation of next(t, n:m) that uses galloping search where appropriate.
  7. Give pseudo-code for the proximityRank algorithm from class together with a short example showing how it would process a score a query for a illustrative two document corpus.
  8. Define or give the equation of the following concepts: (a) TF-IDF, (b) cosine-similarity, (c) docRight(Q, u), (d) precision@k.
  9. Briefly explain how autoloading works in PHP. What is Composer? Give an example of a couple of its commands.
  10. Suppose `n=5` what would be the character n-grams for the word fenestrate? (1pt) What is stopping? (1pt) What is stemming (1pt)? Give an example of the kinds of rules used by a Porter stemmer.