[关闭]
@TangWill 2019-05-15T10:15:31.000000Z 字数 25416 阅读 671

Discrete Mathematical Structures


DiscreteMathematicalStructures


唐麒 17301138


1、What's logic?


1.1 Definition of Logic

Logic is the discipline that deals with the methods of reasoning. It is now an integral part of disciplines such as mathematics, computer science, and linguistics.


2、Propositions and Logical Operations


2.1、Definition of Propositions

A statement or proposition is a declarative sentence that is either true of false, but not both.

Proposition Not a Statement
The national flag of China is red x + 5 > 3

2.2、Logic Operators

In mathmematics, the letters ofen denote variables that can be replaced by real numbers,and these variables can be combined with the familiar operations. In
logic, the letters denote propositions variables; that is, variables that can be replaced by statements.

Statements or propositional variables can be combined by logical connectives to obtain compound statements.

Use logical operators:

Operator Symbol
Negation (not)
Conjunction (and)
Disjunction (or)
Exclusive or
Implication
Biconditional

2.2.1、Negation

常用语:不,没有,无,否定,取反

p

2.2.2、Conjunction

For propositions p and q, the output will be true if and only if (notation: IFF) both p and q are true.

常用语:并且,以及,和,与,既…又,不但…而且,尽管…依然,虽然…但是

p q

2.2.3、Disjunction

For propositions p and q, the output will be true if either or both p and q are true.

常用语:或者

p q

2.2.4、Exclusive or

It is also called exclusive disjunction and the results in a value of true if exactly one of the operands has a value of true."one or the other but not neither nor both."

p q

2.2.5、Implication

p is the premise and q is the conclusion.

常用语:如果…那么,若…则,只要…就

eg.

In the case where p is true and q is false, the outcome is false.A false hypothesis implies ANYTHING

p q

If is an implication, then the converse of is the implication , and the contrapositive of is the implication .


2.2.6、Biconditional

True if p and q have the same truth value.

常用语:当且仅当,等价于,…和…一样

p q

2.3、Classification of Propositions


A statement that is true for all possible values of its propositional variables is called tautology. A statement that is always false is called a contradiction or an absurdity, and a statement that can be either true or false, depending on the truth values of its propositional variables, is called a contingency.

If a proposition is tautology then it is contingency, the reverse is not true.


2.4、Theorem


Commutative properties

Associative Properties

Distributive Properties

Idempotent Properties

Absorption Properties

Properties of Negation

Other Properties

Note:

  • 只要够分数线,就能上大学(充要条件)

    • p:(某人)够分数线
    • q:(某人)能上大学
  • 只有够分数线,才能上大学(充分条件)

    • p:(某人)够分数线
    • q:(某人)能上大学

3、Propositional Logic


3.1、Equivalence Calculus

The process of deriving a new equivalent form from a known equivalent form.

Basic equivalence Symbol
Double negative law
Idempotent law
Commutative law
Associative law
Distributive law
De morgan law
Absorption law
Zero or one law
Law of Identity
Law of excluded middle
Law of contradiction
Implicit equivalence
Equivalent equation
False translocation
Equivalent negation equivalent formula
Return to fallacy

3.2、Rules About Logical Equivalences


3.2.1 Substitution

Where and represent formulas of propositional logic, is a substitution instance of if and only if may be obtained from by substituting formulas for symbols in , always replacing an occurrence of the same symbol by an occurrence of the same formula. If is a tautology, so is .

3.2.2 Replacement

Suppose represents a formula of propositional logic contain formula A as a clause, and represents a formula which replace an occurrence of A with a logically equivalent formula B; then .

Note: Unlike substitution its permissible for the replacement to occur only in one place (i.e. for one formula).

3.2.3 Contrast between Substitution and Replacement

Aspect Substitution Replaceemnt
Use object Any tautology Any propositional formula
Substitution object Any propositional variable Any sub-formula
Substitute Any propositional formula Any Propositional Formula Equivalent to Substitution Object
Substitution method Substituting all occurrences of the same proposition variable Some Appearances of Substitution Formula
Substitution result It is still tautological Equivalent to the original formula

eg.

化简语句:"情况并非如此:如果他不来,那么我也不去"。




我去了,而他没来


3.3 Normal Form

Note:

  • A disjunctive normal form is a contradiction if and only if each fundamental conjunction of it is a contradiction.
  • A conjunctive normal form is a tautology if and only if each fundamental disjunction of it is a tautology.

Every propositional formula can be converted into an equivalent formula that is in CNF and DNF.


3.4 Steps to Seek Normal Form

