This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS174 Midterm 2 Spring 98 J. Canny April 7 This is a closedbook exam with 4 questions. The marks for each question are shown in parenthe ses, and the total is 60 points. Make sure you allocate enough time to attempt all the questions. You are allowed to use the formula sheet that will be handed out with the exam. No other notes are allowed. Calculators are OK. Write all your answers in this booklet. Good Luck! NAME SID Number 1 1. (20 points) Count the number of permutations (with repeats) of length k of the 5 characters a, b, c, d, e, if: (a) There are exactly two occurences of the substring “ab”? (b) There are exactly two occurrences of the substring “aa”? Note that the substring “aaa” counts as two occurrences. 2 2. (15 points) A program P is supposed to compute the inverse of an nxn input matrix A. Describe the steps of a probabilistic program checker that would run to check that the output is correct. You should analyze its running time....
View
Full
Document
This test prep was uploaded on 04/20/2008 for the course CS 174 taught by Professor Canny during the Spring '98 term at University of California, Berkeley.
 Spring '98
 Canny
 Computer Science

Click to edit the document details