Академический Документы
Профессиональный Документы
Культура Документы
IT 120
For Benedicto College Cebu use only
Course Description:
This is an introductory course in discrete mathematics. The goal of this course is to introduce
students to ideas and techniques from discrete mathematics that are widely used in science. This course
teaches the students techniques in how to think logically and mathematically and apply these in solving
problems. To achieve this goal, students will learn logic and proof, sets, functions and well as algorithm
and mathematical reasoning. Key topics involving relations, graphs, trees, and formal languages and
computability are covered in this course.
Logic may be defined as the science of reasoning. However, this is not to suggest that logic is an
empirical (i.e., experimental or observational) science like physics, biology, or psychology. Rather, logic is
a non-empirical science like mathematics. Also, in saying that logic is the science of reasoning, we do not
mean that it is concerned with the actual mental (or physical) process employed by a thinking entity
when it is reasoning. The investigation of the actual reasoning process falls more appropriately within
the province of psychology, neurophysiology, or cybernetics. Even if these empirical disciplines were
considerably more advanced than they presently are, the most they could disclose is the exact process
that goes on in a being's head when he or she (or it) is reasoning. They could not, however, tell us
whether the being is reasoning correctly or incorrectly. Distinguishing correct reasoning from incorrect
reasoning is the task of logic.
Logical reasoning (or just “logic” for short) is one of the fundamental skills of effective thinking. It
works by raising questions like:
These are all inferences: they’re connections between a given sentence (the “premise”) and some
other sentence (the “conclusion”). Inferences are the basic building blocks of logical reasoning, and
there are strict rules governing what counts as a valid inference and what doesn’t — it’s a lot like math,
but applied to sentences rather than numbers.
Example:
Just because the dog barked doesn’t mean there’s someone at the door.
There are also a few sentences that are probably true, such as:
The dog can sense (hear or smell) when someone is at the door.
Reasoning is a special mental activity called inferring, what can also be called making (or performing)
inferences. The following is a useful and simple definition of the word ‘infer’.
In place of word ‘premises’, you can also put: ‘data’, ‘information’, ‘facts’.
Examples of Inferences:
(2) You count 19 persons in a group that originally had 20, and you infer that someone is
missing.
Note carefully the difference between ‘infer’ and ‘imply’, which are sometimes confused. We
infer the fire on the basis of the smoke, but we do not imply the fire. On the other hand, the smoke
implies the fire, but it does not infer the fire. The word ‘infer’ is not equivalent to the word ‘imply’, nor is
it equivalent to ‘insinuate’.
The reasoning process may be thought of as beginning with input (premises, data, etc.) and
producing output (conclusions). In each specific case of drawing (inferring) a conclusion C from premises
P1, P2, P3, ..., the details of the actual mental process (how the "gears" work) is not the proper concern
of logic, but of psychology or neurophysiology. The proper concern of logic is whether the inference of C
on the basis of P1, P2, P3, ... is warranted (correct). Inferences are made on the basis of various sorts of
things – data, facts, information, states of affairs. In order to simplify the investigation of reasoning,
logic treats all of these things in terms of a single sort of thing – statements. Logic correspondingly treats
inferences in terms of collections of statements, which are called arguments. The word ‘argument’ has a
number of meanings in ordinary English. The definition of ‘argument’ that is relevant to logic is given as
follows.
Note that this is not a definition of a good argument. Also note that, in the context of ordinary
discourse, an argument has an additional trait, described as follows.
it is raining
I am hungry
2+2 = 4
God exists
On the other hand the following are examples of sentences that are not statements
Observe that whereas a statement is capable of being true or false, a question, or a command, or an
exclamation is not capable of being true or false.
Note that in saying that a statement is capable of being true or false, we are not saying that we
know for sure which of the two (true, false) it is. Thus, for a sentence to be a statement, it is not
necessary that humankind knows for sure whether it is true, or whether it is false. An example is the
statement ‘God exists’.
Now let us get back to inferences and arguments. Earlier, we discussed two examples of inferences. Let
us see how these can be represented as arguments. In the case of the smoke-fire inference, the
corresponding argument is given as follows.
Here the argument consists of two statements, ‘there is smoke’ and ‘there is fire’. The term
‘therefore’ is not strictly speaking part of the argument; it rather serves to designate the conclusion
(‘there is fire’), setting it off from the premise (‘there is smoke’). In this argument, there is just one
premise.
In the case of the missing-person inference, the corresponding argument is given as follows.
Here the argument consists of three statements – ‘there were 20 persons originally’, ‘there are
19 persons currently’, and ‘someone is missing’. Once again, ‘therefore’ sets off the conclusion from the
premises.
There are no hard and fast rules for telling when a collection of statements is intended to be an
argument, but there are a few rules of thumb. Often an argument can be identified as such because its
conclusion is marked. We have already seen one conclusion-marker – the word ‘therefore’. Besides
‘therefore’, there are other words that are commonly used to mark conclusions of arguments, including
‘consequently’, ‘hence’, ‘thus’, ‘so’, and ‘ergo’. Usually, such words indicate that what follows is the
conclusion of an argument.
Other times an argument can be identified as such because its premises are marked. Words that
are used for this purpose include: ‘for’, ‘because’, and ‘since’. For example, using the word ‘for’, the
smoke-fire argument (a1) earlier can be rephrased as follows.
Other times neither the conclusion nor the premises of an argument are marked, so it is harder to tell
that the collection of statements is intended to be an argument. A general rule of thumb applies in this
case, as well as in previous cases.
There are two basic types of logic, each defined by its own type of inference. They
correspond to the two categories in the example from section 1.
Induction is when the conclusion, based on the premises, is probably The answers are less
definitive than they are in deductive reasoning, but they are often more useful. Induction is our
only way of predicting what will happen in the future: we look at the way things are, and the
way they have been in the past, and we make an educated guess about what will probably
happen. But all predictions are based on probability, not certainty: for example, it’s extremely
probable that the sun will rise tomorrow morning. But it’s not certain, since there are all sorts of
catastrophes that could happen in between now and then.
Deductive reasoning, or deduction, is one of the two basic types of logical inference. A
logical inference is a connection from a first statement (a “premise”) to a second statement (“the
conclusion”) for which the rules of logic show that if the first statement is true, the second statement
should be true.
Specifically, deductions are inferences which must be true—at least according to the rules. If
you assume that the premise (first statement) is true, then you can deduce other things that have to be
true. These are called deductive conclusions.
Examples:
Each of these miniature arguments has two premises (joined by the “and”). These
are syllogisms, which provide a model for all deductive reasoning. It is also possible to deduce
something from just one statement; but it isn’t very interesting; for example, from the premise
“Socrates is a man,” you can certainly deduce that at least one man exists. But most deductions require
more than one premise.
You’ll also notice that each premise contains a very general claim–something about “all
men” or what the dog “always” does. This is an extremely common feature of deductions: their
premises are general and their conclusions are specific.
Premises are often unreliable. For example, in the real world no dog is 100% reliable, so you can’t be
certain that the premise “the dog always barks” is true. Therefore, even though the connection is a
logical certainty, the actual truth of each statement has to be verified through the messy, uncertain
process of observations and experiments.
There’s another problem with deductive reasoning, which is that deductive conclusions
technically don’t add any new information. For example, once you say “All men are mortal, and Socrates
is a man,” you’ve already said that Socrates is mortal. That’s why deductions have the power of logical
certainty: the conclusion is already contained within the premises. That doesn’t mean deductive
reasoning isn’t useful; it is useful for uncovering implications of what you already know—but not so
much for developing really new truths.
While deductive reasoning implies logical certainty, inductive reasoning only gives you
reasonable probability. In addition, they often move in opposite directions: where deductive reasoning
tends to go from general premises to specific conclusions, inductive reasoning often goes the other
way—from specific examples to general conclusions.
Induction allows us to take a series of observations (specific premises) and extrapolate from them to
new knowledge about what usually happens (general conclusion) or what will probably happen in the
future. This seems extremely useful!
Inductive reasoning, or induction, is one of the two basic types of inference. An inference
is a logical connection between two statements: the first is called the premise, while the second is called
a conclusion and must bear some kind of logical relationship to the premise.
Inductions, specifically, are inferences based on reasonable probability. If the premise is true, then the
conclusion is probably true as well. This is in contrast to deductive inferences, in which the
conclusion must be true if the premise is.
Premise: Every day so far, the sun has risen in the East and set in the West.
Conclusion: The sun will probably continue to rise in the East and set in the West.
Premise: Every time I use the can opener, my cat comes running into the kitchen.
Conclusion: The cat probably thinks I am opening a can of tuna or wet food.
Premise: Ben has visited four places today, and Sam has gone to those places soon after.
Conclusion: Sam is probably following Ben.
Often, Inductive reasoning produces a general conclusion from a specific premise. They start
with particular observations of a pattern, and then infer that there’s a general rule. For example,
everyone knows the general rule in Example #1: the sun always rises and sets the same way. That rule is
based on a huge accumulation of data points, not on a mathematical “proof” or derivation from other
abstract rules. This is a common feature of inductions, but it isn’t always present (for example, #2 is not
deriving a general rule).
Examples
Premise: 2+2=4
Conclusion: 4-2=2
Premise: The cat always comes running when I ring this bell, and she isn’t coming.
Although deductive reasoning is logically certain, they do not provide new information. In
each of these examples, the conclusion is already contained in the premises; the conclusion is
just another way of stating the premise. Thus, inductive reasoning is often more useful in science and
everyday life because they allow us to generate new ideas about the world, even if those ideas are
based on probability rather than certainty.
In addition, deductions are sometimes misleading in their certainty. That’s because the
conclusion will only be true if the premise is true, and in the real world things are usually too messy for
that. For example, in the third example we can be absolutely certain of the conclusion if the premise is
true; but are we sure that it is? There are probably no actual cats who are so reliable that we can say
they will always behave a certain way.
Logic is one of the main pillars of critical thinking. And there’s no question that critical thinking
would be impossible without some understanding of logical reasoning. However, there are many other
skills involved in critical thinking, such as:
Empathy, or the ability to imagine what someone else is feeling or experiencing. This is a crucial
skill for critical thinking, since it allows you to broaden your perspective and reflect on your
actions and beliefs. Empathy also makes you a better student of philosophy because it enables
you to put yourself in the author’s shoes and understand the argument from within.
Analogy, or noticing similarities and thinking them through. Analogies allow us to draw
conclusions about, for example, the similarity between our own time and some moment in
history, and thus try to make better decisions in the future. This skill is closely related to
inductive logic.
Creativity. Critical thinking is all about innovative problem-solving and coming up with new
ideas, so it’s heavily dependent on creativity. Just like a creative art, critical thinking depends on
assembling old parts in new ways, working inventively within constraints, and matching
moments of inspiration with hours of rigorous craft.
In the Inductive method of mathematical reasoning, the validity of the statement is checked by
a certain set of rules and then it is generalized. In other words, in the inductive method of reasoning, the
validity of the statement is checked by certain set of rules and then it is generalized. The principle of
mathematical induction uses the concept of inductive reasoning.
As inductive reasoning is generalized, it is not considered in geometrical proofs. Here, is an example which
will help to understand the inductive reasoning in maths better.
Example of Inductive Reasoning:
Statement: The cost of goods is Rs 10 and the cost of labour to manufacture the item is Rs. 5. The sales
price of the item is Rs. 50.
Reasoning: From the above statement, it can be said that the item will provide a good profit for the
stores selling it.
Deductive Reasoning
The principal of deductive reasoning is actually the opposite of the principle of induction. On the
contrary to inductive reasoning, in deductive reasoning, we apply the rules of a general case to a given
statement and make it true for particular statements. The principle of mathematical induction uses the
concept of deductive reasoning (contrary to its name). The below-given example will help to understand
the concept of deductive reasoning in maths better.
Example of Deductive Reasoning:
• Simple Statements
• Compound Statements
• If-Then Statements
Simple statements are those which are direct and do not include any modifier. These
statements are easiest to solve and does not require much reasoning. An example of a simple statement
is:
a: The Sun rises in the east
In this statement, there are no modifiers and thus it can be simply concluded as true.
Compound Statement
With the help of certain connectives, we can club different statements. Such statements made
up of two or more statements are known as compound statements. These connectives can be “and”,
“or”, etc.
With the help of such statements, the concept of mathematical deduction can be implemented
very easily. For a better understanding consider the following example:
Statement 1: Even numbers are divisible by 2
Statement 2: 2 is also an even number
These two statements can be clubbed together as:
Compound Statement: Even numbers are divisible by 2 and 2 is also an even number
Let us now find the statements out of the given compound statement:
Compound Statement: A triangle has three sides and the sum of interior angles of a triangle is 180°
The Statements for this statement is:
Statement 1: A triangle has three sides.
Statement 2: The sum of the interior angles of a triangle is 180°.
These both statements related to triangles are mathematically true. These two statements are
connected using “and.”
If-Then Statements
For deducing new statements or for making important deductions from the given statements three
techniques are generally used:
In this method, we generate new statements from the old ones by the rejection of the given
statement. In other words, we deny the given statement and express it as a new one. Consider the
following example to understand it better.
Statement 1: “Sum of squares of two natural numbers is positive.”
Now if we negate this statement then we have,
Statement 2: Sum of squares of two natural numbers is not positive.
Here, by using “not”, we denied the given statement and now the following can be inferred
from the negation of the statement:
There exist two numbers, whose squares do not add up to give a positive number.
This is a “false” statement as squares of two natural numbers will be positive.
From the above discussion, we conclude that if (1) is a mathematically acceptable statement
then the negation of statement 1 (denoted by statement 2) is also a statement.
Contradiction Method
In this method, we assume that the given statement is false and then try to prove the assumption
wrong.
Example:
a: The derivative of y=9x2+sinx w.r.t x is 18x+cosx.
For proving the validity of this statement, let us say that dy/dx ≠ 18x + cos x. We know that the
derivative of xn is given by n • xn−1. Therefore, the derivative of 9×2 is 18x and the derivative of sin x is
given by cos x.
Also,
d/dx(f(x)+g(x))=df(x)/dx+dg(x)/dx
Counter Statements
Another method for proving validity is to use a counter statement i.e. giving a statement or an
example where the given statement is not valid.
Example:
a: If x is a prime number then x is always odd.
To show that the given statement is false we will try to find a counter statement for this. We
know that 2 is a prime number i.e. it is divisible by only itself and 1. Also, 2 is the smallest even number.
Therefore, we can say that 2 is a prime number which is even. Hence, we can say that the statement “a”
is not true for all prime numbers, therefore, the given statement is not valid.
Question 1:
Consider the following set of statements and mention which of these are mathematically accepted
statements:
i) The Sun rises in the east.
ii) New Delhi is a country.
iii) Red rose is more beautiful than a yellow rose.
Solution:
When we read the first statement we can straightaway say that the first statement is definitely true and
the second one is definitely false. As far as the third statement is considered it may depend upon
perceptions of different people. Hence, it can be true for some people and at the same time false for
others. But such ambiguous statements are not acceptable for reasoning in mathematics.
Thus a sentence is only acceptable mathematically when it is either true or false but not both at the
same time. So, statement 1 and 2 are mathematically accepted statements while statement 3 is not
accepted mathematically.
Question 2: The sum of three natural numbers x,y and z is always negative.
Solution:
This statement is acceptable. It can never be true because all natural numbers are greater than zero and
therefore the sum of positive numbers can never be negative.
Question 3: The product of three real numbers x,y and z is always zero.
Solution:
• Negation
• Conjunction
• Disjunction
• The Conditional
Thus, each closed sentence in Example 1 has a truth value of either true or false as shown below.
Note that the third sentence is false since 2 is a prime number. It is possible that a closed sentence
will have different truth values at different times. This is demonstrated in Example 2 below
Example 2:
1. Today is Tuesday.
2. Bill Clinton was the 42nd President of the United States.
1. x + 3 = 7
2. She passed math.
3. y - 4 = 11
4. He is my brother.
Definition: An open sentence is a statement which contains a variable and becomes either true or
false depending on the value that replaces the variable.
Let's take another look at Example 3. This time we will Identify the variable for each open sentence.
1. x + 3 = 7 The variable is x.
2. She passed math. The variable is she.
3. y - 4 = 11 The variable is y.
4. He is my brother. The variable is he.
Now that we have identified the variables, we can analyze the meaning of these open sentences.
Sentence 1 is true if x is replaced by 4, but false if x is replaced by a number other than 4. Sentence 3
is true if y is replaced by 15, but false otherwise. Sentence 2 is either true or false depending on the
value of the variable "she." Similarly, sentence 4 is either true or false depending on the value of the
variable "he." In summary, the truth value of each open sentence depends on what value is used to
replace the variable in that sentence.
Example 4:
Example 5:
Definition: The negation of statement p is "not p." The negation of p is symbolized by "~p." The
truth value of ~p is the opposite of the truth value of p.
Solution:
x ~x
T F
F T
In Example 6, when x is true, ~x is false; and when x is false, ~x is true. From this truth table, we can
see that a statement and its negation have opposite truth values.
Solution:
p ~p
T F
F T
We can also negate a negation. For example, the negation of ~p is ~(~p) or p. This is illustrated in
the example below.
Example 8: Construct a truth table for the negation of p, and for the negation of not p.
Solution:
p ~p ~(~p)
T F T
F
F T
ii. Conjunction - is a compound statement formed by joining two statements with the connector
AND. The conjunction "p and q" is symbolized by p q. A conjunction is true when both of its
combined parts are true; otherwise it is false.
Example 1:
Solution: In Example 1, statement p represents the sentence, "Ann is on the softball team," and
statement q represents the sentence, "Paul is on the football team." The symbol is a logical
connector which means "and." Therefore, the compound statement p q represents the sentence,
"Ann is on the softball team and Paul is on the footballteam." The statement p q is a conjunction.
Now that we have defined a conjunction, we can apply it to Example 1. The conjunction p q is true
when both "Ann is on the softball team" and "Paul is on the football team" are true statements;
otherwise it is false. We can construct a truth table for the conjunction "p and q." In order to
list all truth values of p q, we start by listing every combination of truth values in the first two
columns of the truth table below.
p q p q
T T
T F
F T
F F
Next, we complete the last column according to the rules for conjunction listed above.
p q p q
T T T
T F F
F T F
F F F
Example 2:
a: A square is a quadrilateral.
Given:
b: Harrison Ford is an American actor.
Construct a truth table for the conjunction "a and b."
Problem:
Solution:
a b a b
T T T
T F F
F T F
F F F
Example 3:
Problem: Can we list all truth values for r s in a truth table?Why or why not?
In the next example we are given the truth values of each statement. We are then asked to
determine the truth values of the specified conjunctions.
Example 4:
A conjunction is formed by combining two statements with the connector "and." One of these
statements can be a negation as shown in the example below.
1. x and y
2. ~x and y
3. ~y and x
x y x y x y ~x ~x y x y ~y ~y x
T T T T T F F T T F F
T F F T F F F T F T T
F T F F T T T F T F F
F F F F F T F F F T F
iii. Disjunction - is a compound statement formed by joining two statements with the connector
OR. The disjunction "p or q" is symbolized by p q. A disjunction is false if and only if both
statements are false; otherwise it is true.
Example 1:
Definition: A disjunction is a compound statement formed by joining two statements with the
connector OR. The disjunction "p or q" is symbolized by p q. A disjunction is false if and only if both
statements are false; otherwise it is true. The truth values of p q are listed in the truth table below.
p q p q
T T T
T F T
F T T
F F F
Example 2:
a: A square is a quadrilateral.
Given:
b: Harrison Ford is an American actor.
a b a b
T T T
T F T
F T T
F F F
Example 3:
r: x is divisible by 2.
Given:
s: x is divisible by 3.
Solution: Each statement given in this example represents an open sentence, so the truth value of r
s will depend on the replacement values of x as shown below.
p: 12 is prime. false
r: 19 is composite. false
Problem: Write a sentence for each disjunction below. Then indicate if it is true or false.
1. a or b
2. a or not b
3. not a or b
a b a b a b ~b a ~b a b ~a ~a b
T T T T T F T T T F T
T F T T F T T T F F F
F T T F T F F F T T T
F F F F F T T F F T T
Students sometimes confuse conjunction and disjunction. Let's look at an example in which we
compare the truth values of both of these compound statements.
Problem: Construct a truth table for conjunction "x and y" and disjunction "x or y."
Solution:
x y x y x y
T T T T
T F F T
F T F T
F F F F
With a conjunction, both statements must be true for the conjunction to be true; but with a
disjunction, both statements must be false for the disjunction to be false. One way to remember
this is with the following mnemonic: 'And’ points up to the sand on top of the beach, while ‘or’
points down to the ore deep in the ground.
Example 1:
p: I do my homework.
Given:
q: I get my allowance.
Solution: In Example 1, p represents, "I do my homework," and q represents "I get my allowance."
The statement p q is a conditional statement which represents "If p, then q."
p q p q
T T T
T F F
F T T
F F T
In the truth table above, p q is only false when the hypothesis (p) is true and the conclusion (q) is
false; otherwise it is true. Note that a conditional is a compound statement. Now that we have
defined a conditional, we can apply it to Example 1.
p: I do my homework.
Given:
q: I get my allowance.
Solution: In Example 1, the sentence, "I do my homework" is the hypothesis and the sentence, "I get
my allowance" is the conclusion. Thus, the conditional p q represents the hypothetical
proposition, "If I do my homework, then I get an allowance." However, as you can see from the truth
table above, doing your homework does not guarantee that you will get an allowance! In other
words, there is not always a cause-and-effect relationship between the hypothesis and conclusion of
a conditional statement.
Example 2:
Problem: Write a b as a sentence. Then construct a truth table for this conditional.
Solution: The conditional a b represents "If the sun is made of gas, then 3 is a prime number."
a b a b
T T T
T F F
F F T
In Example 2, "The sun is made of gas" is the hypothesis and "3 is a prime number" is the conclusion.
Note that the logical meaning of this conditional statement is not the same as its intuitive meaning.
In logic, the conditional is defined to be true unless a true hypothesis leads to a false conclusion. The
implication of a b is that: since the sun is made of gas, this makes 3 a prime number. However,
intuitively, we know that this is false because the sun and the number three have nothing to do with
one another! Therefore, the logical conditional allows implications to be true even when the
hypothesis and the conclusion have no logical connection.
Example 3:
Solution: The conditional x y represents, "If Gisele has a math assignment, then David owns a car..
In the following examples, we are given the truth values of the hypothesis and the conclusion and
asked to determine the truth value of the conditional.
Example 4:
Solution: Since hypothesis r is false and conclusion s is true, the conditional r s is true.
Solution: Since hypothesis s is true and conclusion r is false, the conditional s r is false.
Example 6:
p: 72 = 49. true
Problem: Write each conditional below as a sentence. Then indicate its truth value.
2. q r If a rectangle does not have 4 sides, then Harrison Ford is an American actor. true
4. q s If a rectangle does not have 4 sides, then a square is not a quadrilateral. true
Note that in item 5, the conclusion is the negation of p. Also, in item 6, the hypothesis is the negation
of r.
Example 1:
p: A polygon is a triangle.
Given:
q: A polygon has exactly 3 sides.
Problem: Determine the truth values of this statement: (p q) (q p)
p q p q q p (p q) (q p)
T T
T T T
T
T F F F
F
F T T F
T
F F T T
In the truth table above, when p and q have the same truth values, the compound statement (p
q) (q p) is true. When we combine two conditional statements this way, we have
a biconditional.
Definition: A biconditional statement is defined to be true whenever both parts have the same truth
value. The biconditional operator is denoted by a double-headed arrow . The biconditional p
p q p q
T T T
T F F
F T F
F F T
In the truth table above, p q is true when p and q have the same truth values, (i.e., when either
both are true or both are false.) Now that the biconditional has been defined, we can look at a
modified version of Example 1.
Example 1:
p: A polygon is a triangle.
Given:
q: A polygon has exactly 3 sides.
Problem: What does the statement p q represent?
The statement p q represents the sentence, "A polygon is a triangle if and only if it
Solution:
has exactly 3 sides."
Note that in the biconditional above, the hypothesis is: "A polygon is a triangle" and the conclusion
is: "It has exactly 3 sides." It is helpful to think of the biconditional as a conditional statement that is
true in both directions.
Remember that a conditional statement has a one-way arrow ( ) and a biconditional statement
has a two-way arrow ( ). We can use an image of a one-way street to help us remember the
symbolic form of a conditional statement, and an image of a two-way street to help us remember
the symbolic form of a biconditional statement.
Example 2:
a: x + 2 = 7
Given:
b: x = 5
Problem: Write a b as a sentence. Then determine its truth values a b.
Solution: The biconditonal a b represents the sentence: "x + 2 = 7 if and only if x = 5." When x = 5,
both a and b are true. When x 5, both a and b are false. A biconditional statement is defined to be
true whenever both parts have the same truth value. Accordingly, the truth values of a b are
listed in the table below.
a b a b
T T T
T F F
F T F
F F T
Example 3:
x: I am breathing
Given:
y: I am alive
Problem: Write x y as a sentence.
Example 4:
Solution: r s represents, "You passed the exam if and only if you scored 65% or higher."
Mathematicians abbreviate "if and only if" with "iff." In Example 5, we will rewrite each sentence
from Examples 1 through 4 using this abbreviation.
When proving the statement p iff q, it is equivalent to proving both of the statements "if p, then q"
and "if q, then p." (In fact, this is exactly what we did in Example 1.) In each of the following
examples, we will determine whether or not the given statement is biconditional using this method.
Example 6:
p: x + 7 = 11
Given:
q: x = 5
Problem: Is this sentence biconditional? "x + 7 = 11 iff x = 5."
Solution:
The statement p q is false by the definition of a conditional. The statement q p is also false by
the same definition. Therefore, the sentence "x + 7 = 11 iff x = 5" is not biconditional.
Example 7:
Given:
r: A triangle is isosceles.
Problem:
Is this statement biconditional? "A triangle is isosceles if and only if it has two congruent (equal)
sides."
LEARNING 6: Proposition A declarative sentence that is either true or false, but not both.
Examples:
Non-examples:
Compound Proposition
One that can be broken down into more primitive propositions. E.g.,
• If it is sunny outside then I walk to work; otherwise I drive, and if it is raining then I carry my
umbrella.
If it is sunny outside then I walk to work; otherwise I drive, and if it is raining then I carry my
umbrella.
Logical Connectives
If it is sunny outside then I walk to work; otherwise I drive, and if it is raining then I carry my
umbrella.
Consider a connective that combines two propositions, e.g. implication “p => q”. There are
exactly four possibilities:
• p is true, q is true
• p is true, q is false
• p is false, q is true
• p is false, q is false
Proposition Logic
Is concerned with statements to which the truth values, “true” and “false”, can be assigned. The
purpose is to analyze these statements either individually or in a composite manner.
OR (∨∨) − The OR operation of two propositions A and B (written as A∨BA∨B) is true if at least any of the
propositional variable A or B is true.
A B A∨B
Connectives
AND (∧∧) − The AND operation of two propositions A and B (written as A∧BA∧B) is true if both the
propositional variable A and B is true.
A B A∧B
Negation (¬¬) − The negation of a proposition A (written as ¬A¬A) is false when A is true and is true when A
is false.
The truth table is as follows −
A ¬A
True False
False True
Implication / if-then (→→) − An implication A→BA→B is the proposition “if A, then B”. It is false if A is true
and B is false. The rest cases are true.
The truth table is as follows −
A B A→B
If and only if (⇔⇔) − A⇔BA⇔B is bi-conditional logical connective which is true when p and q are same,
i.e. both are false or both are true.
The truth table is as follows −
A Tautology is a formula which is always true for every value of its propositional variables. A compound
statement, that is always true regardless of the truth value of the individual statements, is defined to be
a tautology.
Example − Prove [(A→B)∧A]→B[(A→B)∧A]→B is a tautology
The truth table is as follows −
A B A→B (A → B) ∧ A [( A → B ) ∧ A] → B
Tautologies
Each sentence in Example 1 is the disjunction of a statement and its negation Each of these sentences can be
written in symbolic form as p ~p. Recall that a disjunction is false if and only if both statements are false;
otherwise it is true. By this definition, p ~p is always true, even when statement p is false or statement ~p
is false! This is illustrated in the truth table below:
p ~p p ~p
T F T
F T T
The compound statement p ~p consists of the individual statements p and ~p. In the truth table above, p
~p is always true, regardless of the truth value of the individual statements. Therefore, we conclude that p
~p is a tautology.
Example 2: Is (p q) p a tautology?
p q p q (p q) p
T T T T
T F F T
F T F T
F F F T
Solution: The compound statement (p q) p consists of the individual statements p, q, and p q. The
truth table above shows that (p q) p is true regardless of the truth value of the individual statements.
Therefore, (p q) p is a tautology.
Example 3: Is x (x y) a tautology?
x y x y x (x y)
T T T T
T F T T
F T T T
F F F T
Example 4: Is ~b b a tautology?
b ~b ~b b
T F T
F T F
Example 5: Is (p q) (p q) a tautology?
p q (p q) (p q) (p q) (p q)
T T T T T
T F T F F
F T T F F
F F F F T
p q p q (p q) p [(p q) p] p
T T T T T
T F F F T
F T T F T
F F T F T
Example 7: Is (r s) (s r) a tautology?
r s r s s r (r s) (s r)
T T T T T
T F F T F
F T T F F
F F T T T
A Contradiction is a formula which is always false for every value of its propositional variables.
Example − Prove (A∨B)∧[(¬A)∧(¬B)](A∨B)∧[(¬A)∧(¬B)] is a contradiction
The truth table is as follows −
A B A∨B ¬A ¬B (¬ A) ∧ ( ¬ B) (A ∨ B) ∧ [( ¬ A) ∧ (¬ B)]
A Contingency is a formula which has both some true and some false values for every value of its
propositional variables.
A B A∨B ¬A (A ∨ B) ∧ (¬ A)
As we can see every value of (A∨B)∧(¬A)(A∨B)∧(¬A) has both “True” and “False”, it is a contingency.
German mathematician G. Cantor introduced the concept of sets. He had defined a set as a collection of
definite and distinguishable objects selected by the means of certain rules or description.
Set theory forms the basis of several other fields of study like counting theory, relations, graph theory and
finite state machines. In this chapter, we will cover the different aspects of Set Theory.
Set - Definition
A set is an unordered collection of different elements. A set can be written explicitly by listing its elements
using set bracket. If the order of the elements is changed or any element of a set is repeated, it does not
make any changes in the set.
Representation of a Set
Types of Sets
Sets can be classified into many types. Some of which are finite, infinite, subset, universal, proper,
singleton set, etc.
Finite Set
Infinite Set