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

Lecture One

The document summarizes key concepts in logic and propositional logic. It discusses logic as the science of thinking correctly using arguments with premises and conclusions. It then provides examples of syllogisms and how logic uses symbols to build conclusions from premises. Finally, it defines key logical terms like statements, propositions, connectives, and translates sample propositions into logical notation.

Uploaded by

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

Lecture One

The document summarizes key concepts in logic and propositional logic. It discusses logic as the science of thinking correctly using arguments with premises and conclusions. It then provides examples of syllogisms and how logic uses symbols to build conclusions from premises. Finally, it defines key logical terms like statements, propositions, connectives, and translates sample propositions into logical notation.

Uploaded by

brightnanor19
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

LECTURE ONE

LOGIC IN COMPUTER SCIENCE


FUNDAMENTALS OF LOGIC
• Logic is the science of thinking correctly. Logic studies arguments, which consist of a set of premises
together with a conclusion. It is also defined as a system that aim to draw reasonable conclusions based on
a given information. In short, Logic is a system of principles that uses reason to determine if a conclusion is
true or untrue.
• Logic was first studied by Aristotle over 2000 years ago but it has become more ordered and well defined
since then.
• The most widely known set of rules are the syllogisms/formal logic, where one thing leads to another. The
rule is if both premises are true then the conclusion is also true. Examples are:
1. Premise1: All rabbits have fur.
Premise 2: Some pets are rabbits.
Conclusion: Some pets have fur.
2. Premise1: Some cars rattle.
Premise2: My car is some car.
Conclusion: My car rattles
3. Premise: All humans have heart.
Premise 2: Stella is a human
Conclusion: Stella has a heart.
2
• Note: A premises are the propositions used to build the argument.
LAWS OF SYLLOGISM USING SYMBOLS TO BUILD CONCLUSIONS
• Syllogism is a method that, through reasoning, uses two premises to form a
conclusion. With that said, the law of syllogism presents the following structure for
the application of this method:
• Premise 1: If A, then B.
• Premise 2: If B, then C.
• Conclusion: If A, then C.
• Example 1:
• Premise 1: If it rains today, then I will wear my coat.
• Premise 2: If I wear my coat, I will feel hot.
• Conclusion: If it rains today, then I will feel hot.
• In this example, A was replaced by "it rains today," B was replaced by "I will wear my
coat," and C was replaced by "I will feel hot." The law of syllogism provides its user
with the power to connect three statements in the form of premise/ premise/
conclusion. 3
STATEMENT
A statement is a declarative sentence that can be true or false or a statement is a sentence

which declare something. A statement can be true (when it declares something that does

actually exist) or false (when it declares something that does not exist) but cannot be both.

Examples of statement
1. February has 30 days.
2. Tomorrow is Tuesday
3. Milk is white.
4. Humans are just fish with legs.
5. 4+5= 10
6. Dogs have 8 legs.
7. 32 is even
NB: All these are examples of statement since some are true whilst some are false.
4
NOT STATEMENT
Note that questions and instructions/commands are not statements
because they cannot be given a truth value.
Examples:
1. Have you done it?
2. Turn the computer off.
3. Stop the bus.
4. Tell me the time.

5
PROPOSITIONS
• The basic items that logic deals with are propositions. Propositions are
used to express beliefs. Propositions is the meaningful content of a statement.
• A proposition can be simple or complex.
• Examples of simple propositions which can either be true or false statement:
1. Dogs are mammals
2. Kate is a beautiful girl
3. Laptops are expensive
4. Roses are red
5. All cars have engine.

6
PROPOSITIONS
• Examples of complex propositions:
1. Dogs are mammals and cats are mammals.
2. Either you like chicken or you like fish.
3. I may come there or come later.
Note that what is connecting the two sentences are what we call connectives.

CONNECTIVES
Connectives are language of the propositional logic such as:

∧ and (or conjuction)


∨ or (disjunction)
¬ not (∼) Negation
⇒ implies (or conditional) meaning if a proposition then another proposition ie if p then k
⇔ biconditional/ equivalence ie if and only if (iff)
⊕ Exclusive or 7
PROPOSITIONS
• It is a standard practice to use the lower-case roman letters p, q,r, . . .
to stand for propositions.
• • If we do this, we must define what we mean by writing something
like:
• Let p be John Major is a prime Minister.

8
PROPOSITIONAL LOGIC
• Translate the following propositions;
1. If I write an exam and I cheat then I will get caught and I will fail.
solution:
Let P = I write an exam
q=I cheat
k= I will get caught
f= I will fail
Hence, (p ∧q) ⇒ (k ∧f)

9
EXAMPLE 2
• If James does not die then Mary will not get any money and James
family will be happy.
Solution:
Let p= James die
¬ p = James does not die
q= Mary will get money
¬q = Mary will not get any money
k= James family will be happy
Therefore: ¬ p ⇒ (¬q ∧k)
10
TRY
• Translate the following sentences given the statements.
1. My shirt is gray and my shorts are not.
2. I am not wealthy but I like quality things. If I go to the mall then I will buy shoes.
3. If Harry comes to work today then I will borrow his bag and I will take it to the
program.

4. Form the conclusion for these two premises each:


a. Premise 1: If you use this shampoo, then you will have dandruff.
Premise 2: If you have dandruff, then your head will itch.
b. Premise 1: If I buy this ball, then I will have no money.
Premise 2: If I have no money, then I will not go to the movies.
11

You might also like