To convert a propositional formula to equivalent CNF or DNF:

eg.

Find a DNF of





Find a CNF of





3.5 FDNF and FCNF


3.5.1 Minterm and Maxterm

A conjunction of n propositional variables:


where or .That is, each propositional variable does not appear at the same time as its negation, but one of the two must appear only once, and the i-th propositional variable or its negation appears at the i-th position from the left, then the conjunctive formula ,,is called the minimal item and is expressed by .

There are minterms of n propositional variables. We denote them as .

Suppose there are three propositional variable p, q and r.

minterm represent1 represent2 symbol
000 0
001 1
010 2
011 3
100 4
101 5
110 6
111 7

Nature:
(1)、For any formula with n propositional variables, the number of all possible minimum terms is the same as the number of interpretations of the formula, and is .
(2)、Each minterm is true under only one explanation.
(3)、Minterm are not equivalent, and
(4)、Any formula containing n propositional variables can be represented by the disjunction of k minterms.
(5)、The formula formed by the disjunction of minterms must be tautology.

Disjunctive formula consisting of n propositional variables:


where or . That is, each propositional variable does not appear at the same time as its negation, but one of the two must appear only once, and the I-th propositional variable or its negation appears at the I-th position from the left, then the conjunctive formula ,,is called the maxterm item and is expressed by .

There are 2n maxterms of n propositional variables.We denote them as .

Suppose there are three propositional variable p, q and r.

maxterm represent1 represent2 symbol
000 0
001 1
010 2
011 3
100 4
101 5
110 6
111 7

Nature:
(1)、For any formula with n propositional variables, the number of all possible maxterms is the same as the number of interpretations of the formula, and is .
(2)、Each maxterm is false under only one explanation.
(3)、Minterm are not equivalent, and
(4)、Any formula containing n propositional variables can be represented by the conjunction of k maxterms.
(5)、The formula formed by the conjunction of maxterms must be tautology.

Therefore,we can know the relationship of the minterm and the maxterm:


3.5.2 FDNF and FCNF

To convert a propositional formula to equivalent formula that is in FDNF:

Note:Suppose the formula A has n propositional variables and .Then , where .

To convert a propositional formula to equivalent formula that is in FCNF:

Note:
Every propositional formula can be converted into an unique equivalent formula that is in full disjunctive normal form.
Every propositional formula can be converted into an unique equivalent formula that is in full conjunctive normal form.

eg.

的主析取范式和主合取范式。

原公式的析取范式是,











因此,主合取范式为空公式


3.6、Inference

Inference is the act or process of deriving logical conclusions from premises known or assumed to be true.

Rules of Inference

rule symbol
Addition
Simplification
Modus ponens
Modus tollens
Disjunctive syllogism
Hypothetical syllogism
Equivalent syllogism

3.6.1、Proof by Introducing Additional Premise

用附加前提法证明推理:

  • 前提:
  • 结论:

推理正确,是有效结论


3.6.2、Proof by Contradiction

用归谬法证明推理:

  • 前提:
  • 结论:

由(9)得出矛盾,说明推理正确


4、Predicate and Quantifiers


4.1、Quantifiers

Then P(x) is called a predicate or propositional function with respect to the set D if for each value of x in D, P(x) is a statement; i.e., P(x) is true or false.Moreover, D is called the domain of the discourse and x is called the free variable.

Then P(x, y) is a predicate with respect to the set D if for each value pair of x and y in D, P(x, y) is a statement.Such as Greater(x, y),Equal(x, y).

Predicate P(x) means that x has the property P,while P(x, y) means that x and y have the relation P.

The universal quantification of P(x) is the statement: “for all x, P(x)” or “for every x, P(x)” or “for any x, P(x)” The symbol is read as “for all and every”.

The existential quantification of P(x) is the statement:“there exists an x, P(x)” or “there is an x, P(x) ” or “there is some x, P(x) ” The symbol is read as “there exists”.

Note:The variable appearing in: x P(x) or x P(x) is called a bound variable, and P(x) is called the scope of the quantifier.

eg.

All the primes are odd.

Not

“all…are…”: use , not

eg.

There is an even prime.

Not

use , not .

eg.

There exists an unique even prime.


4.2、Predicate Formulas and Classification

The well-formed formula in predicate logic are inductively defined as follows:
(1) Any variable, constant symbol and a simple predicate is a wff.
(2) If A is a wff, then is also a wff.
(3) If A and B are wffs, then are also wffs.
(4) If A is a wff and x is a variable which does not bounded occur in A(x), then are also wffs.

