Presentation is loading. Please wait.

Presentation is loading. Please wait.

LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are.

Similar presentations


Presentation on theme: "LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are."— Presentation transcript:

1 LOGIC Lesson 2.1

2 What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are questions on-the-spot.  Always prepare 1/8 or ¼ size of paper.

3 LOGIC  LOGIC is commonly known as the science of reasoning. The emphasis here will be on logic as working tool.  We will develop some of the symbolic techniques required for computer logic. Some of the reasons to study logic are the following:  At the hardware level the design of ‘logic’ circuits implement instructions is greatly simplified by the use of symbolic logic.  At the software level a knowledge of symbolic logic is helpful in the design of programs.

4 RULES OF LOGIC  The rules of LOGIC specify the precise meaning of mathematical statements.  These rules are used to distinguish between valid and invalid mathematical arguments.  These rules are used in the design of computer circuits, the construction of computer programs, the verification of correctness of programs, and in many other ways.

5 PROPOSITIONS  The building blocks of logic.  A proposition is a statement that is either true or false, but not both.

6 Examples 1&2  Yaoundé is the capital of Cameroon  x + 2 = 2  English is the national language spoken in Cameroon  x + y = z  All the above examples are propositions?

7  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 and denoted by F, if it is a false proposition.  Many mathematical statements are constructed by combining one or more propositions.  New propositions, called compound propositions are formed from existing propositions using logical operators.

8 NEGATION  Let p be a preposition.  The statement, “It is not the case that p” is another proposition, called the negation of p, and is denoted by  p read as not p.  Find the negation of the proposition “This month is September”  Solution: “It is not the case that this month is September”  The negation can be more simply expressed by “This month is not September”

9  A truth table displays the relationships between the truth values of propositions.  The negation of a proposition can also be considered the result of the operation of the negation operator on a proposition.  These logical operators are also called connectives TABLE 1 The Truth Table for the Negation of a Proposition p pp TF FT

10 What is the negation of the following propositions? 1/8 1. Today is Thursday. 2. There is no pollution in Douala 3. 10 + 5 = 15 4. Douala is the capital of Cameroon. 5. The summer in Yaoundé is hot and sunny.

11 CONJUNCTION  Let p and q be propositions.  The proposition “p and q”, denoted by p  q  is the proposition that is true when both p and q are TRUE and is FALSE otherwise. TABLE 2 The Truth Table for the Conjunction of Two Proposition pq p  q TTT TFF FTF FFF

12 Example  p is the proposition “Today is Friday”  q is the proposition “It is raining today”  Solution: the conjunction of these p  q, is the proposition “Today is Friday and it is raining today.”  The proposition is TRUE on rainy Fridays and is FALSE on any other days and not raining.

13 1. There is one red apple and a total of two apples. 2. The green apple is smaller than the red apple and the red apple has a leaf. 3. The red apple is taller and green apple is not having a stem. 4. Both apples have sprinkled water and none of them is sliced. 5. The green apple is labeled unripe and the red is labeled ripe.

14 DISJUNCTION  Let p and q be propositions.  The proposition “p and q”, denoted by p  q  is the proposition that is FALSE when both p and q are FALSE and is TRUE otherwise. TABLE 3 The Truth Table for the Disjunction of Two Proposition pq p  q TTT TFT FTT FFF

15 Example  The use of the connective OR in a disjunction corresponds to one of the two ways the word OR is used in English, namely an inclusive way.  Students who have taken calculus or computer science can take this class. (inclusive)  Students who have taken calculus or computer science, but not both, can take this class. (exclusive)

16 Activity 10 Pts.  Search the web or think of real world scenarios, create the disjunction table.  Cite an example for each p  q.

17 EXCLUSIVE OR  Let p and q be propositions.  The exclusive or of “p and q”, denoted by p  q  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 Proposition pq p  q TTF TFT FTT FFF

18 Activity 10 Pts.  Search the web, and create the exclusive or table.  Cite a real world example for each p  q.

19 IMPLICATION/CONDITIONAL  Let p and q be propositions.  The implication of “p  q”, 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 4 The Truth Table for the Implication p  q pq p  q TTT TFF FTT FFT

20 COMMON WAYS OF EXPRESSING IMPLICATIONS:  If p then q  p implies q  If p,q  p only if q  p is sufficient for q  q if p  q wherever p  q is necessary for p  EXAMPLE statements:

21 ACTIVITY 10 Pts.  Search the web, and create the implications table.  Cite a real world example for each p  q

22 BICONDITIONAL  Let p and q be propositions.  The biconditional of “p  q”, is the proposition that is TRUE when p and q have the same truth values and is FALSE otherwise. TABLE 4 The Truth Table for the Implication p  q pq p  q TTT TFF FTF FFT

23 ACTIVITY 10 Pts.  Search the web, and create the biconditional table.  Cite a real world example for each p  q

24 Lecture 1 24 Logical Connectives OperatorSymbolUsageJava Negation  not ! Conjunction  and && Disjunction  or || Exclusive or  xor (p||q)&&(!p||!q) Conditional  if,then p?q:true Biconditional  iff (p&&q)||(!p&&!q)

25 NEXT TOPIC: - LOGIC AND BIT OPERATIONS - PROPOSITIONAL EQUIVALENCES - SETS - FUNCTIONS


Download ppt "LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are."

Similar presentations


Ads by Google