2. Basic Structures: Sets, Functions, Sequences and Sums
2.1. Sets
Sets
Set(집합)은 순서가 없는 Object들의 모음이다.
Set의 구성요소를 Element라고 하고 Member라고 표현하기도 한다.
Set은 Element를 포함한다.
Notation으로 Set 의 라는 Element가 포함됨을 나타낼 때 라고 표현하며 Set 에 포함되지 않을 시 로 표현한다.
Set을 설명하기 위해 Element들을 나열하거나, Set builder로 표현할 수 있다.
Example
- Element들을 나열
- Set builder
- C=\{x \in \mathbf{Z^+}\mid x \ is\ odd\ positive\ integer\ less\ than\ 10\}$$$$C=\{x\in a \mid x is odd positive integer less than 10}
| Set notation | Description | List of elements |
|---|---|---|
| The set of natural numbers | ||
| The set of integers | ||
| The set of positive integers | ||
| The set of rational numbers | ||
| The set of real numbers |
Computer science에서 Datatype, Type의 개념은 Set의 개념을 기반으로 한다.
Datatype은 Set의 이름, 해당 Element에 대해 수행 가능한 Operation의 Set으로 구성된다.
Example
Boolean's Elements = , Boolean's Operation= AND, OR, NOT
두 Set이 같다는 표현은 Set , 에 대해 가 성립할 때 Notation 로 표현한다.
Element가 없는 Set을 Empty set(공집합)이나 Null이라고 부르며 Notation으로 나 로 표현한다.
Element가 하나만 있는 Set을 Singleton set(한원소 집합)이라고 부른다.
Set , 에 대해 가 성립할 때 는 의 Subset(부분 집합)이라고 하며 Notation 로 표현한다.
Empty set이 아닌 Set은 적어도 두 개의 Subset(Set 본인과 )을 가진다.
- , 즉 은 어떤 Element도 가지지 않기에 는 항상 False이므로 Vacuous Truth로 인해 Conditional statement 는 항상 True로 증명할 수 있다.
- 는 를 Proposition 라고 가정할 때 Domain 에 대해 는 항상 True이므로 True로 증명할 수 있다.
Set , 에 대해 가 성립할 때, 즉 가 의 자신을 제외한 Subset일 때 는 의 Proper subset(진부분 집합)이며 Notation으로 로 표현한다.
Set은 Element로 다른 Set을 가질 수 있다.
Example
Set 에 대해 서로 다른 Element가 정확히 개 존재할 때 이 Nonnegative integer라면 를 Finite set(유한 집합)이라고 하며 을 의 Cardinality(기수)라고 하며 Notation 으로 표현한다.
Power set
Set 의 모든 Subset을 Element로 갖는 Set을 의 Power set(멱집합)이라고 하며 Notation 로 표현한다.
Cardinality가 인 Set 의 Power set의 Cardinality는 이다.
Example
의 Powerset
\
Cartesian Products
Collection은 Set과 달리 Element의 순서가 유의미하다.
Collection을 표현하기 위해 Set과 다른 표현 방법이 필요해 Ordered n-tuple로 표현하며 Ordered 2-tuple을 Ordered pair라고 한다.
Ordered n-tuple인 은 을 첫 Element, 를 두 번째 Element, 을 n번째 Element로 갖는 Collection을 뜻한다.
두 Ordered n-tuple이 같다는 것은 각 Ordered n-tuple의 Element가 순서대로 모두 동일하다는 것이다.
Example
Ordered pair 는 이고 라는 뜻이다.
Set , 에 대해 , 의 Cartesian product는 Notation 로 표현한다.
이며 는 Ordered pair이다.
Example
일 때
Set , 에 대한 Cartesian product의 Subset 을 Set 에서 Set 로의 Relation이라고 한다.
이기 위해 여야 한다.
Set 의 Cartesian product는 으로 표기되며 Ordered n-tuple 으로 구성되며로 표현할 수 있다.
Using Set Notation with Quantifiers
Quantifier를 사용하여 Set Notation을 표현할 수 있다.
Example
Set 에 대한 모든 Element에 대해 의 Universal quantification은 이고, Existential quantification은 이다.
Truth Sets of Quantifiers
Predicate 와 Domain 가 주어질 때 의 Truth set은 가 True인 의 Element인 x에 대한 Set 이며 Notation 이다.
2.2. Set Operations
Set Operations
Union
Union은Set , 에 대해 일 때 Notation 로 표현한다.
Section
Section은 Set , 에 대해 일 때 Notation 로 표현한다.
Disjoint
Set , 에 대해 일 때 Disjoint라고 한다.
두 Finite Set , 의 Cardinality를 구할 때 로 구하는데 이를 임의의 수의 Set의 Union으로 일반화한 것을 Principle of inclusion-exclusion이라고 한다.
Difference
두 Finite set 에 대해 일 때 Notation 로 표현한다.
Complement
Set (Universal set), 에 대해 일 때 Notation 로 표현한다.
Set Identities
| Identity | Name |
|---|---|
| Identity laws | |
| Idempotent laws | |
| Commutative laws | |
| Distributive laws | |
| Absorption laws | |
| Domination laws | |
| Complementation laws | |
| Associative laws | |
| De Morgan's laws | |
| Complement laws |
Generalized Unions and Intersections
Union과 Intersection은 Associative law를 만족하기에 순서가 상관이 없다.
Example
여러 Set의 Union은 해당 Set 중 적어도 하나의 Set에 포함된 Element를 포함하는 Set이다.
Set 에 대한 Union의 Collection은 이다.
여러 Set의 Intersection은 해당 Set에 모두 포함된 Element를 포함하는 Set이다.
Set 에 대항 Intersection의 Collection은 이다.
Computer Representation of Sets
Computer에서 Set을 표현하는 방법 중 하나는 Set의 Element를 순서 없이 저장하는 것이다.
Union과 Intersection, Difference Operation이 오래걸릴 수 있다.
Computer에서 Universal set 가 Finite set(Memory size보다 작을 때)일 때 의 Element를 임의의 순서대로 저장하는 방법은 Cardinality가 인 의 임의의 Element 으로 나열한 후 길이가 인 Bit string()로 나타내며 이를 통해 Union, Intersection, Difference를 쉽게 찾을 수 있다.
2.3. Functions
Set Functions
Set 가 Nonempty set일 때 에서 로의 Functrion 는 의 각 Element 에 대해 에 정확히 하나의 Element인 를 할당하는 것이며 Notation으로 로 표현한다.
만약 가 성립할 때 로 표현하며 Function은 Mapping이나 Transformation이라고도 불린다.
일 때 Pair 는 Relation에서 를 첫 Element로 가지는 Unique ordered pair가 된다.
Function 가 Set 에 대해 에서 로의 Function일 경우 가 를 로 Mapping한다고 표현하며 는 의 Domain, 는 의 Codomain이 되며 는 의 Image, 는 의 Preimage라고 한다.
Function을 정의할 때 Function의 Domain, Codomain, Domain의 Element를 Codomain의 Element에 Mapping하는 방식을 지정한다.
만약 두 Function이 동일한 Domain, Codomain, Domain의 Element를 Codomain의 Element에 Mapping하는 결과가 같다면 두 Function은 같다고 하며 Domain이나 Codomain만이 바뀌더라도 두 Function은 같지 않다고 한다.
이다.
Function 가 Set 에 대해 에서 로의 Function일 때 의 Subset 가 존재할 때 Function 에 의한 의 Image는 의 Element들의 Image로 구성된 의 Subset이다.
의 Image는 로 표현하며 이다.
One-to-One and Onto Functions
Injection
One-to-one(=Injective) function은 두 개의 서로 다른 Domain element에 동일한 Value를 할당하지 않는다.
One-to-one function 에 대해 일 때 이며 일 때 이다.
가 One-to-one임을 표시하는 방식은 Definition의 Implication의 Contrapositive를 취함으로 구할 수 있다.
Function 가 One-to-one이라는 것을 Quantifier를 통해 나 로 나타낼 수 있다.
위 Statement들의 Universe of discourse는 Function의 Domain과 같다.
Function 가 이면 Increasing function, 이면 Decreasing function이라고 하며 각 Statement에 Equal이 빠질 경우 Strictly increasing(decreasing) function이라고 한다.
Strictly increasing function의 경우 One-to-one function이여야 한다.
Surjection
Onto(=Surjective) function은 Range와 Codomain이 같은 Function을 의미한다.
Function 가 Set 에서 로 가는 경우 가 Surjection이기 위해 의 모든 Element에 대해 인 Element 가 존재해야 한다.
Bijection
One-to-one correspondence function은 모든 Element가 One-to-one이며 Onto임을 의미하며 Bijection이라고 한다.
Inverse Functions and Compositions of Functions
Set 에 대해 에서 로 가는 One-to-one correspondence function 가 존재할 때 의 Inverse function은 에 속하는 Element 에 대해 를 만족하는 의 유일한 Element 를 할당하는 Function이며 Notation으로 로 표기하며 즉, 일 때 가 성립한다.
One-to-one correspondence를 Invertible이라고 하며 Inverse function을 정의할 수 있다는 의미이다.
Not invertible의 경우 One-to-one correspondence이지 않음을 의미한다.
Set 에 대해 Function 는 에서 로, 를 에서 로 가는 Function이라고 할 때 Function 의 Composite function은 Notation 로 표기하며 를 의미한다.
Composition 는 의 Range가 의 Domain의 Subset인 경우에만 정의 가능하다.
The graphs of Functions
Set 에 대해 에서 로의 각 Function에 대해 의 Pair set을 Function의 Graph라고 한다.
보통 Function의 동작을 이해하는 데 도움이 되도록 그림으로 표현한다.
Function 를 Set 에 대해 에서 로의 Function이라고 할 때 의 Graph는 와 같은 Pair의 Set이며 의 Subset으로 첫 Entry에 의해 가 할당한 의 Element와 두 번째 Entry가 같은 Ordered pair를 포함한다.
Some Important Functions
Floor function은 Real number 에 대해 보다 작거나 같은 가장 큰 Integer를 할당하며 Notation 로 표현한다.
Ceiling function은 Real number 에 대해 보다 크거나 같은 가장 작은 Integer를 할당하며 Notation 로 표현한다.
| Floor and ceiling function's Properties |
|---|
2.4. Sequences and Summations
Sequences
Sequence는 Ordered list를 나타내기 위해 사용되는 Discrete structure이다.
Sequence는 Integer의 Subset에서 Set 로의 Function으로 나타내며 Sequence의 특정 Element를 Term이라고 한다.
Geometric progression은 와 같으며 Inital term은 , Common ratio는 이다.
Arithmetic progression은 와 같으며 Initail term은 , Common difference는 이다.
Finite sequence는 String으로도 표현되며, String 의 길이가 0일 경우 Empty string, Notation 로 표현한다.
Special Integer Sequences
Sequence의 Term을 구성하는 Formula를 찾는 데 여러 Term들을 확인하여 추측하는 데 도움이 될 수 있다.
패턴을 찾는 것이 유용한데 아래의 사항들을 고려하는 것이 좋다.
- 같은 Value가 여러번 연속되는가?
- 이전 Term에서 같은 Value나 위치에 따라 달라지는 Value를 더하여 Term을 얻는가?
- 특정한 Value의 수를 Product하여 이전의 Term에서 Term을 얻는가?
- 이전의 Term을 특정한 방식으로 결합하여 Term을 얻는가?
- Term 사이에 주기가 존재하는가?
| nth Term | First 10 Terms |
|---|---|
| n^2 | 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, … |
| n^3 | 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, … |
| n^4 | 1, 16, 81, 256, 625, 1296, 2401, 4096, 6561, 10000, … |
| 2^n | 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, … |
| 3^n | 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, … |
| n! | 1, 2, 6, 120, 720, 5040, 40320, 362880, 3628800, … |
Summations
의 Summation은 Notation 로 표현한다.
위 Variable 를 Index of summation, 을 Lower limit, 을 Upper limit이라고 한다.
Theorem
Real number 에 대해 일 때 이다.
- Proof
로 치환하여 아래의 식을 전개한다.
| Sum | Closed Form |
|---|---|
Cardinality
Set 가 에서 로의 One-to-one coresspondence가 존재할 때만 같은 Cardinality를 가진다.
Infinite set을 Natural number set과 같은 Cardinality를 가진 Set과 다른 Set으로 나누게 되는데 이 때 Finite set이거나 Positive integer와 같은 Cardinality를 가진 Set을 Countable, 그렇지 않은 Set을 Uncountable set이라고 부른다.
Infinite set 가 Countable일 때 의 Cardinality를 로 표현하며 즉, Notation으로 로 표기하고 의 Cardinality가 Aleph null이라고 한다.
Infinite set은 Set의 Element를 순서대로 나열할 수 있는 경우 Countable이라고 한다.
Uncountable set의 예시로는 Real number set이 존재한다.