| CS 242, Section 002 | Sonoma State University | Spring, 2026 |
|
Discrete Structures for Computer Science
|
||
|
Instructor: Henry M. Walker
Lecturer, Sonoma State University | ||
Notes:
Using Propositions and Laws of Propositional Logic:
Note: (This problem is motivated by a sign on a stairway
door in a hotel hallway, in the Washington, D.C. area.)
The
following six English statements are to be considered as
propositions and applying to a given person on an upper-story
floor in a hotel at a specified time:
Next consider the following compound propositions (CPs), again considered as applying to a given person on an upper-story floor in a hotel at a specified time:
Based on these propositions in English, answer the following questions.
Translate each of the compound propositions (i.e., CP1, . . . CP6) from English into formal statements with the letters P, Q, R, S, and/or T and the logical operations ¬, ∨, ∧, and →, and using parentheses as needed. (Hint: CP1 translates simply to ¬P.)
Form the expression CP4 ∧CP5 ∧ CP6, and use the Laws of Propositional logic from (in Section 1.5) to show that if there is a fire in the hotel, then the person cannot exit using the elevator.
Note: For this argument, you must proceed step by step, following the same format utilized in the Participation Activities for Section 1.5.
Extending the approach of part b, form the overall expression indicating all compound propositions are true.
and apply the Laws of Propositional Logic (Table 1.5.1 in the zyBook) step by step to find an expression equivalent to this extended proposition, but as simple as possible. (For example, can this expression be simplified to an expression with just one or two propositions?)
Note: For this problem, you must proceed step by step, following the same format utilized in the Participation Activities for Section 1.5.
Based on your answer to part c, what options are available to a person located on an upper floor of the hotel during a fire? Explain briefy.
(Optional, rhetorical question, which you may or may not decide to answer—no points are associated with this answer) If a door is to remain closed at all times, what is the point of having the door?
Performance of C and C++ Programs, Continued):
Background/Motivation
Problem 1 of Assignment 1
included these propositions for a given program A.
Rewrite propositions P, Q, R, and s, as predicates, based on a variable x, with domain ranging over all programs.
Now consider the following following functions
With these predicates and functions defined, express the following statements as compound predicates.
Stating Propositions with Quantifiers: The Intermediate
Value Theorem:
Suppose y = f(x) is a continuous function on the interval [a, b],
where f(x), a and b are defined globally, so do not need to be
defined or bound within a predicate.
Write a predicate with parameters/variables c and d that states the
Intermediate Value Theorem:
If a ≤ c < d ≤ b and if
f(c) and f(d) have opposite signs (e.g., f(c) > 0 and f(d) <
0, or f(c) < 0 and f(d) > 0), then there is a value w between
c and d where f(w) = 0.
|
created October 25, 2025 revised October-November, 2025 |
|
| For more information, please contact Henry M. Walker at walker@cs.grinnell.edu. |