Posts

Showing posts from December, 2022

Discrete Math - Functions

Image
A special kind of relation f ⊆ A×B is called a function from set A to set B if every element in set A has only 1 image in set B. This can be denoted as: f:A→B. A real valued function is a function which states f:R→ R. In this case we can use arithmetic operators between functions. An injective function has every image relating to distinct elements in x under f. Figure 42 A surjective function says every element in y is the image of some element x under f. Figure 43 There are non-surjective and non-injective functions. Figure 44 A composition of functions states that given 2 functions f:A→B  and g:B→C, we define a composition as g∘f:A→C. Invertible functions state that $ f^-1 :A→B $ can yield $ f^-1 :B→A $.

Discrete Math - Relations

Image
A relation from set S to set T is a subset of the cartesian product of S and T. R is a relation from S to T iff R⊆(S×T). It is also a subset of the cartesian plane. A binary relation is a relation between 2 sets, this is the most common relation in natural language. The most common example is the following: All coins have an associated value, (∀x)(∃y)Pxy⊆(Coins×Value),I(P)={(Penny,1),(Nickle,5),(Dime,10),(Quarter,25)}. Arity is an n-ary relation, i.e., it is a subset of S_1×S_2×S_3…×S_n. An n-ary relation is an n-placed relation. Given a relation R, when $ R=A_1×B_1 $, where R⊆A×B.: A is the domain of R, where $ A_1⊆A $ B is the codomain of R, where $ B_1⊆B, B_1 $ is the range of R. We can represent this where certain sets have elements which map onto each other. Figure 37 The image is the elements in the range. The pre-image is the elements in the domain used in the relation. Relations allow for more than 1 image per pre-image (unlike functions). If (x,y) are in relation R, we...

Discrete Math - Other Set Theory Basics

Image
The power set of set S is the set of all ways of selecting members from set S. This can be done in many ways. Example, say that S={0,1,2}, how do we determine p(S)? Table 18 One thing to note from the example above is that the empty set is always going to be an element of the power set . Instead of using a truth table (however), we can also use a tree. This is done by adding an extra element to each stage of the tree. For instance, if A={a,b}, then what is p(A)? Figure 36 One way to represent the sum of a set of numbers is to state it in predicate logic. This is the following: $ ∀xPx= ∑_(x∈P)x,I(P)=in set P $. An ordered pair is the following: (x,y)={{x},{x,y}}. An ordered tuple is the following: (x,y,z)={{x},{x,y},{x,y,z}}. A cartesian product is a set of ordered tuples founded by multiplying sets, it can be denoted: A×B={(a,b)|a∈A,b∈B}. Example: Say X={0,1,2},and Y={A,B} X×Y={(0,A),(0,B),(1,A),(1,B),(2,A),(2,B)} Y×X={(A,0),(A,1),(A,2),(B,0),(B,1),(B,2)} You can also find this in m...

Discrete Math - Naïve Set Theory

Image
A set is a well-defined collection of objects. You can represent sets using tabular form , for instance N={1,2,3,…}. You can represent sets using set builder form , for instance N={x|x=natural numbers}. In a set order does not matter.  A null set is a set with no elements in it. It can be represented as { }  or ∅. A proper subset , for instance A⊆B, states that all elements in A are in B. Example: {1,2}⊆{1,2,3}. However, one rule should be remembered, the empty set is not a subset of the set of the empty set. This is a general rule, {a}⊄{{a}}. A set with all elements in it (relative to context is the Universal set denoted U, aka domain of discourse). A union of sets is denoted by A∪B, which denotes all elements in sets A or B. In set builder notation, we can say: A∪B={x|x∈A∨x∈B}. There are a couple of laws that follow: Commutative Law : A∪B=B∪A Associative Law : (A∪B)∪C=A∪(B∪C) Idempotent Law : A∪A=A A∪U=U iff A⊂U A∪∅=A An intersection of sets is denoted by A∩B, which denote...

Modal/Alethic Logic - Introduction

Introduction Modal logic is a family of different related systems that provide a variety of different operators that have their own formation rules and rules of inference. There are two operators: Possibility : ⬦, It is possible that. Necessity : □, it is necessary that. Modal logic has been relatively useful in expanding the range of expression used in propositional logic. The Distribution Axiom If we have statements like this, “It is necessary that Q if P.”. Then we can deduce, “If it is necessary that P, then it is necessary that Q.” This is called the distribution axiom. Distribution Axiom : □( □(P→Q))⊢  □□P→ □Q. For instance, if it is necessary that a square is a rectangle, then if it is necessary a shape is a square, then it is necessary that the shape is a rectangle. Negation Rules The following rules also hold: □( □P)⊢¬⬦¬P  □( ⬦P)⊢¬□¬P  These rules tell us something like the following: It is necessary that 1=1. This implies that it is not possible that 1 does not ...

