Date post: | 13-Apr-2018 |
Category: |
Documents |
Upload: | sanjiv-gautam |
View: | 217 times |
Download: | 0 times |
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 1/66
Mathematical Reasoning
The Foundation of Algorithmics
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 2/66
The Nature of TruthIn mathematics, we deal withstatements that are True or False
This is known as “The Law of theExcluded Middle”
Desite the fact that multi!"aluedlogics are used in comuter science,the# ha"e no lace in mathematicalreasoning
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 3/66
The nature of mathematical proof An indi"idual once said to me “$ouknow what the de%nition of a goodroof is&”
“'hat&” I relied(
“It con"inces #ou)” he said, *uiteroud of himself(
This indi"idual was +
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 4/66
Mathematical Proof II
Dead 'rong)ersonal certitude has nothing to do withmathematical roof(
The human mind is a fragile thing, andhuman -eings can -e con"inced of themost reosterous things(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 5/66
Mathematical Proof III A good roof is one that starts witha set of axioms, and roceedsusing correct rules of inference tothe conclusion(
In man# cases, we will roceedinformall#, -ut that does not mean that we will ski essential stes(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 6/66
A Sample Proof I ro"e that .x/0123x2/2x/0
Incorrect roof 40 The -ook sa#s that this is true
Incorrect roof 42
M# teacher sa#s that this is trueIncorrect roof 45
E"er#-od# knows that this is true
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 7/66
A Sample Proof II Incorrect roof 456
This is an algorithm(
7efore #ou can use analgorithm as art of a roof, #ou must
ro"e it correct( $ou didn8t do that(
x + 1
x + 1
x + 1
x + x2
x + 2 x + 12
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 8/66
A Sample Proof III A 9orrect roof
.x/012
3.x/01.x/017ecause the left!hand side is :ustshorthand notation for the right!handside(
.x/01.x/013..x/01x/.x/0101
7ecause the distri-uti"e law is one ofthe axioms of the real num-ers
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 9/66
A Sample Proof IV ..x/01x/.x/01013.x/01x/.x/01
7ecause the outer arentheses arenot needed, and -ecause the identit#law of multilication is one of theaxioms of the real num-ers
.x/01x/.x/013.xx/0x1/.x/017ecause the distri-uti"e law is anaxiom of the real num-ers
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 10/66
A Sample Proof V .xx/0x1/.x/013.xx/x1/.x/01
7ecause the identit# law of multilication
is one of the axioms of the real num-ers
.xx/x1/.x/013.x2/x1/.x/01
7ecause x2 is notational shorthand for xx(
.x2/x1/.x/013x2/.x/.x/0117ecause the associati"e law of addition isone of the axioms of the real num-ers(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 11/66
A Sample Proof VI x2/.x/.x/0113 x2/..x/x1/01
7ecause the associati"e law of addition
is one of the axioms of the real num-ers
x2/..x/x1/013 x2/..0/01x/017ecause the distri-uti"e law is one ofthe axioms of the real num-ers(
x2/..0/01x/013 x2/.2x/017ecause 0/032, and -ecausenotational con"ention sa#s that
multilication is erformed %rst(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 12/66
A Sample Proof VII x2/.2x/013 .x2/2x1/0
7ecause the associati"e law ofaddition is one of the axioms of thereal num-ers(
.x2/2x1/03 x2/2x/0
7ecause x2/.2x/013 .x2/2x1/0,there is no am-iguit# introduced -#omitting the arentheses(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 13/66
A Warning!
'E8;E <=T>IDDI<?A7=@T TIB)
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 14/66
More Warnings… This ;EALL$ IB how #ou domathematical roofs)
$ou can com-ine stes(
$ou can lea"e out the exlanations(
7ut #ou M@BT -e a-le to ut them-ack in upon demand(
An# other wa# of doing things is';=<?)
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 15/66
The Rules of Inference I ?i"en the statement6 All A is 7
And the statement6 All 7 is 9'e conclude6 Therefore All A is 9(
This is a correct inference(
Examle6 All cows are animals, allanimals are li"ing -eings, thereforeall cows are li"ing -eings(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 16/66
The Rules of Inference II ?i"en All A is 7
'e conclude that Bome 7 is A(Examle, All 9ows are Animals,therefore some Animals are 9ows(
An incorrect inference6 ?i"en All Ais B, to conclude that All B is A(After all, not all animals are cows(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 17/66
The Rules of Inference III ?i"en Bome A is 7, and Bome 7 is9, what can we conclude&
<othing(
Examle6 Bome 9ows are Cerse#s,
Bome Cerse#s are human( .ere weare to interret the word “Cerse#”as “Things that come from Cerse#,an island in the English 9hannel(”
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 18/66
The Rules of Inference IV ?i"en Bome A is 7, we can conclude that Bome 7 is A(
Bome cows are Cerse#s, some Cerse#s are cows(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 19/66
The Rules of Inference V ?i"en Bome A is 7 and All 7 is 9,
'e conclude6 Bome A is 9(Examle6 Bome cows gi"e milk, Allthings that gi"e milk are female(
Therefore6 some cows are female(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 20/66
The Rules of Inference VI ?i"en All A is 7, and Bome 7 is 9,what can we conclude&
<othing(
Examle6 All cows are animals(Bome animals are -irds( <oconclusion is ossi-le(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 21/66
QuantifiersA statement such as “All A is 7” is saidto -e “@ni"ersall# *uanti%ed(”
In other words, it is a uni"ersalstatement that alies to all A(
A statement such as “Bome A is 7” is
said to -e “Existentiall# *uanti%ed(”In other words, there exists at leastone A to which the statement alies(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 22/66
Negative Statements The only ermissi-le form for theuni"ersal negati"e is6 <o A is 7(
.Accet no su-stitutes)1
The existential negati"e has se"eralforms, <ot all A is 7, Bome A is not 7,
and man# others(Mathematical statements ma# re*uiresomewhat greater recision thangeneral statements( .Bee -elow1
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 23/66
Negating StatementsAn existential negates a uni"ersal, andan uni"ersal negates an existential(
The negation of “All A is 7” is “Bome Ais not 7”
The negation of “Bome A is 7” is “<o A
is 7” The two statements “Bome A is 7” and“Bome A is not 7” can -oth -e true(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 24/66
Mathematical Quantifiers I Mathematical statements need to -esomewhat more recise than “All
9ows are Animals(”All mathematical statements are*uanti%ed, -ut sometimes,
*uanti%ers are understood(Examle6 ro"e that.x/0123x2/2x/0(
The uni"ersal *uanti%er “For all x” is
understood(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 25/66
Mathematical Quantifiers II A roosition is a statement that can-e assigned the "alue True or False(
“All 9ows Eat ?rass,” “All 9ows areDucks,” and “All multiles of 0 endin ” are examles of roositions(
Btatements such as “good weather,”“return 2 to the rintout” and “I %tnew -lue” are not roositions(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 26/66
Mathematical Quantifiers III Assume that is a roositioncontaining the "aria-le x(
'e sometimes denote as .x1 toindicate it contains the "aria-le x(
x is read “For all x ”
x is read “There exists an x suchthat ”
In -oth cases, we read out , we
don8t :ust sa# “”(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 27/66
Mathematical Quantifiers IV ractice with these6
x
.x/012
3x2
/2x/0 x x
As in ordinar# logic, a uni"ersal
negates an existential, and anexistential negates a uni"ersal(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 28/66
The Rules of Inference VII G and $ are e*ual .G3$1 if G and $are names for the same thing(
If a statement .G1 containing G istrue, and G3$ then the statement.$1 o-tained -# su-stituting $ for
G is also true(If .G1 is *uanti%ed, and G aearsin the *uanti%er, then $ mustaear in the *uanti%er of .$1
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 29/66
The Rules of Inference VIII If the statement x .x1 is known to
-e true, and k is within the domainof discourse of , then .k1 is true(
Examle6 x .x/0123x2/2x/0(
The domain of discourse is all realnum-ers( 0(H is a real num-er, so.0(H/01230(H2/20(H/0 is true(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 30/66
Rules of Inference I Examle II6 x .x/0123x2/2x/0
“Toothicks” is outside the domainof discourse of .x/0123x2/2x/0(
'e cannot sa# that.“Toothicks”/0123 “Toothicks”2/2 “Toothicks”/0 is true(
This statement is not a roositionand is neither true nor false(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 31/66
Rules of Inference If the statement x .x1 is known to
-e false, and k falls within the domain
of discourse of , then .k1 is false(
Examle6 x xJ
The domain of discourse is all real
num-ers(
J( is a real num-er, so J(J isfalse(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 32/66
Negating Quantifie Statements<egate6 x .x/0123x2/2x/0
;esult6 x .x/012≠
x2
/2x/0<egate6 x x
;esult6 x x≥
7# the law of the excluded middle,if a statement is true, its negationis false, and "ice!"ersa(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 33/66
"ogical #onnectives I If is a roosition ¬ is itsnegation(
¬ is read “<ot (”
Do not confuse this mathematicalconnecti"e with the general
statement “<ot All A is 7”( The# arenot the same thing(
Bometimes ¬ is written 8 or (
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 34/66
"ogical #onnectives II If and K are roositions, ∧K iscalled the conjunction of and Kand is read A<D K(
If and K are roositions, ∨K iscalled the disjunction of and K
and is read =; K(
If and K are roositions, →K iscalled the implication of and K
and is read IF TE< K(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 35/66
Truth Ta$les for #onnectives K ∧K ∨K →K
True True True True True
True False False True False
False True False True True
False False False False True
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 36/66
Implications The most interesting connecti"e is theimlication →K, which can also -e
written ¬∨K(If is False, then the entire statementis true( That is, “A False Btatement
Imlies An#thing(”An imlication is ro"en -# assumingthat is true and then showing that,in that case, K must also -e true(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 37/66
Implications II ?i"en a statement B of the form→K, the statement K→ is called
the Converse of S(
The 9on"erse of B is anindeendent statement that must
-e ro"en indeendentl# of B(
B can -e true and its con"erse can-e false and "ice "ersa( The# could
-oth -e true or -oth -e false(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 38/66
Implications III ?i"en a statement B of the form→K, the statement ¬K→ ¬ is
called the Contrapositive of S(A statement and its contraositi"eare logicall# e*ui"alent( Either -othare true or -oth are false(
The statement ¬→ ¬K is the In"erseof B( The in"erse of B is logicall#e*ui"alent to the con"erse of B(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 39/66
Proven Implications=nce an imlication has -eenro"en, we use a secial s#m-ol to
designate the imlication(
The notation ⇒K is read “if thenK” and also sa#s that the 3T,
K3F case ne"er occurs(
In other words, that the imlicationis alwa#s true(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 40/66
If an %nl& If A statement of the form if and onl#if K is shorthand for .if then K1 and
.if K then 1(In s#m-ols we exress this as ↔K(
=nce the statement has -een ro"en
we rewrite the statement as ⇔
K( To ro"e ↔K, we must ro"e both of→K and K→(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 41/66
Negating #ompoun Statements¬.∧K1 3 ¬ ∨ ¬K
G is less than three and G is odd
G is greater than or e*ual to 5 or G is e"en¬.∨K1 3 ¬ ∧ ¬K
The car was either red or green
The car was not red A<D it was not green
¬.→K1 3 ∧ ¬K
If a erson has a h(D( then the# must -e rich
rof( Maurer has a h(D and rof( Maurer is oor(
<ote change in *uanti%ers(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 42/66
The Rules of Inference I If is known to -e true, ¬ is false, and "ice"ersa(
If ∧K is true, then K∧ is trueIf ∧K is true then -oth and K are true(
If ∧K is known to -e false, and is known to-e true, then K is false(
If ∨K is true, then K∨ is true(If ∨K is false, then -oth and K are false(
If ∨K is known to -e true, and is known to-e false, then K is true(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 43/66
The Rules of Inference II If →K is known to -e true, and is true, then K is true(
If →K is known to -e true, and Kis false then is false(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 44/66
The Rules of Inference III If ↔K is known to -e true and istrue then K is true, and "ice "ersa(
If ↔K is known to -e true and isfalse then K is false, and "ice "ersa(
If ↔K is known to -e false and is
false then K is true, and "ice "ersa(If ↔K is known to -e false and isfalse then K is true, and "ice "ersa(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 45/66
"ogical 'allacies( The )iggie I Let8s go -ack to our theorem.x/0123x2/2x/0 and gi"e another
invalid roof(
G3, .x/0123./0123235x2/2x/032/2/032/0/035
“Hence Proved ”
'hat has reall# -een ro"ed&
.Bee <ext Blide1
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 46/66
"ogical 'allacies( The )iggie II This “roof” ro"es6
x .x/0123x2/2x/0
7ut the theorem was6
x .x/0123x2/2x/0
For the receding to -e a roof, the
following imlication would ha"e to-e true for all roositions
x→ x
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 47/66
"ogical 'allacies( The )iggie III Is x→ x true for all &
ere is a caital letter A6 A This caital A is red( For theimlication to -e true, ALL caital
A8s would ha"e to -e red(
7ut this one isn8t6 A
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 48/66
"ogical 'allacies( The )iggie IV Most students ha"e a hard timeunderstanding this(
It is not the calculations that areincorrect in the “roof” gi"en a-o"e(
It is the Inference that is wrong)
If an inference techni*ue can -eused to ro"e sill# nonsense .allcaital A8s are red1, then it cannot -eused to ro"e an#thing true(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 49/66
"ogical 'allacies( The )iggie V 'hen #ou are asked to ro"esomething in a class, it is generall#
something that is well!known to -etrue(
$our roof isn8t suosed to deri"e anew truth(
$our roof is suosed todemonstrate that #ou know how toal# the rules of inference correctl#(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 50/66
"ogical 'allacies( The )iggie VI Kuestion6 $ou run #our rogram onG num-er of inuts and o-ser"e that
condition 9 is true on all theseinuts( Does this ro"e thatcondition 9 is true on ALL inuts&
Answer6 <o
;eeat Answer6 <o
;eeat Answer Again6 <o, <o, <o, <o
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 51/66
"ogical 'allacies( The )iggie VII Testing a rogram cannot prove an#thing(
There is no such thing as “roof -#examle”
That is6 examles can -e used to
ro"e existential statements, -utcannot -e used to ro"e uni"ersalones(
This is an inducti"e fallac# known as6
ast# ?eneraliation
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 52/66
%ther "ogical 'allacies I Aeal to Authorit#6 “7ut that8swhat it sa#s in the -ook)”
@suall# a lie(
If the -ook has the wrong answer
And #ou co# the answer onto #ourtest
Then #our answer is6 ';=<?)
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 53/66
%ther "ogical 'allacies II <on Be*uitur6 B*uaring something isa more owerful oeration than
adding something, so .x/012 can8tossi-l# e*ual x2/0, therefore weha"e to add 2x to oNset the ower ofthe s*uaring oeration(
The truth of .x/0123x2/2x/0 doesnot follow from this argument( $oumust use the axioms of the real
num-ers
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 54/66
%ther "ogical 'allacies III Ad Ignorandum .aeal to ignorance16 'ecertainl# cannot ro"e it false that
.x/0123x2/2x/0(=r alternati"el#6 'h# shouldn8t it -e truethat .x/0123x2/2x/0&
An ina-ilit# to ro"e the falsit# of
something does not iml# that it is true(
$ou cannot assert whate"er #ou want andthen def# the world to ro"e it false( $ou
must ro"e #our statements to -e true(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 55/66
%ther "ogical 'allacies IV Assuming the con"erse6 If thiss*uare root function is correct then it
will comute the s*uare root of J to-e 2(
This s*uare root function comutes
the s*uare root of J to -e 2,therefore it is correct(
Bee next slide for the code of this
function(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 56/66
%ther "ogical 'allacies V Ooat B*uare;oot.Ooat x1P
return 2(QR
?i"en a true statement of the form
“if then K,” the truth of ro"esthe truth of K(
However , the truth of K does not ro"e the truth of (
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 57/66
%ther "ogical 'allacies VI Assuming the In"erse6 If a num-ern is rime and greater than 2 then
it must -e odd(
This num-er is greater than two,-ut it is not rime( Therefore, it
can8t -e odd(
The num-er is S(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 58/66
%ther "ogical 'allacies VII ?i"en a true statement of the form“If then K6”
The falsit# of K ro"es the falsit# of (However , the falsit# of does not ro"e the falsit# of K(
Bince the con"erse is logicall#e*ui"alent to the in"erse, assumingthe in"erse and assuming thecon"erse are the same fallac#(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 59/66
Proving Things* In +eneral Take stock of #our resources( Theseare the things that are known to -e
true( The gi"en elements of the ro-lem
Axioms
ro"en Theorems@se #our tools to deri"e the resultfrom #our resources( $our tools are#our rules of inference(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 60/66
Proving If,Then StatementsFor a statement of the form If then K, add to #our resources(
is assumed to be true(
$ou must use the rules of inferenceto deri"e K from #our resources(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 61/66
Inuctive ProofsBuose .n1 is a statement a-outintegers( .It must -e a-out integers(1
To ro"e that .n1 is true, #ou mustro"e .1 and the statement “if .n1then .n/01”
The axioms of the integers state that“There is an integer (” and “E"er#integer n has a successor n/0”
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 62/66
#omplete Inuction9omlete induction is weaker thannormal induction, -ecause it does
not use the axioms of the integersdirectl#(
For comlete induction #ou must
ro"e .1 and the statement “if.k1 for all kn then .n1”
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 63/66
-isproving Things I A disroof of a statement is thesame as ro"ing the negation of
the statement(Disro"e6 <o e"en integer is rime(
“2 is rime(”
=ne counterexamle is sucientto disro"e a uni"ersall# *uanti%edstatement(
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 64/66
-isproving Things II Disro"e6 All odd integers are rime(
“S is odd and is not rime”
=ne counterexamle is sucient(Disro"e6 There is an e"en integergreater than 2 which is rime(
roof6 if x is an e"en integer it must -eof the form 2k for some integer k .-#de%nition1( .continued on next slide1
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 65/66
-isproving Things III Bince xU2 we ha"e 2kU2(
9anceling the 2s .in"erse law of
multilication1 we get kU0(Bince x32k, and kU0, x iscomosite, and cannot -e rime(
Therefore if x is an e"en num-ergreater than 2, it cannot -e rime(
Disro"ing an existential re*uiresroof of a uni"ersal
7/26/2019 mathreas
http://slidepdf.com/reader/full/mathreas 66/66
Ac.no/legementsI would like to thank the followingindi"iduals for drumming these
facts into m# head(
;ichard Farrell
Cames Ew-ank?eorge 7lodig