Discrete Structures and Its Application.: Rimsha Parvaiz MCS Lahore Garrison
Discrete Structures and Its Application.: Rimsha Parvaiz MCS Lahore Garrison
RIMSHA
PARVAIZ
MCS
LAHORE
GARRISON
Proposition:
PROPISITION.
1. Propositional logic is the simplest form of logic. Here the
only statements that are considered are propositions,
which contain no variables. Because propositions contain
no variables, they are either always true or always false.
2. • x+2=4. (May be true, may not be true; it depends on
the value of x
3. .) • x·0=1. (Always false, but not a proposition because of
the variable
4.As the last two examples show, it is not enough for a
statement to be always true or always false—whether a
statement is a proposition or not is a structural property.
Proposition:
But if a statement doesn’t contain any variables (or other
undefined terms), it is a proposition, and as a side-effect
of being a proposition it’s always true or always false.
BOOLEAN OPERATORS
negation
negation of p is written as ¬p, or sometimes ∼p, −p or p. It has
the property that it is false when p is true, and true when p is fa
E.g. If p = “I have brown hair.”
then ¬p = “It is not the case that I have brown hair” or “I do not have
brown hair.”
P ~P
Proposition:
T F
F T
Negation table.
Conjuction operator
The and of p and q is written as p∧q, and is true only
when both p and q are true.3 This is pretty much the
same as in English, where “I like to eat ice cream and I
own a private Caribbean island” is not a true
statement when made by most people even though
most people like to eat ice cream. The only complication
in translating English expressions into logical ands
Proposition:
is that logicians can’t tell the difference between “and”
and “but”: the statement “2+2 = 4 but 3+3 = 6”
becomes simply “(2+2=4)∧(3+3=6).”
The binary conjunction operator “Ù” (AND)
combines two propositions to form their logical
conjunction.
E.g. If p = “I will have salad for lunch.” and
q = “I will have steak for dinner.”
then, pÙq = “I will have salad for lunch and
I will have steak for dinner.”
Proposition:
P q P^q
T T T
T F F
F T F
F F F
Conjuction opearator truth table.
The disjunction operator[or]
The or of two propositions p and q is written as p∨q,
and is true as long as at least one, or possibly both, of
p and q is true.2 This is not always the same as what
“or” means in English; in English, “or” often is used
Proposition:
for exclusive or which is not true if both p and q are
true. For example, if someone says “You will give me
all your money or I will stab you with this table
knife”, you would be justifiably upset if you turn over
all your money and still get stabbed. But a logician
would not be at all surprised, because the standard “or”
in propositional logic is an inclusive or that allows for
both outcomes.
The binary disjunction operator “Ú” (OR)
combines two propositions to form their logical
disjunction.
Proposition:
E.g. If p = “My car has a bad engine.” and
q = “My car has a bad carburetor.”
then, pÚq = “My car has a bad engine, or
my car has a bad carburetor
Proposition:
Proposition:
So, this operation is also called inclusive or,
because it includes the possibility that both p and
q are true.
Truth table disjunction.
The exclusive or operator
Exclusive or If you want to exclude the possibility
that both p and q are true, you can use exclusive
or instead. This is written as p⊕q, and true
precisely when exactly one of p or q is true.
Exclusive or is not used in classical logic much,
Proposition:
but is important for many computing
applications, since it corresponds to addition
modulo 2 (see §8.3) and has nice reversibility
properties (e.g. p⊕(p⊕q) always has the same
truth-value as q).
The binary exclusive-or operator “Å” (XOR)
combines two propositions to form their logical
“exclusive or”
E.g. If p = “I will earn an A in this course.” and
q = “I will drop this course.”, then
Proposition:
p Å q = “I will either earn an A in this course,
or I will drop it (but not both!)”