0% found this document useful (0 votes)
69 views

l1 DM Eng 2016

1. Discrete mathematics is the study of discrete (distinct, unconnected) objects and processes involving a finite number of steps. It is important because computing machines store and manipulate information discretely. 2. The course develops mathematical maturity through logical reasoning and foundations for computer science courses. 3. Logic specifies the meaning of mathematical statements and is the basis of mathematical reasoning and applications in computing.

Uploaded by

mor
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

l1 DM Eng 2016

1. Discrete mathematics is the study of discrete (distinct, unconnected) objects and processes involving a finite number of steps. It is important because computing machines store and manipulate information discretely. 2. The course develops mathematical maturity through logical reasoning and foundations for computer science courses. 3. Logic specifies the meaning of mathematical statements and is the basis of mathematical reasoning and applications in computing.

Uploaded by

mor
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

Lecture 1

What is discrete mathematics? Discrete mathematics is the part of mathematics devoted to the study
of discrete objects (Here discrete means consisting of distinct or unconnected elements). More
generally, discrete mathematics is used whenever objects are counted, when relationships between
finite (or countable) sets are studied, and when processes involving a finite number of steps are
analyzed. A key reason for the growth in the importance of discrete mathematics is that information
is stored and manipulated by computing machines in a discrete fashion.
There are several important reasons for studying discrete mathematics. First, through this course you
can develop your mathematical maturity, that is, your ability to understand and create mathematical
arguments. You will not get very far in your studies in the mathematical sciences without these
skills. Second, discrete mathematics is the gateway to more advanced courses in all parts of the
mathematical sciences. Discrete mathematics provides the mathematical foundations for many
computer science courses, including data structures, algorithms, database theory, automata theory,
formal languages, compiler theory, computer security, and operating systems. Students find these
courses much more difficult when they have not had the appropriate mathematical foundations from
discrete math.

Logic
The rules of logic specify the precise meaning of mathematical statements. For instance, the rules
give us the meaning of such statements as, “There exists an integer that is greater than 100 that is a
power of 2”, and “For every integer n the sum of the positive integers not exceeding n is ”.
Logic is the basis of all mathematical reasoning, and it has practical applications to the design of
computing machines, to artificial intelligence, to computer programming, to programming languages,
and to other areas of computer science.

Propositions
A proposition is a statement that is either true or false, but not both.
Example. All the following statements are propositions.
1. Washington, D.C., is the capital of the United States of America.
2. Toronto is the capital of Canada.
3. 1 + 1 = 2.
4. 2 + 2 = 3.
Propositions 1 and 3 are true, whereas 2 and 4 are false.
Some sentences that are not propositions are given in the next example:
Example. Consider the following sentences:
1. What time is it?
2. Read this carefully.
3. x + 1 = 2.
4. x + y = z.
Sentences 1 and 2 are not propositions because they are not statements. Sentences 3 and 4 are not
propositions because they are neither true nor false, since the variables in these sentences have not
been assigned values.
Letters are used to denote propositions, just as letters are used to denote variables. The conventional
letters used for this purpose are p, q, r, s, … The truth value of a proposition is true, denoted by T, if
it is a true proposition and false, denoted by F, if it is a false proposition.
We now turn our attention to methods for producing new propositions from those that we already
have. Many mathematical statements are constructed by combining one or more propositions. New
propositions, called compound propositions, are formed from existing propositions using logical
operators.

Let p be a proposition. The statement “It is not the case that p” is another proposition, called the
negation of p. The negation of p is denoted by p. The proposition p is read “not p”.
Example. Find the negation of the proposition “Today is Friday”.
Solution: The negation is “It is not the case that today is Friday”. This negation can be more simply
expressed by “Today is not Friday”.
A truth table displays the relationships between the truth values of propositions.
Table 1. The truth table for the negation of a proposition
p p
T F
F T
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.

