More sample questions for COMP-424 midterm exam

Similar documents
Sample questions for COMP-424 final exam

Course Staff. Textbook

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

These are all examples of declarative compound sentences.

Overview. 1. Introduction to Propositional Logic. 2. Operations on Propositions. 3. Truth Tables. 4. Translating Sentences into Logical Expressions

Propositional Logic Not Enough

Introduction Propositional Logic

Quantifiers and Statements

CISC681/481 AI Midterm Exam

Midterm II. Introduction to Artificial Intelligence. CS 188 Spring ˆ You have approximately 1 hour and 50 minutes.

Announcements. Problem Set 6 due next Monday, February 25, at 12:50PM. Midterm graded, will be returned at end of lecture.

Advanced Topics in LP and FP


Comp487/587 - Boolean Formulas

Self-reproducing programs. And Introduction to logic. COS 116, Spring 2012 Adam Finkelstein

Final exam of ECE 457 Applied Artificial Intelligence for the Spring term 2007.

Homework 1 2/7/2018 SOLUTIONS Exercise 1. (a) Graph the following sets (i) C = {x R x in Z} Answer:

CS 370. FCFS, SJF and Round Robin. Yashwanth Virupaksha and Abhishek Yeluri

Methods for finding optimal configurations

Recall that the expression x > 3 is not a proposition. Why?

CSE 546 Final Exam, Autumn 2013

1 [15 points] Search Strategies

CS221 Practice Midterm

Complexity Theory Part I

Mat 243 Exam 1 Review

Algorithms. Outline! Approximation Algorithms. The class APX. The intelligence behind the hardware. ! Based on

Instructional Materials for the WCSD Math Common Finals

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Outline. policies for the first part. with some potential answers... MCS 260 Lecture 10.0 Introduction to Computer Science Jan Verschelde, 9 July 2014

CHAPTER 4 CLASSICAL PROPOSITIONAL SEMANTICS

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Mathematical Logic Part Three

Mathematical Logic Part Three

Parts 3-6 are EXAMPLES for cse634

(Note that these points are to give a relative sense of the weights on the final exam and have no bearing on extra credit points)

Mathematical Logic Part Three

TEST 1 REVIEW. Lectures 1-5

Zebo Peng Embedded Systems Laboratory IDA, Linköping University

Lecture 20: conp and Friends, Oracles in Complexity Theory

Midterm: CS 6375 Spring 2015 Solutions

Statements and Quantifiers

COMP 2600: Formal Methods for Software Engineeing

ECS 20: Discrete Mathematics for Computer Science UC Davis Phillip Rogaway June 12, Final Exam

Logical Agents. September 14, 2004

~ p is always false. Based on the basic truth table for disjunction, if q is true then p ~

Discrete Structures for Computer Science

Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only

Finding optimal configurations ( combinatorial optimization)

Be able to define the following terms and answer basic questions about them:

CS1800 Discrete Structures Spring 2018 February CS1800 Discrete Structures Midterm Version A

CS 154 Introduction to Automata and Complexity Theory

cse541 LOGIC FOR COMPUTER SCIENCE

Algorithms Exam TIN093 /DIT602

Math.3336: Discrete Mathematics. Nested Quantifiers

1. True/False (40 points) total

CSC 4510 Machine Learning

Word Problems. Mathematics Division, IMSP, UPLB

19. Logic constraints, integer variables

COS 341: Discrete Mathematics

Property Checking of Safety- Critical Systems Mathematical Foundations and Concrete Algorithms

CS 374: Algorithms & Models of Computation, Spring 2017 Greedy Algorithms Lecture 19 April 4, 2017 Chandra Chekuri (UIUC) CS374 1 Spring / 1

Chapter 5: HYPOTHESIS TESTING

Informatics 1 - Computation & Logic: Tutorial 1

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

: Approximation and Online Algorithms with Applications Lecture Note 2: NP-Hardness

Math/EECS 1028M: Discrete Mathematics for Engineers Winter Suprakash Datta

P, NP, NP-Complete, and NPhard

Solutions to Homework I (1.1)

Linear Algebra. Introduction. Marek Petrik 3/23/2017. Many slides adapted from Linear Algebra Lectures by Martin Scharlemann

COM S 330 Homework 08 Solutions. Type your answers to the following questions and submit a PDF file to Blackboard. One page per problem.

Logic: First Order Logic

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Exam Computability and Complexity

CS 340: Discrete Structures for Engineers

Negations of Quantifiers

