This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Massachusetts Institute of Technology 6.042J/18.062J, Spring 10 : Mathematics for Computer Science February 10 Prof. Albert R. Meyer revised February 3, 2010, 3 minutes Solutions to In-Class Problems Week 2, Wed. Problem 1. Prove by truth table that OR distributes over AND: [ P OR ( Q AND R )] is equivalent to [( P OR Q ) AND ( P OR R )] (1) Solution. [ P OR ( Q AND R )] T T T T T T T T F F T T F F T T T F F F F T T T T F F T F F F F F F T F F F F F [( P OR Q ) AND ( P OR R )] T T T T T T T T T T T T T F T T F T T T T T T F T T T F F T T T F T T F T T F F F F F F F F F T T F F F F F F F The two columns for the principle operator (underlined) are the same, and therefore the corre- sponding propositional formulas are equivalent. Creative Commons 2010, Prof. Albert R. Meyer . 2 Solutions to In-Class Problems Week 2, Wed. Problem 2. This problem 1 examines whether the following specifications are satisfiable : 1. If the file system is not locked, then (a) new messages will be queued. (b) new messages will be sent to the messages buffer. (c) the system is functioning normally, and conversely, if the system is functioning nor- mally, then the file system is not locked. 2. If new messages are not queued, then they will be sent to the messages buffer. 3. New messages will not be sent to the message buffer. (a) Begin by translating the five specifications into propositional formulas using four proposi- tional variables: L Q B N ::= ::= ::= ::= file system locked , new messages are queued , new messages are sent to the message buff system functioning normally . er , Solution. The translations of the specifications are: NOT L IMPLIES Q (Spec. 1.(a)) NOT L IMPLIES B (Spec. 1.(b)) NOT L IFF N (Spec. 1.(c)) NOT Q IMPLIES B (Spec. 2.) NOT B (Spec. 3.) (b) Demonstrate that this set of specifications is satisfiable by describing a single truth assignment for the variables L,Q,B,N and verifying that under this assignment, all the specifications are true. Solution. An assignment that works is L = True N = False Q = True B = False ....
View Full Document
This note was uploaded on 05/27/2011 for the course CS 6.042J taught by Professor Prof.albertr.meyer during the Spring '11 term at MIT.
- Spring '11
- Computer Science