Math Logic
Hack your Mind!!!
STEP 1
Pick a number from the following grid.
STEP 2.
Now pick another number. The
number has to be in another column
and another row.
STEP 3.
Pick a third number, again in a different
column and different row from the previous
two numbers.
Pick a fourth number, again so it’s not
in the same row or column as any
previous number.
Add all the numbers.
Guess Number!
34
What is LOGIC?
LOGIC. A method of reasoning,
provides rules and techniques to
determine whether an argument is
valid or not.
Logic Statement. (Statement) is a
declarative sentence that is either
true or false, but not both true and
false.
Simple statement is a sentence
that conveys a single idea.
Examples: Determine whether each of the
sentence is a statement.
Sentences Answer
p: 2 is an even (true) – it is a statement
number.
q: 7 is an even (false) – it is a statement
number.
s: My cat is (true or false) – it is a statement
beautiful.
t: How are you? This is a question – not a
statement
u: X > 3 For any given value of x, it is
either true or false
NEGATION. The negation of P, written as ~P,
is the statement obtained by negating
statement P.
Examples: Write the negation of the following statements.
Statement Negation
• Ellie Goulding is an Ellie Goulding is not an
opera singer. opera singer.
• The dog does not The dog needs to be fed.
need to be fed.
• No one passed the Everyone (or someone)
test. passed the test.
Compound statement conveys two
or more ideas.
Logic Connectives and Symbols
Let: p, q, r and s be simple sentences
Type of
Statement Connective Symbolic Form
Statement
not p not ~p negation
p and q and pq conjunction
p or q or p v q disjunction
if p then q If - then p→q conditional
p if and only if q if and only if pq biconditional
Examples: Consider the following simple
statements:
p: Today is Friday.
r: I am going to a movie.
q: It is raining.
Write s:
the following
I am compound statements
not going to in symbolic
the basketball game.
form.
• Today is Friday and it is raining.
• It is not raining and I am going to a movie.
• I am going to the basketball game or I am going
to a movie.
• If it is raining, then I am not going to the
basketball game.
ANSWE
RS
Write the following compound statements in symbolic
form.
• Today is Friday and it is raining. pq
• It is not raining and I am going to a ~qr
movie.
• I am going to the basketball game or ~svr
I am going to a movie.
• If it is raining, then I am not going to q→s
the basketball game.
TRANSLATING SYMBOLIC STATEMENTS
Examples: Consider the following statements:
p: The game will be played in Atlanta.
r: The game will not be shown on ESPN.
q: The game will be shown on CBS.
s: The Mets are favored to win.
Write each of the following symbolic statement in
words.
Symbolic
Statements
• qp
• ~r s
• s ~p
ANSWE
RS each of the following symbolic statement in
Write
words.
Symbolic Statements
Statements
• qp The game will be shown on CBS and the
game will be played in Atlanta.
• ~r s The game will be shown on ESPN and
the Mets are favored to win.
• s ~p The Mets are favored to win if and only
if the game will not be played in
Atlanta.
TRUTH VALUE AND TRUTH TABLE
a.Truth value of a simple statement is either true or
false.
b.Truth value of a compound statement depends on
the truth values of its simple statements and its
connectives.
c.Truth table shows the truth value of a compound
statements for all possible truth values of its simple
statements.
Negation
If p : It is raining outside.
Then, Negation of p is-
∼p : It is not raining outside.
Negation
If p is a proposition, then negation of p is a proposition which
is-
• True when p is false
• False when p is true.
Truth Table
p ∼p
T F
F T
Conjunction
If p and q are two propositions where-
p:2+4=6
q : It is raining outside.
Then, conjunction of p and q is-
p ∧ q : 2 + 4 = 6 and it is raining outside
Conjunction
If p and q are two propositions, then conjunction of p and q is a
proposition which is-
• True when both p and q are true
• False when both p and q are false
Truth Table
p q p∧q
T T T
T F F
F T F
F F F
Disjunction
If p and q are two propositions where-
p:2+4=6
q : It is raining outside
Then, disjunction of p and q is-
p ∨ q : 2 + 4 = 6 or it is raining outside
Disjunction
If p and q are two propositions, then disjunction of p
and q is a proposition which is-
• True when either one of p or q or both are true
• False when both p and q are false
Truth Table
p q p∨q
T T T
T F T
F T T
F F F
Conditional
If a = b and b = c then a = c.
If I will go to Australia, then I will earn more
money.
Conditional
If p and q are two propositions, then-
• Proposition of the type “If p then q” is called a conditional or
implication proposition.
• It is true when both p and q are true or when p is false.
• It is false when p is true and q is false.
Truth Table
p q p→q
T T T
T F F
F T T
F F T
Biconditional
He goes to play a match if and only if it does not
rain.
Birds fly if and only if sky is clear.
Biconditional
If p and q are two propositions, then-
• Proposition of the type “p if and only if q” is called a biconditional
or bi-implication proposition.
• It is true when either both p and q are true or both p and q are
false.
• It is false in all other cases.
Truth Table
p q p↔q
T T T
T F F
F T F
F F T
Important Notes-
Each logical connective has some priority.
This priority order is important while solving questions.
The decreasing order of priority is-
EXAMPLE
Construct a table for ~(~p V q) V q
Create a standard table (make it alphabetical order)
EXAMPLE
Construct a table for ~(~p V q) V q
A. Use the standard table (make it alphabetical
order) and include ~p
EXAMPLE
Construct a table for ~(~p V q)
Vq
B. Add column ~p V q
EXAMPLE
Construct a table for ~(~p V q)
Vq
C. Add another column for ~(~p V q)
EXAMPLE
Construct a table for ~(~p V q) V
q
D. Finally form the disjunction of ~(~p V q)
Vq
Team Challenge # 7
1st – 70 pts.
2 – 60 pts.
nd
3 – 50 pts.
rd
4th – 45 pts.
5th – 40 pts.
6th – 35 pts.
Construct the truth table.
1. ( r ∧ q ) ∨ ( p ∧ q)
2. (~b v c) ∧ ~a
Logic
Application
Review
Logic Connectives and
Symbols
Let: p, q, r and s be simple sentences Type of
Statement Connective Symbolic Form
Statement
not p not ~p negation
p and q and pq conjunction
p or q or p v q disjunction
if p then q If - then p→q conditional
p if and only if q if and only if pq biconditional
Review
Review
How math logic
connects to our daily
life?
Boolean logic
• Boolean logic is a
complete system for logical operations, used in
many systems.
• It was named after George Boole, who first
defined an algebraic system of logic in the mid 19th
century.
• Boolean logic has many applications in electronics,
computer hardware and software, and is the
basis of all modern digital electronics.
Logic Circuits
Logic Circuits
• Logic circuits process data signals to
create new desired signals and
information. This is commonly done in
binary.
• These logic circuits often use
operations through logic gates, which
have inputs and outputs in form of 1’s
and 0’s.
Logic Gates
• Logic gates turn ON when a certain
condition is true, and OFF when the
condition is false.
Remember: True= ON = 1 False =
OFF=0
Logic Gates
Logic Gates
Logic gates actually look like weird bugs
in real life!
However, the diagrams we use are
easier to understand
Given expression ~(~p V q) V q
convert to equivalent Logic
Circuits
Truth table for expression ~(~p V q)
Vq
Truth table for equivalent logic circuits
AND Gate (Conjunction)
OR Gate (Disjunction)
NOT Gate (Negation)
All electronic devices use logic gates because
it is the building blocks of digital electronic
circuit design.
It applies in our daily life :
• Traffic Lights, Computers, Laptops, Mobile
Phones.
• TVs, Washing machines, Microwave oven
• Digital cameras, Game console, MP3 Player
Database
What is a Database?
• A database simply refers to a set of related
data organized in a way that it can be
easily stored, changed, and accessed at
any time.
Database Examples You Regularly Use
On-Demand Online Video Streaming
Online streaming services, such as Hulu and Netflix,
use databases to keep track of which TV shows
and movies are available and your viewing
preferences, so it can provide better watching
recommendations every time you log in to the service.
Database Examples You Regularly Use
Social Gaming
Minecraft, one of the most popular games of all
time, allows users to host or connect to other
servers to play in a multiplayer mode.
Database Examples You Regularly Use
Personal Cloud Storage
Dropbox, Google Drive, Microsoft OneDrive, and
iCloud are just some examples of personal cloud
storage services available to you
Database Examples You Regularly Use
Social Media
Every social media platform stores an abundance
of user information in databases used
to recommend friends, businesses, products,
and topics to you (the end user).
Database Examples You Regularly Use
E-Commerce
Any online organization that sells its products or
services on a platform such as Lazada and
Shopee has to use a database to operate
properly.
Database applications
Relational databases use SQL, or other database-
specific languages, to perform queries, which may
contain Boolean logic.
Search Engine
Search engine queries
• Search engine queries also employ Boolean
logic.
• Double quotes are used to combine whitespace-
separated words into a single search term.
• Whitespace is used to specify logical AND, as it
is the default operator for joining search terms:
Search engine queries
• The OR keyword is used for logical OR:
• The minus sign is used for logical NOT:
Programming
Programming Language
• Software's are created with the help of
programming languages.
• Every electronic devices that works
through software were written in
programming languages.
• These are web, desktop and mobile
applications.
Web applications
• Web applications are websites with
functionality and interactive elements.
• Gmail, Facebook, YouTube, Twitter, etc.
are all web apps that are dynamic, and
built for user engagement.
Desktop applications
• Desktop Applications are software that was installed
on your hard drive of your computer.
Some examples of desktop applications for Windows:
• Windows File Explorer (to find files on your computer)
• Microsoft Office applications (Word, Excel, etc.)
• Web browsers (Chrome, Firefox, Internet Explorer)
• Adobe Photoshop
Mobile applications
• A mobile application, most commonly referred to as
an app, is a type of application software designed to
run on a mobile device, such as a smartphone or
tablet computer.
• Apps that can run through Android and iOS.
• These are gaming apps, productivity apps, lifestyle &
entertainment apps, and M-commerce apps.
Logical Operators
EXAMPLE
Determine the answer:
a=1, b=2, c=3
(c < b + a) || (b - a >= c – b)
Team Challenge # 8
1st – 70 pts.
2nd – 60 pts.
3rd – 50 pts.
4 – 45 pts.
th
5th – 40 pts.
6th – 35 pts.
Determine the answer:
x=1, y=2, z=3
1)!((x + 1) >= y && z > x)
2)!( y < x || !(z + y > y * x ))
3)!(x > z && y <= (z – x)) || z != y
How do we apply
this in a real-life
scenario?
Assume that you are a business strategist in a
certain company where either you or your
colleague has to approve a business plan
prepared by your subordinate. But, your boss
makes the final decision. So, there are 2
phases:
1. Approval by either of two strategists.
2. Approval by the manager.
How do you design a circuit for
this?
• Since either of you or your colleague's approval is
needed an OR gate will suffice it.
• But then, your Manager approval is a must. So, it is
use here with an AND gate.
How do you create the logic
statement for this?
y: you, c: colleague, m: manager
((y || c ) && m)
• Since either of you or your colleague's approval is
needed a logical OR (||) will suffice it.
• But then, your Manager approval is a must. So, it is
use here with a logical AND (&&).
Whenever a decision needs
to be taken based on some
inputs, a logic can be
designed and used.
Reminders
FA#5 - Room Assignment
NOV. 15 (FRI)
Sec 75 – ADB 304
Sec 34 – ADB 304
Sec 14 – ADB 304
NOV. 16 (SAT)
Sec 58 – ADB 403
Sec 59 – ADB 403
THANK
YOU!!!