Section 2.3: Statements Containing Multiple Quantifiers

Chapter 2 (Operations with Integers) Bringing It All Together #1

Announcements. Midterm Review Session. Extended TA session on Friday 9am to 12 noon.

ORF 363/COS 323 Final Exam, Fall 2017

CS154 Final Examination

Approximation Algorithms

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Strong AI vs. Weak AI Automated Reasoning

P Q (P Q) (P Q) (P Q) (P % Q) T T T T T T T F F T F F F T F T T T F F F F T T

Lesson 15: Solution Sets of Two or More Equations (or Inequalities) Joined by And or Or

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

PS10.3 Logical implications

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lecture 1 : Introduction

Supporting hyperplanes

Solving and Graphing Inequalities Joined by And or Or

CSE 311: Foundations of Computing I. Lecture 1: Propositional Logic

Section A (not in the text) Which of the following are statements? Explain. 3. The President of the United States in 2089 will be a woman.

CSEP 521 Applied Algorithms. Richard Anderson Winter 2013 Lecture 1

Hoare Examples & Proof Theory. COS 441 Slides 11

Andrew/CS ID: Midterm Solutions, Fall 2006

Review for the Midterm Exam

Teacher Road Map for Lesson 10: True and False Equations

Introduction to Sets and Logic (MATH 1190)

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

Logic-based Benders Decomposition

Transcription:

More sample questions for COMP-424 midterm exam Doina Precup Note that the exam also has questions similar to those on the homeworks. 1. Search algorithms (a) Suppose you have an admissible heuristic h. Is h 2 admissible? Is h admissible? Would using any of these alternatives be better or worse than using h in the A algorithm? Answer: h 2 may not be admissible, because h 2 h when h 1, so it may exceed the optimal distance to goal. h h for h 1, so it is admissible (assuming integer values for the heuristic, which is typical). It will likely work worse than h, though, because its estimate is farther from the optimal value (so it is a worse estimate of the cost-to-go). (b) Suppose you were using a genetic algorithm and you have the following two individual, represented as strings of integers: 1324421 and 2751421 Show the result of performing crossover between the 3rd and 4th digit. Answer: 1321421 and 2754421 (c) Which of the following statements, contrasting genetic algorithms and simulated annealing, are true? 2. Bayes nets i. Genetic algorithms are used for minimization problems while simulated annealing is used for maximization problems Answer: False ii. Genetic algorithms maintain several possible solutions, whereas simulated annealing works with one solution. Answer: True iii. Genetic algorithms maintain one solution, whereas simulated annealing maintains several possible solutions. Answer: False iv. Simulated annealing is guaranteed to produce the best solution, while genetic algorithms do not have such a guarantee. Answer: True 1

The Starfleet academy has decided to create a class of android students. 90% of these androids study hard for their exams. Out of the androids who study hard for an exam, 80% get an A. Out of the androids who do not study, only half get an A. Androids who study hard have a 75% probability of depleting their battery in less that a day. Androids who do not study hard have a longer battery life: only 10% of them deplete their batteries within the next day. (a) Draw a Bayes net describing the problem statement above. Answer: Let A be the random variable denoting whether the Android gets an A in the exam, S denote whether he studies, and B denote whether the battery gets depleted in less than a day. The Bayes net is as follows: (b) You notice that your android has depleted its battery in less than a day. What is the probability that it will get an A on the exam it had yesterday? Answer: The evidence is B = 1 and you want to compute P (A = 1 B = 1). We can do this as follows: P (A = 1, B = 1) P (A = 1 B = 1) = P (B = 1) P (A = 1, B = 1) = P (A = 1, B = 1, S = 1) + P (A = 1, B = 1, S = 0) = P (S = 1)P (A = 1 S = 1)P (B = 1 S = 1) + P (S = 0)P (A = 1 S = 0)P (B = 1 S = 0) = 0.9 0.75 0.8 + 0.1 0.1 0.5 P (A = 0, B = 1) = P (A = 0, B = 1, S = 1) + P (A = 0, B = 1, S = 0) = P (S = 1)P (A = 0 S = 1)P (B = 1 S = 1) + P (S = 0)P (A = 0 S = 0)P (B = 1 S = 0) = 0.9 0.75 0.2 + 0.1 0.1 0.5 P (B = 1) = P (A = 1, B = 1) + P (A = 0, B = 1) You can now finalize the calculations. (c) Your friend does not believe that androids are much good at studying. He says he is willing to pay you $10 if your android gets an A in the class. Recharging the battery costs $5 Suppose that you could program your android to study or not to study at will (this is not very ethical, but it is technically feasible). What is the best course of action for you? 2