Predicate Logic - Inference Rules

Image
Mixed Quantifiers The order of the quantified variables matters. Assume that I(P)=less than, so that I(Pxy)=x<y: (∀x)(∃y)Pxy : This is interpreted as for all x there exists a y greater than said individual x. This is true. (∃y)(∀x)Pxy : This is interpreted as there exists a y that is greater than all x. This is false. So: (∀x)(∃y)Pxy≠(∃y)(∀x)Pxy Figure 20 More examples may be useful in thinking about how to translate mixed quantifiers: (∃x)(∀y)(x+y=y) means there exists x which makes the proposition true given all y. This is true. This is true when x=0. (∀y)(∃x)(x+y=0) means that for all y, there exists an x which makes x+y=0 true. This is true. This is true when x=-y. (∀x)(∀y)(∃z)((x<y)→(x<z<y)) says that between all numbers x and y, there exists z. A rule : (∃y)(∀x)Pxy→(∀x)(∃y)Pxy. This is because the antecedent implies a fixed value of y makes Pxy true. This implies that for all x, the fixed value of y will necessarily satisfy the truth conditions given. This relationshi...

Predicate Logic - Introduction

Introduction Propositional logic has three principal strengths: For any argument valid in propositional logic, there is a corresponding valid argument in English. The Truth tables in propositional logic provide easy to read decision procedures in propositional logic. There is an easy-to-understand proof system. However, there are many weaknesses to predicate logic: Propositional logic is not expressive enough to capture all arguments. Ex: All men are mortal and Socrates is a man, therefore Socrates is mortal. This is translated to P and Q, therefore R. Predicate logic can prove all things in propositional logic (and thus is redundant). There are many symbols used in predicate logic which are used to express objects, variables, predicates, etc. Here we have the following symbols: Names : lowercase letters a-v with or without numerical subscripts. N-place Predicates : uppercase letters A-Z with or without numerical subscripts. Variables : lowercase letters, w-z with or without numerical ...

Propositional Logic - Other Topics

De Morgans Demorgans Laws state that ¬(P∧Q)↔(¬P∨¬Q),and ¬(P∨Q)↔(¬P∧¬Q). Other Operators The Exclusive Disjunction is an operator which states that given the propositions P and Q, then P⨁Q is true only when wither P or Q are true. P Q P⨁Q T T F T F T F T T F F F Table 15 The Sheffer Stroke is an operator which states that given the propositions P and Q, then P↑Q is true only when either P or Q is false. This is equivalent to ¬P∨¬Q. P Q P↑Q T T F T F T F T T F F T Table 16

Propositional Logic - Transformations of the Conditional

Contrapositive The contrapositive of a conditional statement is equivalent to the conditional statement. A contrapositive takes the conditional  P →Q , then derives  ¬Q → ¬P . The best way to think about this is via modus tollens. However, you can also prove P→Q≡¬Q→¬P: P Q ¬P ¬Q P →Q ¬Q → ¬P T T F F T T T F F T F F F T T F T T F F T T T T Table 13 Another example of showing equivalency can be via natural language. Let us say the conditional proposition states that, “If I study hard, then I will pass.” The contrapositive would state that, “If I do not pass, then I have not studied hard.” This is somewhat common sensical. Converse A converse is not equivalent to the conditional. A converse takes the ...

Propositional Logic - Rules of Inference

Conjunction Elimination P∧Q ∴P Figure 9 Conjunction Elimination says that given any two propositions P and Q, you are permitted to infer both P and Q individually from the conjunction P∧Q. (∧E) Example of proof of deriving P from (P∧R)∧(Q∧S) (P∧R)∧(Q∧S) A (P∧R) 1∧E P 2∧E Figure 10 Conjunction Introduction P Q ∴P∧Q Figure 11 Conjunction Introduction says that given any two propositions P and Q, you are permitted to infer P∧Q if you already have both P and Q. (∧I) Disjunction Introduction P ∴P∨Q Figure 12 Disjunction Introduction says that given any two propositions P, you are permitted to infer P∨Q for any proposition Q. (∨I) Although this rule produces weaker information, that is sometimes required to prove a conclusion. Example of proof of (P∨R)∧(Q∨R) from P∧Q P∧Q A P 1∧E P∨R 2∨I Q ...