Let p and q be propositions. The proposition “p and q”, denoted by , is the proposition that is
true when both p and q are true and is false otherwise. The proposition is called the
conjunction of p and q.
Example. Find the conjunction of the propositions p and q where p is the proposition “Today is
Friday” and q is the proposition “It is raining today”.
Solution: The conjunction of these propositions, , is the proposition “Today is Friday and it is
raining today”. This proposition is true on rainy Fridays and is false on any day that is not a Friday
and on Fridays when it does not rain.

Table 2. The truth table for the conjunction of two propositions


p q
T T T
T F F
F T F
F F F

Let p and q be propositions. The proposition “p or q”, denoted by , is the proposition that is
false when p and q are both false and true otherwise. The proposition is called the disjunction
of p and q.
Table 3. The truth table for the disjunction of two propositions
p q
T T T
T F T
F T T
F F F
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. A disjunction is true when either of the two propositions in
it is true or when both are 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 just 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 entree”, 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. Find the disjunction of the propositions p and q where p is the proposition “Today is
Friday” and q is the proposition “It is raining today”.
Solution: The disjunction of p and q, , is the proposition “Today is Friday or it is raining
today”. This proposition is true on any day that is either a Friday or a rainy day (including rainy
Fridays). It is only false on days that are not Fridays when it also does not rain.
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.
Let p and q be propositions. The exclusive or of p and q, denoted by , is the proposition that is
true when exactly one of p and q is true and is false otherwise.
Table 4. The truth table for the exclusive or of two propositions
p q
T T F
T F T
F T T
F F F

Let p and q be propositions. The implication is the proposition that is false when p is true and
q is false and true otherwise. In this implication p is called the hypothesis (or antecedent or premise)
and q is called the conclusion (or consequence).
Table 5. The truth table for the implication
p q
T T T
T F F
F T T
F F T
Because implications arise in many places in mathematical reasoning, a wide variety of terminology
is used to express . Some of the more common ways of expressing this implication are: “if p,
then q”, “p implies q”, “if p, q”, “p only if q”, “p is sufficient for q”, “q if p”, “q whenever p”, “q is
necessary for p”.
We can build up compound propositions using the negation operator and the different connectives
defined so far. Parentheses are used to specify the order in which the various logical operators in a
compound proposition are applied. In particular, the logical operators in the innermost parentheses
are applied first. For instance, is the conjunction of and . To cut down on
the number of parentheses needed, we specify that the negation operator is applied before all other
logical operators. This means that is the conjunction of and , namely , not
the negation of the conjunction and , namely .
There are some related implications that can be formed from . The proposition is called
the converse of . The contrapositive of is the proposition .
Example. Find the converse and the contrapositive of the implication “If today is Thursday, then I
have a test today”.
Solution: The converse is “If I have a test today, then today is Thursday”. And the contrapositive of
this implication is “If I do not have a test today, then today is not Thursday”.

Let p and q be propositions. The biconditional is the proposition that is true when p and q
have the same truth values and is false otherwise.
Table 6. The truth table for the biconditional
p q
T T T
T F F
F T F
F F T
Note that the biconditional is true precisely when both the implications and are
true. Because of this, the terminology “p if and only if q” is used for this biconditional. Other
common ways of expressing the proposition are: “p is necessary and sufficient for q” and “if
p then q, and conversely”.

Translating English sentences


There are many reasons to translate English sentences into expressions involving propositional
variables and logical connectives. In particular, English (and every other human language) is often
ambiguous. Translating sentences into logical expressions removes the ambiguity. Note that this may
involve making a set of reasonable assumptions based on the intended meaning of the sentence.
Moreover, once we have translated sentences from English into logical expressions we can analyze
these logical expressions to determine their truth values, we can manipulate them, and we can use
rules of inference (which are discussed later) to reason about them.
Example. How can the following English sentence “You can access the Internet from campus only if
you are a computer science major or you are not a freshman.” be translated into a logical expression?
Solution: Let a, c, and f represent “You can access the Internet from campus”, “You are a computer
science major”, and “You are a freshman’, respectively. Noting that “only if” is one way an
implication can be expressed, this sentence can be represented as .
Of course, there are other ways to represent the original sentence as a logical expression, but the one
we have used should meet our needs.