A formula A is logically valid if it is true for every interpretation.
A formula A is unsatisfiable if it is false for every interpretation.
A formula A is satisfiable if it is true for some interpretation.


4.3、Equivalent Calculus in Predicate Logic


4.3.1、Rules about logical equivalences

Replacement:

Suppose represents a formula contain formula A as a subformula, and represents a formula which replace an occurrence of A with a logically equivalent formula B; then .

Substitution

Suppose and are all predicate formulas and is obtained from by substituting all the occurrence of a free variable by an new variable not appear in ; then .

Renaming

Suppose and are all predicate formulas and is obtained from by substituting one bound variable x of by an new variable not appear in its scope; then .


4.3.2、Basic Laws

Tautologies in predicate logic:

A sentence that can be obtained by taking a tautology of propositional logic and uniformly replacing propositional variables by first-order formulas (one formula per propositional variable).

Elimination of quantifiers



Shrink and expansion of scope

The equivalences are valid when x does not appear as a free variable of B.

De Morgan’s laws

If x appear as a free variable of A(x), then

Distribution of quantifiers



Note: vs. , vs.

Variable renamed equivalent






Equivalence for Quantizing Predicate Arguments Many Times


eg.

证明:







eg.

证明:








4.4、Prenex Normal Form

A formula of the predicate calculus is in prenex normal form if it is written as a string of quantifiers (referred to as the prefix) followed by a quantifierfree part (referred to as the matrix)


where is or .Every formula in predicate logic is equivalent to a formula in prenex normal form. However, the equivalent prenex normal form is not unique.

The Basic Steps to seek Prenex Normal Form:

eg.

的前束范式








4.5、Inference in Predicate Calculus

Universal Instantiation (or Universal Elimination, or Universal Specification)

Restriction

Universal Generalization (or Universal Introduction)

Restriction

Existential Instantiation (or Existential Elimination or Existential Specification)

Restriction

Existential Generalization (or Existential Introduction)

Restriction

构造下列推理的证明:

  • 如果一个人怕困难,他就不会获得成功。所有的人或者获得成功,或者失败。有些人没有失败。所以,有些人不怕困难。

引入谓词将这三句话形式化,可得如下推理形式:

设定:


(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)


5、Set


5.1、What's set?

A set is an well-defined collection of objects.Individual items in a set are called elements or members.

NOTE: there is no relationship between different elements of a general set.


5.2、Sets and Subsets

We write to say that element x belongs to the set A.The set with NO elements is called the empty set and denoted by .

We designate by card(A) or |A| the cardinality of a set A, which is the number of distinct element in A.


5.2.1、Superset and Subset

Given two sets A and B ,if every element in A is an element of B ,we say that A is a subset of B or that A is contained in B,and B is a superset of A,and we write


5.2.2、Power Set

Let A be a set. Then set of all subsets in A is called the power set of A and is denoted as P (A).For finite A, | P (A) | =.


6、Something I Want to Share


6.1、About class

Discrete mathematics is one of the major courses for software engineering majors. In the past four weeks of study, we have learned about set and logic. In the previous knowledge combing, since the collected knowledge was repeatedly studied in high schools and universities, only a few basic and important concepts were combed, and the knowledge of logic part was thoroughly combed. In the process of learning and combing logic knowledge, I have been thinking about the importance and necessity of logic for software development and project management. At first, I didn't think of the importance of logic for software engineering. With the constant clarification of knowledge, I gradually realized that logical thinking is helpful to the algorithm design and overall design mode of software project development, and it is also helpful to transform complex requirements into abstract logical thinking. As we have said in class, simple and abstract algorithms are as important to software as universally valid formulas.

As for the teacher's teaching mode, I am very happy that the teacher can share with us cutting-edge knowledge and hot technologies. Although we may not be able to understand or make great efforts to study some technologies, such teaching mode also helps us to understand knowledge.

However, it is hoped that teachers can appropriately increase the amount and difficulty of homework in the subsequent teaching so as to understand and apply knowledge more effectively.


6.2、About me

Since entering the university, I have met many teachers who are responsible for friendship and students who are active and enterprising. Such an environment also makes me continuously improve. Of course, under such circumstances, there will inevitably be some pressure. As the teacher said, our present age is not suitable for labeling ourselves. We should enrich ourselves by learning more. Whether it is to improve their professional level, enrich their knowledge, or enjoy the scenery of the four seasons, universities should do something meaningful. The flower has a re-opening day, and there are no more teenagers. I think we should all live in this way, and when we wake up in the morning, we can all expect something.

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注