Fcs fundamental computer science questions
Note remember page numbers
Propositional Logic
Introduction
The rules of logic give precise meaning to mathematical statements. These rules are used to
distinguish between valid and invalid mathematical arguments. Because a major goal of this book
is to teach the reader how to understand and how to construct correct mathematical arguments,
we begin our study of discrete mathematics with an introduction to logic.
Besides the importance of logic in understanding mathematical reasoning, logic has numerous applications to computer science. These rules are used in the design of computer circuits,
the construction of computer programs, the verification of the correctness of programs, and in
many other ways. Furthermore, software systems have been developed for constructing some,
but not all, types of proofs automatically. We will discuss these applications of logic in this and
later chapters.
Table 1 displays the truth table for the negation of a proposition p. This table has a row
for each of the two possible truth values of a proposition p. Each row shows the truth value of
¬p corresponding to the truth value of p for this row.
The negation of a proposition can also be considered the result of the operation of the
negation operator on a proposition. The negation operator constructs a new proposition from
a single existing proposition. We will now introduce the logical operators that are used to form
new propositions from two or more existing propositions. These logical operators are also called
connectives.
DEFINITION 2 Let p and q be propositions. The conjunction of p and q, denoted by p ∧ q, is the proposition
“p and q.” The conjunction p ∧ q is true when both p and q are true and is false otherwise.
Table 2 displays the truth table of p ∧ q. This table has a row for each of the four possible
combinations of truth values of p and q. The four rows correspond to the pairs of truth values
TT, TF, FT, and FF, where the first truth value in the pair is the truth value of p and the second
truth value is the truth value of q.
Note that in logic the word “but” sometimes is used instead of “and” in a conjunction. For
example, the statement “The sun is shining, but it is raining” is another way of saying “The sun
is shining and it is raining.” (In natural language, there is a subtle difference in meaning between
“and” and “but”; we will not be concerned with this nuance here.)
EXAMPLE 5 Find the conjunction of the propositions p and q where p is the proposition “Rebecca’s PC has
more than 16 GB free hard disk space” and q is the proposition “The processor in Rebecca’s
PC runs faster than 1 GHz.”
Solution: The conjunction of these propositions, p ∧ q, is the proposition “Rebecca’s PC has
more than 16 GB free hard disk space, and the processor in Rebecca’s PC runs faster than 1
GHz.” This conjunction can be expressed more simply as “Rebecca’s PC has more than 16 GB
free hard disk space, and its processor runs faster than 1 GHz.” For this conjunction to be true,
both conditions given must be true. It is false, when one or both of these conditions are false. ▲
DEFINITION 3 Let p and q be propositions. The disjunction of p and q, denoted by p ∨ q, is the proposition
“p or q.” The disjunction p ∨ q is false when both p and q are false and is true otherwise.
Table 3 displays the truth table for p ∨ q.
TABLE 2 The Truth Table for
the Conjunction of Two
Propositions.
p q p ∧ q
T T T
T F F
F T F
F F F
TABLE 3 The Truth Table for
the Disjunction of Two
Propositions.
The use of the connective or in a disjunction corresponds to one of the two ways the word
or is used in English, namely, as an inclusive or. A disjunction is true when at least one of the
two propositions is true. For instance, the inclusive or is being used in the statement
“Students who have taken calculus or computer science can take this class.”
Here, we mean that students who have taken both calculus and computer science can take the
class, as well as the students who have taken only one of the two subjects. On the other hand,
we are using the exclusive or when we say
“Students who have taken calculus or computer science, but not both, can enroll in this
class.”
Here, we mean that students who have taken both calculus and a computer science course cannot
take the class. Only those who have taken exactly one of the two courses can take the class.
Similarly, when a menu at a restaurant states, “Soup or salad comes with an entrĂ©e,” the
restaurant almost always means that customers can have either soup or salad, but not both.
Hence, this is an exclusive, rather than an inclusive, or.
EXAMPLE 6 What is the disjunction of the propositions p and q where p and q are the same propositions as
in Example 5?
Solution: The disjunction of p and q, p ∨ q, is the proposition
“Rebecca’s PC has at least 16 GB free hard disk space, or the processor in Rebecca’s PC
runs faster than 1 GHz.”
This proposition is true when Rebecca’s PC has at least 16 GB free hard disk space, when the
PC’s processor runs faster than 1 GHz, and when both conditions are true. It is false when both
of these conditions are false, that is, when Rebecca’s PC has less than 16 GB free hard disk
space and the processor in her PC runs at 1 GHz or slower. ▲
As was previously remarked, the use of the connective or in a disjunction corresponds
to one of the two ways the word or is used in English, namely, in an inclusive way. Thus, a
disjunction is true when at least one of the two propositions in it is true. Sometimes, we use or
in an exclusive sense. When the exclusive or is used to connect the propositions p and q, the
proposition “p or q (but not both)” is obtained. This proposition is true when p is true and q is
false, and when p is false and q is true. It is false when both p and q are false and when both
are true.
GEORGE BOOLE (1815–1864) George Boole, the son of a cobbler, was born in Lincoln, England, in
November 1815. Because of his family’s difficult financial situation, Boole struggled to educate himself while
supporting his family. Nevertheless, he became one of the most important mathematicians of the 1800s.Although
he considered a career as a clergyman, he decided instead to go into teaching, and soon afterward opened a
school of his own. In his preparation for teaching mathematics, Boole—unsatisfied with textbooks of his day—
decided to read the works of the great mathematicians. While reading papers of the great French mathematician
Lagrange, Boole made discoveries in the calculus of variations, the branch of analysis dealing with finding
curves and surfaces by optimizing certain parameters.
In 1848 Boole publishedThe Mathematical Analysis of Logic, the first of his contributions to symbolic logic.
In 1849 he was appointed professor of mathematics at Queen’s College in Cork, Ireland. In 1854 he published The Laws of Thought,
his most famous work. In this book, Boole introduced what is now called Boolean algebra in his honor. Boole wrote textbooks
on differential equations and on difference equations that were used in Great Britain until the end of the nineteenth century. Boole
married in 1855; his wife was the niece of the professor of Greek at Queen’s College. In 1864 Boole died from pneumonia, which
he contracted as a result of keeping a lecture engagement even though he was soaking wet from a rainstorm.
p q p ∨ q
T T T
T F T
F T T
F F F
Comments
Post a Comment