Bit operations
Computers represent information using bits. A bit has two possible values, namely, 0 (zero) and 1
(one). This meaning of the word bit comes from binary digit, since zeros and ones are the digits used
in binary representations of numbers. A bit can be used to represent a truth value, since there are two
truth values, namely, true and false. We will use a 1 bit to represent true and a 0 bit to represent false.
That is, 1 represents T (true), 0 represents F (false). A variable is called a Boolean variable if its
value is either true or false. Consequently, a Boolean variable can be represented using a bit.

Table 7. Tables for the bit operations OR, AND and XOR.
x y
0 0 0 0 0
0 1 1 0 1
1 0 1 0 1
1 1 1 1 0
Computer bit operations correspond to the logical connectives. By replacing true by a one and false
by a zero in the truth tables for the operators ,  and , the tables shown in Table 7 for the
corresponding bit operations are obtained. We will also use the notation OR, AND and XOR for the
operators ,  and , as is done in various programming languages.
Information is often represented using bit strings, which are sequences of zeros and ones. When this
is done, operations on the bit strings can be used to manipulate this information.
A bit string is a sequence of zero or more bits. The length of this string is the number of bits in the
string.
Example. 101010011 is a bit string of length nine.
We can extend bit operations to bit strings. We define the bitwise OR, bitwise AND and bitwise XOR
of two strings of the same length to be the strings that have as their bits the OR, AND and XOR of
the corresponding bits in the two strings, respectively. We use the symbols ,  and  to represent
the bitwise OR, bitwise AND and bitwise XOR operations respectively.
Example. Find the bitwise OR, bitwise AND and bitwise XOR of the bit strings 0110110110 and
1100011101.
Solution: 1110111111 – bitwise OR, 0100010100 – bitwise AND, 1010101011 – bitwise XOR.

Glossary
maturity – зрелость; gateway – ворота, вход
proposition – предложение; truth value – истинностное значение
compound proposition – составное (сложное) предложение; connective – связка
inclusive – включающий; exclusive – исключающий; to enroll – вносить в список
parentheses – скобки; contrapositive – противоположное
biconditional – условный в обе стороны, эквивалентность
antecedent – предшествующий, предыдущий член отношения; premise – предпосылка
conclusion – заключение; innermost – самый внутренний; to cut down – сокращать
converse – обратное; ambiguous – двусмысленный; rule of inference – правило вывода

Exercises for Seminar 1


1.1. Which of the following sentences are propositions? What are the truth values of those that are
propositions?
a) Kiev is the capital of Ukraine; b) Minsk is the capital of Russia; c) 2 + 3 = 5; d) 5 + 7 = 10;
e) x + 2 = 11; f) Answer this question; g) x + y = y + x for every pair of real numbers x and y.
1.2. Let p and q be the following propositions “I bought a lottery ticket this week” and “I won the
million dollar jackpot on Friday” respectively. Express each of the following propositions as an
English sentence: a) ; b) ; c) ; d) ; e) ; f) ; g) ;
h) .
1.3. Let p and q be the following propositions “It is below freezing” and “It is snowing” respectively.
Write the following propositions using p and q and logical connectives: a) It is below freezing and
snowing. b) It is below freezing but not snowing. c) It is not below freezing and it is not snowing.
d) It is either snowing or below freezing (or both). e) If it is below freezing, it is also snowing. f) It is
either below freezing or it is snowing, but it is not snowing if it is below freezing. g) That it is below
freezing is necessary and sufficient for it to be snowing.
1.4. Determine whether each of the following implications is true or false.
a) If 1 + 1 = 2, then 2 + 2 = 5. b) If 1 + 1 = 3, then 2 + 2 = 4. c) If 1 + 1 = 3, then 2 + 2 = 5.
d) If pigs can fly, then 1 + 1 = 3 (pig – свинья; to fly – летать).
1.5. State the converse and contrapositive of each of the following implications: a) If it snows today,
I will ski tomorrow. b) I come to class whenever there is going to be a quiz. c) A positive integer is a
prime only if it has no divisors other than 1 and itself.
1.6. Construct a truth table for each of the following compound propositions: a) ; b) ;
c) ; d) ; e) ; f) .
1.7. Construct a truth table for each of the following compound propositions: a) ;
b) ; c) ; d) ; e) ;
f) .
1.8. Construct a truth table for .
1.9. Find the bitwise OR, bitwise AND, and bitwise XOR of each of the following pairs of bit
strings: a) 101 1110, 010 0001; b) 00 0111 0001, 10 0100 1000.
1.10. Evaluate each of the following expressions:
a) 1 1000  (0 1011  1 1011); b) (0 1010  1 1011)  0 1000.
1.11. This exercise is a puzzle that can be solved by translating statements into logical expressions
and reasoning from these expressions using truth tables.
Steve would like to determine the relative salaries of three coworkers using two facts. First, he
knows that if Fred is not the highest paid of the three, then Janice is. Second, he knows that if Janice
is not the lowest paid, then Maggie is paid the most. Is it possible to determine the relative salaries of
Fred, Maggie, and Janice from what Steve knows? If so, who is paid the most and who the least?
Explain your reasoning.

