2- / 2 2 1
Lasttime introduced
H W I d u e T h u r s d a y .
Quiz 1 , based statements w ith
Copyright By PowCoder代写 加微信 powcoder
of class Thurs logic of
runsubmilted problems propositional logic ,
definite truth value
(” 2 is odd” V
connectives
conjunction
disjunction
Jeinclusive”
implication
o r not both ) ”
be notated
imam:: “:c:
:¥¥÷÷i÷÷÷¥¥÷÷
if ” gonlyq
Many English
$ phrases implication :
sufficient for q ,
statements peg Gore ‘p→or, ‘or→-e
g is necessary for 9,,
antecedent f converge inverse contrapositive
consequent a re all
important .
↳net. ” The statement peg
Sene truth value !
In the situation above ,
logically equivalent . { → G E ‘ q → ‘ 9
ng → y Logical equivalences are fundamental
contrapositive
rq e rp always here the is different .
But the concierge
we say that pig and This can be notated
fo r instance , the identities
to cheek : (pvqlvr I prlqvn )
i’ n g! and – lpnqtsuriq
– (prog) =
‘ 1 negation – anything
Anti and ”
called de fans Morgan’s
comes before else
takes ! proposition
¥’ ¥÷¥÷¥÷:÷t÷÷÷:÷:÷
is equivalent
face AUB ) r a c e C
– xetq=xeBr-KEC these
become prlqvrl and xe AHH if
Kugler . They’re equivalent, which means
x c- (AB)u C
Altaic) = note thet
A- EB (xc-A→ xeB)n
B means weens
(seeB→ ace A) .
” xeB ” must always here the sore truth
That is “ret and [ ,B
We can write this in shorthand as xc.tt e→ ace Heftrightarrow
biconditionol
If qq are propositions, peg = psg nq→p . blioonditioreb when we want to prove statements
We often prove
equivalent
B it strings & –
Computers represent d a t a
connectives
instance ,
coding T=1,
logic gates
11000101 . ( Set
A fundamental computer operation is thus
b i t s , l i k e 0,13$ )
applying propositional
bits $ truth values thet’s frequently used in
We’re using a computation .
This lets computers implement the algebra of subsets of some
: order the elements in some way, so U= {U U2
then encode A EU by the bitting which is 1 at Ui if
Mr } only if
{ Us , c a n
A u B -‘ U
Me } , compute
A is req’d as 1110 ,
B es 0101 bitwise operations I 7111101–0001
AUB ‘s I l l 0
Git string using AnB ={Ue}
U={u.,Uz, Us, Me}A={U. ,Ue,Us}
w a n t e d
c o mp l i c a t e d
Boolean circuits
operations into representations operations .
Too I{u} .
gates , complex
o p e r a t i o n s , l i k e
q2 ¥ noise.
the circuit for
eg, First ,
p→ q is true
is the B q So we’re
is false .
doing re r (q var )
psq I – prog .
‘ H’ truths : ii.missions ‘ .is .
algebra . )
Tommy was telling you about what he ate last afternoon. He says, “I had either popcorn or raisins. If I had cucumber sandwiches, then I had soda. But I didn’t drink soda or tea.” Tommy is an infamous liar: everything he says is false. What did Tommy eat?
led cacaaser
(PrRl – (Css) re (Srt). ,,
so he know Using de Morgan’s , we
Let’s write P: bed popcorn R: had poising C: S: bed soda T: hadtea.
heat cucumber sandwiches & tea .
claims PVR Cass -1 (S – T ) He’s a liar ,,. ,
Prak . 7!?!;s)I
– S . along
C – S M – R To here Svt and – S we must hue T
We alsohereme=p,so
2124-1 Last time : logical equivalences Boolean circuits puzzles ,,
A bit m ore
terminology :
a proposition involving variables
if it is true for
assignment
the variables. More generally,
a=D, thenaaisa
In contrast , if a proposition fuse for all votes of
the variola is celled a contradiction –
The negation of
T (pv-p), which is equivalent to
a tautology , uprap,thus t.rs,
contradiction
is the simplest example of Satisfiability
contradiction .
variables is
we were able
known algorithm
to guess o u r
that can check for
an answer,
proposition
proposition
E e l ( – v a r ) n pi q
( p r – q r r ) n
l – p r qe r r l
a s s i g n me n t
v a l u e s
m a k i n g
there is satisfiability substantially
faster then drawing the whole truth task .
This is the SAT problem in computer science It
w a s the first problem known to be NP- comte NP means it’s
easy to an answer
check ; but it efficiently ( not
probablyb impossible
P ) . efficiently converted into SATI
eg the trading salesmen problem: wht’s the most efficient route
visiting each of a
set of cities ?
propositioned
understood
by Aristotle .
Many , many
logic in The
propositions a r e the form “””
n is an even integer : For some integer k, n = 2k . No choiaoftfruth values hokes a contradiction true
target of predicate logic is qeiefifiaim .
x is y SET: EveryelementofSisinT
No x is y ,
Not every × is
we introduce
” lx.glis on theunitcircle”
” x is a prime ” predicate
tfto fondue?
xES- xet? Butwhetis x? xes race T man ?
home , predicate P
P: A→{T,FTA property elements my love
Eel ” x is even” is a predicate P: Es ET F}
Anything you c a n say after n=–m,h>O,r.. ,…)
set of people
” ( hair” on the
a predicate thing to do
Most important
propositions
evaluate : “3is ”
interestingly
them . 173) is
simply , proposition
Definition If P: A → {T,F} is any predial, then we bee
” I faceA CPH ) He universal quantification of P ” For eeerg KEA ,
s e e A ( Plat ) , the existential quantification of P ” forgone ” EA
Hora ” ‘” ‘
play is true ” .
Hot while P fxealplxll ad
is not a giroposition,
eg a is is not a proposition until we choose an x . But
the predicate
faces (x et )
he an examples
algebra . hes studied calc ”
L:S → ET Fl be ” ,
hes studied liner (Abl n Ust)]
student in thi be the set of
and linear C: S-EtE3be
s Yses lCls) →
7xeA (Plxl) SET better :
is this class , A :
Sas { t . F I ”
solutions to the equation
xmtym- z ” Wiles
Ferret – .
How to get no in predicate logic? No”
such Thet m > 2 and
Halfway: There do not exist integers x.g.z, m
m a xhty zu )
Observe the no x is y means all x are not y .
a ] logy, Z,
Similarly,
itxe A ( Plod I and face A (nplxl ) are logically equiv. n the ett 4hell = Facet (n Ptsd )
Morgen’s bus for quantifiers )
OTOH, the7g (P(x,yl) ¥ FyfxIPhiggl)
instance , is
the Fy (Play) ) says that every horse hes an address
Fg Vic ( Mx.gl ) says ‘s gone address which is
x hes address y
house’s address
simultaneously !
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com