3. Logic Answer: If you program the android to study, it will have probability P (A = 1 S = 1) to get an A and probability P (B = 1 S = 1) to get its battery depleted. Your total utility is: 10 (A = 1 S = 1) + ( 5) P (B = 1 S = 1) = 10 0.8 5 0.75 = 4.25. If the android does not study, the utility is 10 P (A = 1 S = 0) + ( 5) P (B = 1 S = 0) = 10 0.5 5 0.1 = 4.5. So the optimal course of action (which maximizes utility) is to program the android to not study. (a) Translate the following sentences in first-order logic: i. All citizens of Fredonia speak the same language. ii. The Fredonese language has two dialects iii. Each citizen of Fredonia speaks exactly one of the two dialects (b) Translate the knowledge base above into conjunctive normal form (using Skolem constants and functions as appropriate) Answer: The first statement translates to: xcitizen(x, F redonia) Speaks(x, F redonese) The second statement translates to: which can be skolemized as: x ydialect(x, F redonese) Dialect(y, F redonese) Dialect(X0, F redonese) Dialect(X1, F redonese) For the third statement, using the skolemization above, we have: xcitizen(x, F redonia) ((Speaks(x, X0) Speaks(x, X1)) ( Speaks(x, X0) Speaks(x, X1))) 4. Problem formulation You have been hired by a scientific computing center to help them manage the requests they get. Presently, m scientists have each submitted a list of n computations that they would like to complete. The center has 3 machines: a parallel supercomputer, a quantum computer and a cluster of regular computers. Each scientist submits, with each job, a list of the computers that would be suitable to execute it. There are m k < mn days on which to perform computations before the center closes for Christmas. To be fair, at least one computation from each scientist s list has to be performed. Each computation takes exactly one day. Each computer can only do one computation on any given day. 3

(a) Describe this as a constraint satisfaction problem. Clearly specify what are the variables, the domains of the variables and the constraints. Answer: Let C ij, i = 1,... m, j = 1... n be the list of computations, where the index i indicates the scientist who submitted the computation and j is the number of the computation. These are the variables of the problem. The domain of each variable is ({0} D ij ), where 0 indicates this computation is not scheduled, D is the list of computers on which the computation can be done (D ij {1, 2, 3}). Let T ij be a second set of variables with domain T = {1, 2,... k} - the set of days available. If C ij 1 then T ij is the day scheduled for the computation. The fairness constraint can be expressed as: n j=1 C ij > 0 i. The timing constraint is more complicated: if T ij = T i j = T i j then C ij C i j C i j C i j C ij C i j (b) Your manager also wants to minimize the total time in which the machines are idle (keeping all the same constraints as above). What kind of problem do you have? Specify one suitable solution method and motivate your choice in one sentence. Answer: This is now an optimization problem, which could be solved, e.g. by simulated annealing or genetic algorithms (see lecture slides for reasons). 5. Logic (a) Translate the following sentences in first-order logic. i. Star Trek, Star Wars and The Matrix are science fiction movies. Answer: SciF i(start rek) SciF i(startw ars) SciF i(m atrix) ii. Every AI student loves Star Trek or Star Wars. Answer: xaistudent(x) Loves(x, StarT rek) Loves(x, StartW ars) iii. Some AI students do not love Star Trek. Answer: xaistudent(x) Loves(x, StarT rek) iv. All AI students who love Star Trek also love The Matrix. Answer: xaistudent(x) Loves(x, StarT rek) Loves(x, M atrix) v. Every AI student loves some science fiction movie. Answer: xaistudent(x) ( yscif i(y) Loves(x, y) vi. No science fiction movie is loved by all AI students. Answer: ( yscif i(y) ( xaistudent(x) Loves(x, y))) vii. There is an AI student who loves all science fiction movies. Answer: xaistudent(x) ( yscif i(y) Loves(x, y)) (b) Based on the knowledge base above, prove formally that there exists some AI student who loves Star Wars. Answer: We can re-write the first statement as: AIStudent(x) Loves(x, StarT rek) Loves(x, StartW ars) The second statement can be re-written through skolemization as: AIStudent(X0) Loves(X0, StarT rek) 4

By unification and resolution between these two statements, we get: which proves the conclusion Loves(X0, StartW ars) 5