Exercise for Homework 1


1.12. Which of the following sentences are propositions? What are the truth values of those that are
propositions?
a) Do not pass go. b) What time is it? c) There are no trees in Almaty. d) 4 + x = 5; e) x + 1 = 5 if x =
1; f) x + y = y + z if x = z.
1.13. Let p, q and r be the following propositions “You have the flu”, “You miss the final
examination” and “You pass the course” respectively. Express each of the following propositions as
an English sentence: a) ; b) ; c) ; d) ; e) ;
f) .
1.14. Let p and q be the following propositions “You drive over 65 miles per hour” and “You get a
speeding ticket” respectively. Write the following propositions using p and q and logical
connectives: a) You do not drive over 65 miles per hour. b) You drive over 65 miles per hour, but
you do not get a speeding ticket. c) You will get a speeding ticket if you drive over 65 miles per
hour. d) If you do not drive over 65 miles per hour, then you will not get a speeding ticket. e) Driving
over 65 miles per hour is sufficient for getting a speeding ticket. f) You get a speeding ticket, but you
do not drive over 65 miles per hour. g) Whenever you get a speeding ticket, you are driving over 65
miles per hour.
1.15. Determine whether each of the following implications is true or false.
a) If 1 + 1 = 3, then God exists. b) If 1 + 1 = 3, then pigs can fly. c) If 1 + 1 = 2, then pigs can fly.
d) If 2 + 2 = 4, then 1 + 2 = 3.
1.16. State the converse and contrapositive of each of the following implications: a) If it snows
tonight, then I will stay at home. b) I go to the beach whenever it is a sunny summer day. c) When I
stay up late, it is necessary that I sleep until noon.
1.17. Construct a truth table for each of the following compound propositions: a) ;
b) ; c) ; d) ; e) ;
f) .
1.18. Construct a truth table for each of the following compound propositions: a) ;
b) ; c) ; d) ; e) ; f) .
1.19. Construct a truth table for .
1.20. Find the bitwise OR, bitwise AND, and bitwise XOR of each of the following pairs of bit
strings: a) 1111 0000, 1010 1010; b) 11 1111 1111, 00 0000 0000.
1.21. Evaluate each of the following expressions:
a) (0 1111  1 0101)  0 1000; b) (1 1011  0 1010)  (1 0001  1 1011).
1.22. This exercise is a puzzle that can be solved by translating statements into logical expressions
and reasoning from these expressions using truth tables.
Five friends have access to a chat room. Is it possible to determine who is chatting if the following
information is known? Either Kevin or Heather, or both, are chatting. Either Randy or Vijay, but not
both, are chatting. If Abby is chatting, so is Randy. Vijay and Kevin are either both chatting or
neither is. If Heather is chatting, then so are Abby and Kevin. Explain your reasoning.

You might also like