2019 Spring SKKU Discrete Mathematics (이산수학)


        Record of your DM class

 

          (Flipped/PBL Action Learning)

   

   

       It was a good class because of you.  Thanks a lot ~~

 

Class: Discrete Mathemetics

 

              Prof : Sang-Gu LEE   sglee at skku.edu

 

           http://matrix.skku.ac.kr/2019-album/

 


Students: Mr 김찬호, 김두원, 박재형, 최세현, Dam 담딘바자르, Piran, Angel, Gam, Simen, Chae, 김진녕, Greek, Dulkoon, ...




(1) State more than 10 DM Definitions and concepts and Theorems what you learned from the Chapters.



1.   Mathematical Induction


  Mathematical induction is a technique for proving a statement -- a theorem, or a formula -- that is asserted about every natural number. The Mathematical Induction is a proof technique to prove a statement is true for every positive integer. There are 2 steps for it – Basis Step and Inductive Step.


2.   Sequences and Strings


  A sequence is an ordered list of elements, which can be infinite and finite. Usually, lists of elements are represented by indexed letters. A string of length n on an alphabet l of m characters is an arrangement of n not necessarily distinct symbols from l. There are such distinct strings.


3.   Relations


  Relations are relationships between 2 or more sets and their objects that related to each set. Sets of ordered pairs are called binary relations.


...


  Sorting


  Sorting Algorithms, a sorted array is an array that is in a particular order. For example, [a,b,c,d] is sorted alphabetically, [1,2,3,4,5] is a list of integers sorted in increasing order, and [5,4,3,2,1] is a list of integers sorted in decreasing order.


 ...


               http://matrix.skku.ac.kr/2019-Album/MH-PBL/index.htm

 

Sets and logics

(Chapter 1)

1. Sets

2. Cardinality

3. Union, intersection, difference

4. Universal set and complement

5. Venn diagram

6. Disjoint and Partition

7. Proposition

8. Conditional Propositions

9. Rules of Inference

10. Quantifiers

Proofs

(Chapter 2)

1. Proof by contradiction

2. Well-Ordering Property

3. Direct Proof

4. Counter Examples

5. Proof by Contrapositive

6. Proof by Cases (Exhaustive proof)

7. Proof of Equivalence

1. Existence Proofs

2. Mathematical Induction

3. Strong Form of Induction

Functions,

Sequences, Relations

(Chapter 3)

1. Functions

2. Domain and Range

3. One-to-One and Onto function

4. Bijection

5. Sequences and Strings

6. Relations

7. Reflexive relation

8. Symmetric relation

9. Transitive relation

10. Equivalence Relations

Algorithms

(Chapter 4)

1. Algorithms

2. Searching : binary search

3. Sorting : insertion sort

4. Time and Space for Algorithms

5. Randomized Algorithm

6. Big-O Notation

7. Recursive Algorithms : robot walking

8. Fibonacci sequence

 

Number Theory

(Chapter 5)

1. Divisors

2. Prime Number

3. Composite Number

4. Fundamental Theorem of Arithmetic

5. Transitivity of Divisibility

6. Number System

7. Adding Binary Numbers

8. GCD and LCM

9. The Euclidean Algorithm

10. BÉZOUT’'S Theorem

Counting

Method

(Chapter 6)

1. Multiplication Principle

2. Addition Principle

3. Inclusion-Exclusion Principle

4. Permutations

5. Combinations

6. Catalan Number

7. Fibonacci number

8. Binomial Coefficients

9. Pascal’s triangle

10. The Pigeonhole Principle

Recurrence Relations

(Chapter 7)

1. Recurrence Relation

2. Tower of Hanoi

3. The Cobweb in Economics

4. Ackerman’s Function

5. Linear homogeneous recurrence relation with constant coefficient

Graph Theory

(Chapter 8)

1. Similarity Graphs

2. Paths and Cycles

3. Konigsberg Bridge Problem

4. Hamiltonian Cycles

5. A Shortest-Path Algorithm : Dijkstra’s Shortest-Path Algorithm

6. Representations of Graphs : adjacency matrix, Incidence Matrix

7. Isomorphic Graphs

8. Planar Graphs

9. Kuratowski’s Theorem

10. Euler’s Formula for Graphs

 

 (2) State 9 things that you know/can/find after you studied the first 9 Chapters.


Chapter 1

We grasped the fundamental concept of Discrete Mathematics along with Computer Science, especially the sets – which are always used in coding. The propositions were directly linked to the Boolean, which I learn in my Logic Circuits class, and with the knowledge, I was able to make more sense out of the class I had taken a year ago.

Chapter 2

The concepts were mainly about proofs – their application and difference between related proofs. Proofs have always been a huge part of both Mathematics and Computer Science, and we learnt it, mostly, in elementary school. Even in real life situations, proofs have always made significant impacts – declaring about true or false.

Chapter 3

As we learnt in middle school and have been learning in colleges, functions have always been a crucial part of mathematics due to their applications on calculation. However, functions in Discrete Mathematics are mainly used to solve problems, whereas in high school we usually apply it on precise calculation.

Chapter 4

We learn about the most crucial topic of both Discrete Mathematics and Computer Science – Algorithm. Algorithm has always been the topic in the IT industry because we engineers have to deal with problems every day. With its applications, we learn about sorting algorithms, which is a sorted array is an array that is in a particular order.

Chapter 5

We gained the very fundamental knowledge of Computer Science – Number Theory, In the chapter, different number systems and representations of integers were introduced, more specifically, finding the common divisor and number base converters such as decimal to binary. Furthermore, we learnt binary addition, which is, I think, easier than adding the decimals. From my experience, I made lots of number base converter using different programming languages and implementing it on Discrete Mathematics was almost the same as I did on Python.

Chapter 6

We mainly learnt about Counting Methods and Pigeonhole Principle. However, it was based on what we learnt in middle school – Probabilities and Statistics. We consider whether it should be duplicated to find the answer. The 2 interesting topics in the chapter were Catalan Number and Fibonacci Number.

Chapter 7

We were introduced Recurrence Relation and how to solve them. A recurrence relation defines a sequence by giving the n th value in terms of its predecessors. Then the value is given in terms of the immediately preceding value. In order for a recurrence relation to define a sequence, a “start-up” value or values must be given. These startup values are initial conditions. A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation.


Chapter 8

We learnt about Graphs and their different types and fundamental structures and definitions. Graphs are drawn with dots and lines. Dots are vertices. The lines connecting the vertices are edges. The edges are e1 e2 etc. Path is from V0 to Vn. Simple Graph A graph with neither loops nor parallel edges is a simple graph. Simple cycle is a loop cycle etc.


Chapter 9

The famous Tree, which is popular amongst the Computer Science students, was introduced. We learnt difference between a “Tree” and a “Rooted Tree”. On top of that, binary tree that can only have 2 children at most. Probably, the most interesting chapter to CS students.


Source : http://matrix.skku.ac.kr/2018-DM/DM-Ch-1-Lab.html


Chapter1


1. Sets (집합)


A collection of objects.

The objects are elements or numbers.

The order of objects is not taken into account.

The set have distinct elements.


There are lot of set notation.


Equal : If set X and Y have same elements, X and Y is equal.

Empty set (공집합) : The set with no elements. It denoted by the symbol ∅.

Subset (부분집합) : Every element of the subset is an element of the original set.

Proper subset (진부분집합) : It is same as subset, but it does not include the set that is equal to the original set.

Power Set (멱집합) : The set of all subsets(proper or not) of a set.


2. Cardinality (집합의 크기)


If X is a finite set, |X| = number of elements in X.

|X| is the cardinality of X.

For example, the cardinality of set {1, 2, 3, 4, 5} is 5.


3. Union, intersection, difference (합집합, 교집합, 차집합)


Given two sets X and Y.

Union(합집합) : X∪Y = { x | x ∈ X or x ∈ Y}

The union consists of all elements belonging to X, Y or both.

Intersection(교집합) : X∩Y = { x | x ∈ X and x ∈ Y}

The intersection consists of all elements belonging to both X and Y.

Difference : X-Y = { x | x ∈ X and x ∉ Y}

The difference consists of all elements which belongs to X but not to Y.


4. Universal set and complement (전집합, 여집합)


U is a universal set or universe.

Given a universal set U and X ⊆ U, the set U - X is the complement of X.

XC is the complement of X.

UC is the complement of ∅.



5. Venn diagram (벤 다이어그램)


In a Venn diagram, a rectangle depicts universal set.

Subsets of the universal set are drawn as circles.

The inside of a circle represents the numbers of that set.

By Venn diagram, we can easily find the relation between sets.




6. Disjoint and Partition (서로소, 집합의 분할)


Disjoint (서로소)

X ∩ Y = ∅ means sets X and Y are disjoint.

If X and Y are distinct sets in S, X and Y are disjoint.

We can assume a collection of sets S is pairwise disjoint.


Partition (집합의 분할)

A partition of a set X divides into non-overlapping subsets.

If every element in X belongs to exactly one member of S, a collection S of non-empty subsets of X is a partition of the set X.

If S is a partition of X, then S is pairwise disjoint.


7. Proposition (명제)


If a sentence is either true or false but not both is called a proposition. The propositions are the basic building blocks of any theory of logic.

For example, a sentence “this apple is red” is a proposition. However, “this apple is delicious” is not a proposition. That sentence can not be definite as true or false.


Let p and q be propositions.


p∧q is conjunction of p and q. It can be read as the proposition of “p and q.”

p∨q is disjunction of p and q. It can be read as the proposition of “p or q.”

¬p is negation of p. It can be read as “not p.”

without parentheses, there is a precedence in these operators. ¬ > ∧ > ∨.



8. Conditional Propositions (조건 명제)


Let p and q be propositions.


“if p then q” is a conditional proposition.

conditional proposition is denoted as p → q.

p is the hypothesis

q is the conclusion.


 

p

q

p→q

¬p

¬p∨q

T

T

T

F

T

T

F

F

F

F

F

T

T

T

T

F

F

T

T

T


p → q is equivalent to ¬ p ∨ q

if p is false, conditional proposition p → q is always true. (tautology)



9. Rules of Inference (추론 법칙)


Deductive reasoning (연역적 추론)

The process of drawing a conclusion from a sequence of propositions.

Deductive reasoning is the process of reasoning form hypothesis to reach a conclusion.

The given propositions are the hypotheses.

The proposition that follows from the hypotheses are the conclusion.

A argument consist of hypotheses and a conclusion.

Deductive argument can be formed as “If p1 and p2 and p3 and p4 then q.”


Rules of inference for propositions.

 

Rule of Inference

Name

Rule of Inference

Name

Modulus poenens

(긍정식 논법)

Conjunction

(논리곱)

 

Modulus tollens

(부정식 논법)

Hypothetical syllogism

(가설적 삼단논법)

Addition

(추가법)

Disjunctive syllogism

(논리합 삼단논법)

Simplification

(단순화)

 

 

       


10. Quantifiers (한정사)


 is a statement involving the variable .  is a set.

For each ,   is a proposition.

 is a propositional function (명제 함수)

 is the domain of discourse (담론영역)  of .


for every 

is a universally quantified statement of .

The symbol  means “for every.”

The symbol  is a universal quantifier (범용 정량자, ).


there exists 

is an existential quantified statement.

The symbol  means “there exists.”

The symbol  is an existential quantifier of .



1) Venn diagram


 벤 다이어그램(Venn diagram)은 집합에 대한 도식적 관점을 제공한다. 즉, 집합의 관계를 그림으로 나타내어, 시각적으로 우수한 표현 방법이다.

 벤 다이어그램에서 사각형은 전체집합, 원은 전체집합의 부분집합, 원의 내부는 그 부분집합의 원소들을 나타낸다. 원이 겹치는 부분은 교집합, 겹치지 않는 부분은 그 집합에서 다른 집합을 뺀 원소 부분 등을 나타낸다.



2) Cartesian Product


 만약 가 집합이면, 이고 인 모든 순서쌍 의 집합을 나타낸다. 이 집합 의 데카르트 곱(Cartesian Product)이라 한다.


 만약 이고 라 하면 다음과 같다.


                     



3) Truth table


 명제 파트에서는 논리곱과 논리곱을 배우는데, 이들을 이용한 명제의 진리값은 진리표(Truth table)로 설명할 수 있다. 개별 명제인 으로 이루어진 진리표 이 갖는 진리값의 모든 조합을 나열해서 만들어진다.

 T는 참을 의미하고, F는 거짓을 의미하며, 이들의 조합은 의 진리값이다. 우리는 논리합과 논리곱을 정형적으로 정의하기 위하여 진리표를 사용한다.



4) Deductive reasoning


 일련의 명제들로부터 결론을 유도하는 과정을 연역적 추론(Deductive reasoning)이라고 부른다. 가설 또는 전제를 바탕으로 결론을 이끌어낸다.

 수학 및 컴퓨터의 많은 증명들이 연역적 논법을 사용한다고 한다. 모든 논법은 다음과 같은 형식을 갖는다.


                   만약 그리고 그리고 그리고 이면 이다.




5) Disproving a universally quantified statement


 다음 식을 반증(disprove)하는 것은


        


를 거짓으로 만드는 논의 영역에 속한 하나의 원소 를 찾으면 간단히 이루어진다. 그러한 값을 반례(counter example)라고 부른다.




6) Mathematical Induction


 수학적 귀납법(Mathematical Induction)은 참인 문장 을 증명하기 위한 증명 방법으로 두 단계로 실시된다.


 제일 먼저 이 참임을 보인 다음, 모든 에 대하여 이 참이면 이 참임을 보여준다. 그렇게 되면, 이는 도미노처럼 부터 모든 에 대해서 연쇄적으로 참임이 증명된다.




7) Floor and Ceiling function


 의 바닥함수(floor function)는 로 표시하며, 이 함수가 뜻하는 것은 보다 작거나 같은 최대 정수이다.


 의 천장함수(ceiling function)는 로 표시하며, 이 함수가 뜻하는 것은 보다 크거나 같은 최소 정수이다.



          

           Floor Function

          

       Ceiling Function


8) One-to-one function


 일대일함수(one-to-one function), 또는 단사 함수(Injective function)은 정의역에 속한 각각의 다른 원소들을 공역에 속한 각각의 다른 원소로 대응시키는 함수이다. 이를 수식을 통해 나타내면 다음과 같다.


에서 로의 함수 가 모든 에 대해, 가 기껏해야 한 개 존재하면 이 함수를 일대일함수 또는 단사함수라고 한다.



9) Inverse function


 변수와 함숫값을 서로 뒤바꾸어 얻는 함수이다. 즉, 에서 로의 함수 가 전단사함수라고 가정한다면, 를 만족하는 함수 를 함수 의 역함수라고 한다.


The function is the inverse of the function






10) Sequences


 수열(Sequence)은 수들의 정렬된 나열이다. 수열의 정의역은 연속된 정수의 집합으로 구성된다. 수열에는 유한수열(Finite sequence)과 무한수열(Infinite sequence)이 있다. 유한수열은 수열의 정의역이 유한한 수열을 뜻하고, 무한수열은 수열의 정의역이 무한한 수열을 뜻한다. 유한수열과 무한수열의 표기는 다음과 같이 표기한다.


          유한수열 : (인덱스가 부터 인 유한수열 )

          무한수열 : (첫 번째 인덱스가 인 무한수열 )


11) Strings


 문자열(String)은 문자들의 유한한 나열이다. 의 문자열은 에 속하는 원소들의 유한 수열이다.

 널 문자열(null string)은 원소가 하나도 없는 문자열을 뜻하고 로 표기한다.

 문자열 의 부분 문자열(substring)은 의 일부 또는 연속된 모든 원소들을 선택함으로써 구해진다.


12) Algorithms


 알고리즘(Algorithm)이란 어떤 문제를 단계적으로 해결하는 방법을 말한다. 알고리즘은 몇몇 특성을 가지는데 다음과 같다.


입력값 : 알고리즘은 입력을 받는다.

출력값 : 알고리즘은 출력을 만든다.

명확성 : 단계들은 명확하게 진술되어야 한다.

결정성 : 각 단계가 실행된 후의 실행 결과는 입력과 바로 전 단계의 결과에 따라 유일하게 결정된다.

유한성 : 알고리즘은 종료한다. 즉 유한한 많은 명령이 실행된 후에는 반드시 끝난다.

정확성 : 알고리즘에 의해 생성된 출력은 정확하다. 즉 알고리즘은 문제를 정확하게  해결한다.

일반성 : 알고리즘은 입력의 집합에 적용된다.



13) Searching and Sorting


 탐색(Searching)은 주어진 데이터에서 특정 데이터를 찾는 것을 탐색이라고 하며, 컴퓨터의 시간 중 많은 양이 탐색에 할애된다고 한다.


 반면에 정렬(Sorting)은 어떠한 특정한 순서로 배열함을 의미한다. 즉, 주어진 데이터를 우리가 원하는 순서로 재배열을 시키는 것을 의미하는 것이다.


 탐색과 정렬 모두 여러 가지 방법이 존재하고, 방법에 따라 시간복잡도 역시 다르다. 따라서 우리가 원하는 방법을 적절하게 사용하는 법을 터득해야 한다.

14) Inclusion-Exclusion Principle


 조합론에서, 포함배제의 원리는 유한 집합들의 합집합의 원소를 세는 기법 중의 하나이다. X와 Y가 유한 집합이라고 가정할 때, 다음이 성립한다.


              

15) Permutations and number of Permutations


 순열은 순서가 부여된 임의의 집합을 다른 순서로 뒤섞는 연산이다. 즉, 순열은 정의역과 공역이 같은 일대일 대응이다. n개의 원소의 순서를 뒤섞는 순열의 개수는 n의 계승 n!과 같다. 즉, n 이하의 양의 정수를 곱한 값이다.



16) Recurrence relation


 점화식 또는 재귀식이란 인접한 항들 사이의 관계식을 말한다. 즉, 수열 의 각 항 이 함수 를 이용해서 처럼 귀납적으로 정해져 있을 때, 함수 를 수열 의 점화식이라고 하며, 또한, 수열 는 점화식 로 정의된다고 한다.

 점화식을 푼다는 것은 귀납적으로 주어진 수열 의 일반항 의 명시적인 식으로 나타내는 것을 말한다.



17) Bipartite Graph


 이분 그래프는 모든 꼭짓점을 빨강과 파랑으로 색칠하되, 모든 변이 빨강과 파랑 꼭짓점을 포함하도록 색칠할 수 있는 그래프이다. 이를 수식으로 나타내면 다음과 같다.






(2) State more than 9 things that you know/can/find after you studied the first Chapters.


1) Cartesian Product


 위에 1)에서 배운 내용이라 개념에 대한 추가설명은 하지 않겠다. 데카르트 곱을 통해 배운 것은 곱하는 순서에 따라 원소쌍이 달라진다는 것이다. 예를 들기 위해 위에서 사용한 예를 들고 오겠다. 만약 이고 라 하면 다음과 같다.



이다. 이렇듯 일반적으로 인 것을 보여준다. 따라서 데카르트 곱은 일반적인 곱셈과는 다르다는 것을 알 수 있었다.


 그리고 인 것 또한 알 수 있었다. 그 이유는 순서쌍의 첫 번째 요소로 의 원소를 고르는 방법은 3가지이고, 순서쌍의 두 번째 요소로 의 원소를 고르는 방법은 2가지이기 때문에 이다. 앞의 논법은 임의의 유한 집합 에 대하여 성립하므로 즉, 는 항상 참임을 알 수 있다.



2) Rule of Inference


 명제에 대한 추론 규칙은 가설에 따라 결론을 유도하기 위한 여러 방법들을 나타낸 것이다. 우리는 총 7개에 대한 규칙을 배웠고, 이것들을 각각 이해하기 위해서 예시를 통해 정리하였다. (Q&A 게시판에도 올렸음)


1) Modulus Poenens (긍정식 논법)

p→​q     // If it rains, we won't be able to play soccer.

p         // It's raining.

------

​ q      // We cannot play soccer.


2) Modulus Tollens (부정식 논법)

p→​q     // If she gets up late, she will miss the train.

~q       // She didn't miss the train.

------

​ ~p    // She didn't get up late. 

 

 


3) Addition (추가법)
p         // He studies very hard - Let this is true.

------

​ p∨q  // Either he studies very hard OR he is a smoker.

 

Whether 'q'is true or not, the proposition 'p∨q​' is always true!


4) Conjunction (논리곱)

p         // He studies very hard.

q         // He is genius.

------

​ p^q  // He studies very hard and he is genius. 

 

If 'p' and 'q' are two premises, we can use 'Conjunction' rule to derive 'p^q'.


5) Sim
plification (단순화)

If p^q is a premise, I'm sure this will be not so difficult to understand Simplification rule.

 

 

6) Hypothetical syllogism (가설적 삼단논법)
p→​q     // If it rains, we won't be able to play soccer.

q→​r      // If we won't be able to play soccer, we won't need to buy uniforms.

------

​ p→​r  // If it rains, we won't need to buy uniforms.

 


7) Disjunctive syllogism (논리합 삼단논법)

p​
​q     // The ice cream is either vanilla flavored or chocolate flavored.

~p       // The ice cream is not vanilla flavored.

------

​ q     // The ice cream is chocolate flavored.



3) Mathematical Systems


 수학적 체계(mathematical system)는 공리(axiom), 정의(definition), 그리고 정의되지 않은 용어(undefined term)로 구성된다.


 공리는 참이라고 가정한다. 정의는 기존의 개념을 이용하여 새로운 정의를 만드는 데 사용된다. 일부 용어는 명확하게 정의되지 않아서 오히려 공리를 이용하여 정의된다. 수학적 체계 내에서 정리를 유도할 수 있다.


 정리(theorem)는 참이라고 증명된 명제이다. 특수한 유형의 정리로서 보조 정리와 따름정리가 있다. 보조 정리(lemma)는 자신이 참이라는 것 자체는 큰 관심사가 아니지만 다른 정리로부터 쉽게 얻어지는 정리이다. 따름 정리(corollary)는 다른 정리로부터 쉽게 얻어지는 정리이다.


 정리가 참임을 확립하는 논법은 증명(proof)이라고 부른다. 논리는 증명의 분석을 위한 도구이다.



4) More Methods of Proof


 모순에 의한 증명(proof by contradiction)은 가설 가 참이고 결론 가 거짓이라는 가정 아래 를 수립하며, 수학적 체계와 함께 를 이용하여 모순을 유도한다.


 대우에 의한 증명(proof by contrapositive)은 특별한 경우의 모순에 의한 증명으로부터 유도된 증명방법으로, 의 모순에 의한 증명이 를 추론하므로 이를 정리한 를 뜻한다.


 경우에 의한 증명(proof by case)은 본래의 가설이 여러 가지 경우로 자연스럽게 나누어질 수 있을 때 사용된다.



5) Strong Form of Mathematical Induction


 강한 형식의 수학적 귀납법(Strong Form of Mathematical Induction)은 참인 문장 을 증명하기 위한 증명 방법으로 두 단계로 실시된다. 이 때 일반적인 수학적 귀납법과의 차이점은, 증명해야 할 문장은 으로 표시한다는 점이다.


 제일 먼저 이 참임을 보인 다음, 모든 에 대하여 만약 인 모든 에 대하여 가 참이면 이 참임을 보여준다. 그렇게 되면, 이는 모든 에 대해서 연쇄적으로 참임이 증명된다.



6) Bijection function


 단사함수이고 동시에 전사함수인 함수를 전단사함수(bijection function)라고 한다. 이를 수식으로 나타내면 다음과 같다.


         


7) Equivalence relation


 를 집합 의 분할이라 하자. 내의 어떤 집합 에 대해서 모두 에 속하는 것으로 정의하면, 은 반사적, 대칭적, 추이적이다. 만약 이면 의 멤버들을 관계 의 관점에서 동등하다고 간주할 수 있고, 이러한 이유로 반사적이고, 대칭적이며 추이적인 관계를 동치관계라고 한다.



8) Equivalence class


 관계 을 집합 에서의 동치 관계라고 하자. 모든 에 대해 집합 를 관계 에 대한 에서의 동치 클래스(Equivalence class)라고 한다. 이 때 집합 는   로 정의된다.



9) Matrix of the relation


 행렬은 에서 로의 관계 을 나타내는 편리한 방식이라고 한다.


 의 원소를 (임의의 순서로) 행에, 의 원소들을 (임의의 순서로) 열에 배치하고, 이면 열을 1로, 그렇지 않으면 0으로 지정한다.


 이렇게 만들어진 행렬을 관계 R의 행렬이라고 한다.



             Example of the matrix of the relation (from textbook)




10) Big O, Omega, Theta notation


 

 빅 오, 오메가, 세타 표기법은 알고리즘의 실행 시간이나 실행 공간을 비교할 때 중요한 표기법이다. 이들을 표기할 때는 최고차항의 차수를 바탕으로 표기하며, 이들의 개념을 확실히 알아두어야 나중에 알고리즘에 대한 분석이 편해질 것으로 생각된다.




10) Combination


 

 조합론에서, 조합은 집합에서 일부 원소를 취해 부분집합을 만드는 방법을 말한다. 그 경우의 수는 이항계수이다. 위의 표와 같은 결과가 도출된다.



11) The Pigeonhole Principle


 비둘기집 원리는 n+1개의 물건을 n개의 상자에 넣을 때 적어도 어느 한 상자에는 두 개 이상의 물건이 들어있다는 원리를 말한다. 보통 비둘기와 비둘기집의 형태로 비유되어 쓰인다. 이 원리는 간단한 귀류법으로 증명할 수 있고, 이 증명은 대표적인 존재 증명이다.

12) Some basic infomations about Graph


 그래프는 점과 선으로 그려진다. 여기서 점은 꼭짓점, 선은 모서리를 의미한다. 꼭짓점 에서 시작하여 을 지나, 를 지나, 최종적으로 에 도착한다. 이 때의 경로는 부터 까지이다.


 보다 자세한 용어 설명은 다음과 같다.




1. Power Set

- Power set이란, X라는 집합의 모든 subsets들의 집합을 말한다. 여기서 subset이란 만약 P와 Q라는 집합이 있을 때, P의 모든 원소들이 Q의 원소에 포함될 때 P가 Q의 subset이라고 한다. 즉, Power set이란 X라는 집합에서 가능한 모든 subset들의 집합이란 것을 알게 되었다.


2.Venn diagram

- 벤 다이아그램이란, 시각적으로 집합들의 포함관계를 나타낼 수 있는 가장 직관적인 방법이라고 생각한다. 전체 범위인 사각형안에 집합을 나타내는 원들을 비교하면 쉽게 결과를 도출해낼 수 있기 때문이다. idempotent, associative, commutative, distributive와 DeMorgan’s laws등을 적용시키기에 무리가 없고, 쉽게 이해하게 하는 핵심적인 개념이라 생각한다.


3.Conjunction and disjunction of propositons.

- p와 q가 명제라고 할 때, p∧q에서 ∧는 conjunction of p and q이며, 이는 읽을 때, p and q라고 읽는다. 그리고 p∨q에서 ∨는 disjunction of p and q이며, 읽을 때 p or q라고 읽는다. 이로 인해 명제들의 접속사를 알게 되었고 이를 이용해서 truth table에서 값을 구할 수 있다는 것을 알았다.


4.Truth Table

- 명제의 진위를 판별할 때, 안정적으로 결과를 도출할 수 있게하는 표이다. 이 진리표는 논리 연산을 할 때, 모든 가능한 편성을 열거하고 각각의 조합에 대해 True나 False의 값을 대입한다. 이렇게 표시함으로써 해당되는 명제의 진위를 알기 쉽게 설명할 수 있고 반례를 찾을 때도 쉽다는 걸 알았다.


5.Conditional Proposition(조건 명제)

- 조건 명제는 만약 p와 q라는 명제가 있을 경우 p이면 q이다 라는 것이 조건 명제이다. 기호로는 p->q라고 표현한다. 이 조건 명제가 쓰이는 경우는 정말 많아서 중요한 개념이고, 여기서 명제 p는 hypothesis(가설), q는 conclusion(결론)이라고 정의한다. p->q는 조건연산자로 표현이 가능한데, -p∨q라고 나타낼 수 있다는 걸 알았다.


6.Mathematical Induction

- 수학적 귀납법이라고 불리는 이 개념은 주어진 명제 P(n)이 모든 자연수에 대하여 성립함을 보이기 위해 사용되는 증명법이다. 첫 번째 명제가 참임을 증명하고 P(n)이 참이라면 P(n+1)또한 참이라는걸 증명하면 P(n)은 모든 자연수에서 참이다. 이는 증명법에 있어서 중요한 부분중 하나이며 이로 많은 문제들을 귀납법으로 풀 수 있었다.


7.Rule of inference

- p->q and p are true면 q도 true가 타당하면 이를 Modulus poenens(긍정식 논법)이라고 한다. 이러한 논법도 여러 가지 종류가 있다. p->q,-q가 참이면 -p가 참인 Modulus tollens(부정식 논법)도 있으며, p->q,q->r이면 p->r인 Hypothetical syllogism(가설적 삼단논법)또한 있다. 이러한 Rule of inference는 명제들의 진위들을 판별할 때 상당히 도움이 될만한 정의임을 깨달았다.


8. Quantifiers

- 명제함수 P가 D라는 담화영역안에서 모든 x에 대해서 P(x)이라는 것을 기호로 표기하면 ∀x, P(x)이다. 이것은 universally quantified statement of P(x)이다. ∀x는 모든이라는 뜻이다. 또한, 어떤 x에 대해서 P(x)이라는 것을 기호로 표기하면 ∃x, P(x)이고 이는 existentially quantified statement이며 ∃x는 어떤이라는 뜻이다. 이를 이용해서 명제함수들의 참, 거짓을 판별할 수 있다는 것을 알 수 있었다.


9.gcd(greatest common divisor),lcm(least common multiple)

- 최대공약수와 최소공배수의 개념이다. 최대 공약수는 두수의 약수(divisor)중에서 제일 큰 약수이며, 최소 공배수는 두 수를 곱했을 때 그 값에서 제일 작은 약수를 찾는 것이다. 양수일 때, 최대공약수와 최소공배수를 곱했을 때 두 수의 곱이 나온다는 것을 새롭게 알게되었고, number theory에서 크게 중요한 부분이라는 것이라고 생각했다.


10.One to One function, Onto fuction(injective, surjective)

- 일대일 함수는 단사(injective)함수라고도 불리우는데 함수 f:X->Y에서∀a,∀b∈X에 대해서 f(a)=f(b)이면 a=b가 성립한다.또한 일대일 대응 함수라고 불리는 전사(surjective)함수는 Y의 모든 원소가 함수에 대응한다. 모든 원소 y는 모든 원소 x에서 f(x)=y라고 보면 된다. 함수는 관계를 파악하는데 있어서 중요한 개념중 하나라는 것을 알 수 있다.



◆ Ch. 1    Personal Reflection Note


(1) Do you understand the most of contents of this learning process?


Flipped class is a new way to improve not only participation in class, but also students’ self-understandings. Traditionally, we would listen to lectures in class so that we usually don’t have enough time for direct contact with professors. At first, it was perhaps weird to watch lectures and understand the contents, but I wouldn’t say it was hard because I was so used to the traditional lectures.

Moreover, I have never been in a single class that offers a very active feedback on i-campus, which I really like because of short-time feedbacks from both students and Professor 이상구. Being proactive in both class and i-campus encourages me to increase my performance.

Nevertheless, I would not say the flipped class is everything because Professor 이상구 made so much for the class – his genuine help and feedbacks towards the students were professional and genuine, which I sincerely respect. He has the ability to look through students and thus helping them figure out their weakness or improvement room to be better in every possible way.


(2) What did you learn through the learning activities of this course?


        Specifically, the implementations Professor 이상구 made in class encourage me to learn through the active base of students in both offline and online methods. Indeed, I learnt the Discrete Mathematics concepts thoroughly, but the course helped me gain new methods of studying such as improved self-studying, more direct conversations with Professor 이상구 on both offline and online sites, and significantly better approach to effective and efficient studying.


(3)  What have you learned from other colleagues?


As expected of Korean students, the competitiveness is high, but it doesn’t mean they don’t help each other. I liked the students’ feedback in a quick instant to lend a hand. Even though, we don’t know each personally, I felt their efforts in helping, which is astounding.


(4)  How do you apply newly learned information to real world problems?


Flipped class definitely helped me gain a new perspective to see the simple, but not-that-simple situations. For instance, when I work in a group, we usually tend do stuff in the only times we met. However, implementing this new learning process, our work and performance improved dramatically because we do and learn the stuff by ourselves, and thus each of us approaches the problem differently. Hence, when we meet up, it was marvelous to see such differences in teammates as new perspective, new solutions, and better combined solutions.


(5)  What kind of learning materials have you used to study?


Indeed, textbooks and lecture materials are always used; nevertheless, with the flipped class, I managed to use many sources of information such as recorded lectures. Traditionally, we would not have time to discuss with professors due to the fact that we have to concentrate on lectures and professors’ explanations during the class, so we could not ask questions or think the other way. Therefore, when I listen to lectures online before class, lots of questions or misunderstood concepts came up so that I would be able to make questions and clarify the stuff in class. It enhanced my ability to critically think.



(6)  Self-Evaluation for Q/A Activities.


I registered for the class after week 1, so at first it seemed as if I missed lots of class rules and principles. I missed the opportunity to summarize or review the lectures of first week; however, I thank professor 이상구 letting me make up for them. I was able to catch up with others due to his efforts towards students. I might not have made much efforts in the first 2 weeks, but I have been adjusting myself for the class. I was able to make lots comments with students and help them with my own clarifications that my classmates might have had.

However, I think my efforts are not enough for perfection or at least not up to Professor 이상구’s expectations because I could not make and solve problems in QnA. I would like to improve aspects that are lacking.

Furthermore, I quickly managed myself to adapt the Question and Answer, so I am happy with my recent drastic improvement.


My Score:     9/10.



◆ Ch. 2 Self-Evaluation [Your Opinions]


(1) Satisfaction according to the self-evaluation.


I am greatly grateful for class contents and performance of Professor 이상구. He helped me in various ways to let me improve not only my academic principles, but also self-performance. I was able to gain new perspective towards problems; additionally, I gained a self-discovery, which means I have got to see my what I might spike at.

More importantly, I really thank Professor Lee Sanggu for his excellent methods of teaching and students who are excellent in their own ways. Everyone in the class let me realize that there is always room for growth and improvement.


(2) Sorrow according to the self-evaluation.


Although I am contented with class methods and efforts of others, my performance might have lacked in problem solving due to inadequate number of solved problems. I would like to improve this weakness of mine over the course of class in short period of time. Indeed, I was sort of inactive in the first 2 weeks since I missed the week 1 due to registering for the class late – from week 2. I want to perform significantly better for better efforts for both class and classmates.

However, I don’t regret because even though I was sort of left behind in the first few weeks, now that I am caught up, I am doing pretty well with some amazing classmates I found in the class.



◆ Ch. 3 Colleague who helped your learning


   Name of your classmate: 김찬호, 최세현, 박재형


(1) Reasons to recommend them:


The reason why I am recommending them is not simply because they are my team members, more importantly, they let me strive learning more and made teamwork so much fun. They are the geniuses in the team. As upper-class students, they encouraged me to learn different subjects in other aspects and helped me various ways to get better. I’m extremely happy that I got to join the team and work with them. 김찬호 got the leadership and energy that fuel us to do more. 최세현 and 박재형 are the brains of the team, and they can solve any problem. They made me feel that I have got a lot learn from them, and I really grateful for it.


(2) Your suggestion for them to improve his contributions to others.


They are utterly great at solving and analyzing problems. They all are excellent at what they. I actually don’t know what to suggest them, since I am learning from them. They do everything up to the expectation. I can’t say they should do more than perfection, but they are great, I mean it. I am very grateful to be a team with them.


 


◆ Ch. 4 Flipped/PBL Action Learning Class Feedback

by Students


(1)  What is the merit/importance/Significance of this PBL class?


The crucial part of the PBL class is to be active in both class and i-campus, therefore, not only it encourages our communication, but does it also improve our teamwork when worked as a group. The individuals’ post, feedback, and replies make a great deal of importance on class activity and learning. Furthermore, compared to traditional lectures where students would listen to lectures in class only concentrating on a professor’s explanation and PPT, in PBL, learn the lectures in-home or before the lectures as a self-study. As a result, we have time to discuss with professors about problems we had on the concepts instead of spending hours listening to professors’ explanation of the lectures and not making useful discussions in class; therefore, there not adequate time of direct conversation between students and professors. Ultimately, PBL encourages students’ teamwork, communication, problem-solving skills and self-studying.


(2)   What do you want to improve this PBL system?


I would like to increase the number of discussions in class with many students because PBL requires lots of time to study on their own views; therefore, the professor should sharpen the students’ thoughts and understanding. Nevertheless, I think Professor 이상구 is abundant in that aspect because there is much time for discussion in the beginning of the class and during the class, which the students need the most in my opinion.

...


5-1. 본 수업을 통해 자신이 습득한 자기 주도적 학습 기술을 구체적으로 설명하시오.

        What skills that you learned while you studied in the process of mathematics (PBL-Active Learning),?


우선 이 수업을 들으며, 혼자 열심히 자료를 찾아서 공부하는 습관이 생겼다. 누군가의 질문에 답변을 하려면, 수업시간에 배운 지식이나 자료로는 답변하기 힘든 경우가 많다. 이럴경우 혼자 검색을 해서 여러 방대한 자료중 추출해서 나에게 필요한 내용만 습득하고, 공부하는 습관이 생겼다. 그리고 flipped class 이기 때문에 수업 전 preview 즉 예습이 매우 중요하다. 나는 이 수업을 들으면서 위 두 과정을 성실히 수행해서, 자기주도 학습 능력이 많이 상승되었다.

      온라인 lab 홈페이지를 통한 주도적인 예 복습, 모르는 부분이 있을 시 동료들에게 질문을 하고 답변 할 수 있는 QnA공간 활용, 끝까지 이해가 가지 않을 경우 icampus 강의를 다시 들으면서 복습.

먼저 학습할 내용을 예습하면서 어느 부분이 약한지 체크할 수 있었다. 약한 부분을 위주로 수업을 듣고 나서, 더 모르겠으면 Q&A 게시판을 이용하여 질문하고 답변을 얻었다. 이미 아는 내용은 타 학생들이 올려준 질문에 답변을 달아주면서 개념을 더 확실히 하였다. 관련 문제를 풀어보며 내용 습득 여부를 다시 확인해 볼 수 있었다.

 항상 강의를 보면서 교수님이 말씀해주신 내용에만 집중했지, 능동적으로 내가 강의 내용을 요약하고 설명하는 일은 해보지 않았다. 그러나 이 이산수학 강의에서는 능동적으로 내가 참여해서 요약하고 남의 의견을 수정해주는 일을 하는 등 주도적으로 학습에 참여할 수 있었다.


12-1. 본 수업과정에서 자신이 참여한 활발한 의사소통을 구체적으로 설명하시오.


제가 qna에 참여했던 부분중 가장 discussion 이 활발 했던 qna하나를 저는 가장 중요한 contriution이라고 생각합니다. 그 부분은 다음과 같습니다.

우선 이 질문은 최세현 학생이 질문 한 내용으로 같은 문제로 여러번의 질의 응답을 했습니다. 이게 첫 질문이고 최세현 학생과 discussion 하면서 최세현 학생의 추가 질문도 있었습니다. 이에 저는 모든 질문과 답변을 공유하며 최종적으로 finalize했습니다.

     학우들이 필요할만한 지식을 공유하였다. 또한, 문제를 풀고 공유를 하였고, 다른 학우의 질문에 응답해 주는 등, 활발한 활동을 하고자 노력하였다. 그리고 팀에서 맡은 역할을 제대로 수행하였고, 온라인/오프라인 가리지 않고 팀과 소통하고자 노력하였다

QnA를 통해서 모르는 문제를 질문했고, 남이 모르는 것들을 답변했으며, 요약한 내용중에 잘못된 내용을 수정하면서 의사소통을 했다.온라인 QnA를 통해 질문과 답변을 하고 다른 동료들의 궁금증이나 미비점을 파악하고 깊이있는 심화 학습을 할 수 있었다.


14-1. Flipped/PBL 방식의 수업에서 효과적이었다고 생각되는 부분을 구체적으로 설명하시오.

         State some part that helps you by the learning process of  PBL/Active Learning /Flipped learning.


우선 우리가 아는 일반 강의에 대해서, 항상 교수님의 강의와 문제풀이 그리고 과제 시험같은 동일한 과정을 거치는 강의는 수동적인 강의이고, 보다 미리 예습을 통해 배울 내용을 공부하고 qna를 통해 공유하고 같이 성장해나가고, 수업시간에 다같이 이야기를 많이 하며 공부하는 것이 훨씬 더 능동적인 강의입니다. 본인의 의지에 비례해서 실력 향상이 많이 되는 것 같습니다. 학생의 능동적인 학습 능력을 향상시켜 주고 또 교우들과의 협업이 강조되기 때문에 PBL class의 중요성을 역설하기엔 충분한 것 같습니다.

        이 Flipped방식의 수업은 정말로 내가 공부를 해야 강의가 진행되는 느낌을 제대로 받는 수업방식이다. 강의를 시작하기 전에 공부를 하게 되고, 이는 정말 학습 효과가 대단하다고 생각한다. 또한 PBL은 작성하면서 내가 지금까지 해왔던 것들을 복습하게하는 효과가 있다고 생각한다.   우선 내가 모르는 내용을 알고 갔기 때문에, 어느 부분에 더 가중치를 둬서 수업을 들어야하는지 알 수 있었다. 또한, 서로간의 질의응답을 통해 더 나은 결과를 도출할 수 있었던 것 같다. 이러한 점이 이 수업에서 효과적인 부분이라고 생각한다. 뿐만 아니라 Q&A 게시판을 활용한 자발적 참여 유도 역시 훌륭한 방식이었다고 생각한다. 신선하고 즐거운 수업이었다. 학생들에게 적극적으로 수업을 이끌어나갈 수 있도록 질문 답변의 장을 마련했다는 것은 굉장히 획기적이라고 생각합니다. 오프라인으로 만나면 어색한 사이인 학우분들과 온라인 상으로 만나 서로 어색한 부분없이 자신이 가진 생각을 올리고 다른 학우분들과 공유하여 이 수업을 듣는 모든 학우분들에게 시너지 효과를 불러 일으킨다.


19. What is the merit of PBL system?


우선 여러 교우들과 질문과 답변을 공유하며 그 부분으로 부터 실력 향상이 가장 원하는 부분입니다. 이건 다른 학생들도 다 같을 것입니다. 여기에 저는 또다른 장점을 설명 드리고 싶습니다. 이 수업은 물론 컴퓨터 공학 소프트웨어에 가장 필요한 과목일 수 있지만 여러 타 과 학우분들도 많은 것으로 알고, 또한 타국 학생도 많은 것으로 알고 있습니다. 이 학우들과 여러 의견공유를 통해 친분을 맺고, 앞으로 학교생활하면서 모르는 부분을 서로의 major에서 잘 답변하고, 이산수학 수업이 끝나고 그 후에도 항상 서로 서로 도움이 되는 infra를 만들고 싶습니다.



20. 이 수업에서 보완해야 할 점은 무엇이라고 생각합니까?

       What can you suggest to improve this system of learning?


        지금 껏 받아온 강의시스템과는 크게 다른 획기적인 시스템이기 때문에 학생들이 이에 맞춰 적응하고 잘 수강 할 수 있도록 처음에는 예시를 많이 주는 것이 좋다고 생각합니다. 예를 들어 Example내 문제들을 모든 학생들에게 겹치지 않게 준 다음 QnA에 올리도록 하면, 모든 학생들은 자신이 푼 한 문제 뿐 만 아니라 다른 학생들이 풀은 문제들의 해결방법도 알게 됩니다. 그저 학생들이 문제를 풀어 올리길 기대하기 보다는 이런 식으로 가이드라인을 잡아주는 것이 시작부터 활발한 QnA를 이끌지 않을까 합니다.

또한 팀 방식은 정말 좋은 아이디어라고 생각하는데, 강의 시작 초기부터 팀과 팀원들을 할당하는 편이 더 좋을 것 같습니다. 팀 단위로 자유로운 QnA토론 분위기가 형성되어 빠른 적응을 할 수 있을 것 같습니다.

flipped class 이기 때문에 수업에서 얻어가는 양도 굉장하지만, 미리 준비가 되어있어야 어느정도 수업에 따라갈 수 있습니다. 그 것이 유일한 flipped class의 단점이라고 생각하지만, 본 수업은 수업 전 교수님과의 소통과 학습의 문이 자유롭게 열려있기 때문에 문제없이 진행할 수 있었습니다.

 수업에서 보완할 점으로는 강의 시간에는 QnA 내용을 직접 보면서 하나하나씩 교수님이 설명해주시거나 학생들이 올린 QnA자료에 교수님의 의견을 다시 한번 말씀해주시면 더 의욕을 받고 열심히 하지 않을까 생각해본다. 물론 지금도 QnA를 정말 많이 확인해주시고 final된 부분을 강의 시간에 설명해주시고 계시므로 딱히 보완할 점은 아니라고 본다. 또한, 조끼리 모여서 자신들이 올린 QnA내용을 서로 확인해보면 어떨까 생각해본다.


Open Feedback : Please leave any general comments and suggestions that will help improve this class in the future, including what you liked and did not like about this class. [FREE RESPONSE BOX]



Briefly describe your contributions through Q&A for yourself and fellow students in our "DM" classes!



Quantity : 137




I strive making as many comments on problem as I can make to clarify the solution so that not only I, but also the other students will find it much easier to understand. I usually finalize problems so that the clarification I made in them should make the solutions simpler to grasp. I enjoy asking interesting questions so that the students would find the class more engaging, since Mathematics is not all about solving problems.



Ultimately, I believe the beauty of Mathematics is that there is only one determined answer to a question.



-    Check your participation numbers in QnA for each week (Saturday to Friday):


 

 

Week   1:      0        Week   2:    2        Week   3:    7        Week 4: 9

Week   5:       7        Week   6:     39     Week   7:    10         Week   8: 10          

Week 9:      10       Week 10:   10     Week 11:   10       Week 12: 10

Week 13:    13       Week 14:            Week   15

(Total=137 Entries)                Q: 8     A: 129


Number of online attendances:        (    85     ) / (     85     )   (1-15week)

   Off-line attendance:             (      25    ) /  (     25    )     (1-15week)

   Absences:    0.

Online Lecture Participation (온라인 출석 회수):  (1-15th week)

Full attendance


Off-line Lecture Participation/ Absence (오프라인 출석  / 결석  회수) (1-15th week)

Full attendance (Excluding Week 1, midterm week, and public holidays in which I was not registered)






Part 2: Participation Part (New Form)

 

Fill in the below for your self-assessment and your project/term paper.  (20 points/100)

A. (Quantity 10pts) Briefly describe your contributions through Q&A for yourself and fellow students in our "DM" classes! 

...

 

(2) What you contributed through this course (Q & A and/or In-class):

이 수업을 들으며, 항상 다른 학우보다 더 많은 Qna 를 작성했고, 발표도 다른 학우 보다 더 많이 한 것 같다. 총 161개의 Qna 를 작성했다.


 (3) (5 pt) What is your most important contribution or founding that you shared with others in QnA.(Quality)

To my mind, my most important contribution that I shared with others was:

1)  우선 팀 프로젝트를 진행하며, 다른 팀원들의 활동을 앞장 서서 수정해 나갔고, 더 좋은 프로젝트 결과물을 만들어 내기 위해서 노력했습니다.

2)  만약 제가 Qna 답변을 달았지만 질문한 학우가 정확한 이해를 하지 못했다면, 최선을 다해서 계속 답변을 달아 주었습니다.


(4) Number of Final OK by SG Lee Problems (and/or Completed Discussion/Question) in Q&A that your name is included:   ( 101 )       

 B. (Quantity 10pts) Quality of Your Participation: 2

 

     (1) Write what you especially remember while you are doing A-1, 2, 3.

우선 저는 아무래도 첫번째 과제를 할 때가 가장 기억에 남습니다.  그 당시 어떻게 PBL report를 쓸지 , 교수님이 바라는 바가 무엇인지 정확히 알지 못하였고, 저도 많이 헤맸던 기억이 납니다. 지금은 이번 학기 열심히 수강해서 보다 정확한 PBL report를 작성할 수 있게 되었습니다. 감사합니다.


    (2) What did you learn or feel while learning DM (Action Learning/PBL) with your classmates?

우선 저희 이산수학 수업의 학생들 모두 Qna 에 열심히 참여했습니다. 그 과정을 통해 저도 많이 배우고, 많이 질문하고, 다른 학우들의 궁금점에 많이 답해 주었습니다. 참 보람찬 시간이었습니다.


    (4) Write names of YOUR PBL Team members and Team Leader.

Team Leader:  김찬호

Team Members:  최세현, 박재형, 담딘바자르


(B4) (Tentative) Project (Title/ 1stDraft/Final)

 What is your project (and In-depth study) and your role in your Team (Leader, Idea, Solve, Prove, Coding, Typing, Presentation etc.) 저는 Team Leader이고, 저희 Team은 derangement에 대한 주제를 받았습니다.

Role:  저는 Presentation과 Idea, Prove를 맡고 있습니다.

2장. 참여 부분 (New Form)   - 중간고사 20점 부분

       자기 평가와 본인의 Project (Term paper) Proposal 에 대해 아래를 채우시오.

  

1.  (20점) 본인이 그간 Q&A,  동료학생, “DM"강좌 등에 기여한 내용을 간단히 서술하세요!


  (1)  QnA 참여 회수 <QnA에서 직접 확인하세요> : 각 주별 (토요일에서 금요일) 

1주차 : 총  2  회,  2주차: 총  4  회,  3주차: 총  4  회,  4주차: 총  9  회

5주차 : 총  2  회,  6주차: 총  7  회,  7주차: 총  13 회,  8주차: 총  9  회

9주차 : 총  10 회,  10주차: 총  14  회,  11주차: 총  13  회,  12주차: 총  9  회

13주차 : 총  2  회,  14주차: 총   0  회,  15주차: 총   5  회.

                            총   103   회  (질문:  10   회,  답변/수정:  60  회) 

온라인 출석 회수 :   85  회  /  85  회  

오프라인 출석 및 결석 회수 : 26 회  /  0  회 


                            총    83 회  (질문:    5  회,  답변/수정:  78 회) 


온라인 출석 회수 :   82 회   

오프라인 출석 및 결석 회수 :   26 회  /   0 회  

 

(2) 본인이 본 강좌를 통하여 기여한 내용

      1. Q&A에 올린 좋은 본 강좌 및 관련 또는 기타 유의미한 정보 개수 ( 14 개)

      2. 본인이 토론을 정리하여 마무리한 (누군가 제목에 Final 표시한) QnA 내용에 자신의 이름이 포함 된 것 (   55  개)


   1, 2 중에서  특히 기억나는 내용 : 학기 초반에 한 학우분이 소수인지 아닌지 판별할 때 왜 소수로만 나눠주냐고 물었다. 그래서 한글로 답변을 해주었는데 이해가 잘 된다고 고맙다는 답글을 달아주셨다. 하지만, 외국인 학생은 그 문제에 대해 답을 이해할 수 없다는 의견을 제시해주었다. 그래서 영어로 번역해서 답글을 달아주었고, 다른 학우 역시 내용을 추가해서 번역하여 답글을 달아주어 그 외국인 학생 역시 이해가 되었다고 고맙다고 댓글을 달아주었다. 이 문제를 통해 Q&A 게시판이 정말 활발하게 돌아간다는 것을 느꼈고, 신선한 경험이여서 특히 기억에 남는 것 같다. 다른 학생들의 요약들을 하나로 정리하여 요약문을 만들었는데, 다른 학생이 그 요약문을 다듬고 고쳐 훨씬 좋게 만들어 완성했다, 완성된 요약이 전체적으로 훨씬 발전되자 같이 협력하여 멋진 작품을 만드는 경험을 한 것 같아 기뻤다. 또한 다른 학생의 문제 풀이 솔루션을 직접 마무리하기도 해보았는데, 다른 학생들과 협력하여 솔루션을 발전시키고 다듬는 과정에서 자연스럽게 공부를 할 수 있어서 좋았다.


<1번>

1) 1번에서 HLT (Horizontal Line Test)의 글을 PIRAN CACI 학우가 다른 학우분들과 공유하기 위해 올렸었는데. 저는 HLT와 비슷한 원리를 이용한 VLT를 알고 있어서 다른 학우분들과 공유를 하기위해서 답변에 추가 하였습니다.


2) 1번에서 4단원 Algorithm 단원에서 배운 Bubble Sort의 개념과 Time-Complexity에 관한 글을 어떤 학우분이 올리셔서 제가 알고 있는 지식과 수업을 진행하며 배운 내용을 댓글로 작성하였고 그 글이 토론의 장이 되어 제가 알고 있는 것 보다 더욱더 많은 단원을 배울 수 있게 되었습니다.


3) 1번에서 4단원 Algorithm 단원에서 배운 Time-Complexity과 Recursive 함수와의 연동성을 묻는 학우분께 Recursive함수의 장단점에 대해서 올 적이 있었습니다. 소프트웨어를 전공하면서 재귀함수를 다루는 것은 능숙하다고 생각했지만, 학우분께 답변을 해드리기 위해 재귀함수에 대한 정보를 찾던중, 제가 몰랐던 정보들도 많이 알 수 있었습니다.


4) 1번에서 4단원 Algorithm 단원에서 배운 Sorting 단원에서 Bubble Sort에 관한 글을 올린 학우 분이 계시길래, Bubble Sort와 Quick Sort를 비교하는 댓글을 단 적 있습니다.

Bubble Sort는 정확하지만 빠르지 않는 것에 비해 Quick Sort의 Time-complexity는 Bubble Sort보다 작지만 안정화 되지 않은 Sorting 방법인지 그 때 알게 되었습니다.


5) 저희 Team 2중 학우 한분이 Recursive Function에 대한 C코드를 올렸는데, 그중 일부분이 C코드가 아닌 부분이 있는 것 같아 알려드렸습니다


6) 저희 Team 2의 연구 과제중 Recursive Algorithm 단원에 있는 Hanoi Tower에 대한 C코드를 올려 참고하여 공부가 되도록 하였습니다


7) Recursive Function 단원에서 수업 자료에 나와있는 하노이 타워외에 Binary Search 을 Recursive Algorithm 을 이용한 C코드를 올려 참고하여 공부가 되도록 하였습니다


8) Chapter 8 수업 자료에 나와있는 하이퍼 큐브에 관한 내용을 찾아보고 정리하여 Team 2 학우분들과 정보 공유를 했습니다.


<2번>

1) 제가 4단원에서 배운 Euclidean Algorithm 에 대하여 한진수 학우분이 올린글에제가 아는 정보를 추가하여 댓글을 단적이 있습니다. 제가 댓글을 달고나서 다른 학우분들이 댓글을 달아주셔서, 모든 댓글을 총합하여 제가 Finailze를 해서 글을 올렸습니다. 다른 분들의 정보를 모두 통합하여 Finalize 하는 과정을 하면서 제가 모르는 내용을 저의 지식으로 만들 수 있었습니다.


2) 소프트웨어를 전공하고 있는 저로서는 Algorithm에 대하여 깊게 다뤄보는 4단원에 대해 흥미가 많았습니다. 따라서 저는 4단원을 제가 다른분들 요약한 것을 모두 합하여 Finalize 해보고 싶었습니다. 따라서 제가 다른분의 4단원 요약본을 참고하여 Finalize 하였습니다. Finalize 하는 도중에 놓친 내용은 다른 학우분이 Refinalize 해주셔서 제가 무엇을 놓쳤는지 알 수 있었습니다.


3) 이승원 학우님과 김두원 학우님이 5.2 단원에 대해서 요약하는 글을 작성하셔서 제가 시스템 프로그래밍을 배우면서 알게 된 지식을 추가하여 Finalize 했던 경험이 생각납니다. Finalize 하면서 제가 여태 배웠던 내용을 다시 되집어 볼수 있었습니다.


4) 현재 Chapter 9를 향하고 있는 시점에서 양세중 학우님이 Chapter 1의 Exercise 문제를 Solved 해서 올리셨길래 다른 학우분들로 하여금 복습하는 차원에서 Comments를 달아 정리 하였습니다.


5) 김도훈 학우님 께서 Chapter 8 p 396 Question 21번 Graph 문제를 Solved해서 올리셨길래 Path, Simple path, Cycle, Simple Cycle 에 관한 Definition을 정리해서 Team 2 학우분들과 공유했습니다.


6) 주박우 학우님 께서 Chapter 8.2 p 398 Question 75번 문제를 Solved해서 올리셨길래, 주박우 학우님의 풀이 말고 수학적 귀납법으로도 접근할 수 있다는 점을 다른 학우분들과 공유하였습니다.


7) Team 2 학우들이 Chapter 5에 Division에 관한 문제를 Solved해서 올려주셨습니다. 문제를 푼 방법은 정확해서 문제 해결 방식에는 추가할 것이 없었지만, Division에 관한 내용을 정리하여 다른 학우들이 내용 정리에 도움이 될 수 있게 Comments를 달고 Summary를 하였습니다.


8) Team 2 학우들이 Sorting Algorithm중 몇 개의 중요한 Sorting방법을 알고리즘 설명과 C언어 코드를 같이 정리하여 올렸습니다. 저는 각자 따로 정리한 것을 한눈에 보기 편하기 위해 제가 작년에 자료구조 개론 수업을 들으면서 정리해 놓은 내용을 저희 팀 멤버분들이 정리해 놓은 것에다 추가를 하고 중요한 Sorting Alorithm을 한번에 모아 정리하여 Finalized 해서 QNA에 올려 다른 학우들과 공유 했습니다.


9) Team 2 학우들이 GCD & LCD 에 관한 문제를 Solved 해서 올렸습니다. 문제에 나와있는 숫자 들과 문제 풀이 방식은 정말 간단하고 정확하게 풀어주셔서 더 이상 풀이에는 손댈 것이 없지만, 다른 문제가 출제되었을 때, 또는 GCD 와 LCD의 관계가 나타나져 있는 식을 다시 상기 시켜드리기 위해서 문제 풀이와 저의 Comments를 추가하여 Finalized 과정을 거쳐 학우분들고 공유 하였습니다.


10) Team 2의 김은민 조장님 께서 Binary 숫자를 Decimal로 Decimal 숫자를 Binary숫자로 변환시키는 문제를 Solved해서 올려주셨습니다. Binary 숫자를 Decimal로 바꾸는 방법은 2가지가 있어서 김은민 조장님께서 사용하신 방법 이외의 방법을 저의 Comments로 추가하여 Finalized 하였습니다. 또한 Deciaml 숫자를 Binary 숫자로 바꾸는 것은 MSD LSD와 연관성이 있어 이러한 연관성과 계산하는 방법을 서술하여 Finalized 했습니다.


11) 위의 문제와 비슷하게 이번에는 Team 2 멤버중 한명이 16진법을 10진법으로 바꾸는 방법과 10진법을 16진법으로 바꾸는 문제를 Solved해서 올려주셨습니다. 저는 저의 Comments에 추가 설명과 그림을 추가하여 학우들에게 한눈에 쉽게 이해할 수 있게 Finalized를 하여 올렸습니다.


12) Prim Algorithm 과 MST의 관계에 대한 질문을 학우분께서 올려주셨고, 다른 학우분이 연관성에 관해 올려주셨습니다. 저는 그 답변에 추가로 Prim Algorithm 에 대한 설명과 MST의 정의에 입각하여 왜 MST 는 Prim Algorithm으로 구현이 가능한지 정의와C코드를 통해 Finalized 했습니다.


 (3) 동료와 같이 본 강좌를 (Action learning) 학습 하면서 배우거나 느낀 점은?

        수학적 정보를 공유하는 방향으로는 많이 참여하고 있지만 아직 토론에 참여하여 저의 의견을 올리는 것에는 아직 미흡하다고 다른 동료에 비해 미흡하다고 생각합니다. 하지만 제가 이해하지 못하는 부분이나 어려운 부분들을 다른 동료분들이 자신의 지식을 많이 공유를 해주셔서 많은 도움이 되었다고 생각하고 저도 앞으로 다른 동료분께 도움이 될수 있게 조금더 열심히 하려고 합니다!


  QnA에 꾸준히 참여하는 것이 지속적으로 압박되고 걱정이 많았는데 동료들과 문제에 대해서 토론하고 요약문을 올리며 공부를 서로 도와가면서 할 수 있게 되어 좋았다. 앞으로 이러한 Action learning 강좌에 대해서 긍정적이게 된 것 같다. 다들 열정적으로 수업에 임하는 모습을 보고 많은 것을 생각할 수 있었다. 예습과 복습이 중요하다는 사실을 다시 한 번 깨달을 수 있었고, 집단지성의 위대함을 느낄 수 있었다. 내가 생각하지 못하고, 내가 배우지 못한 부분을 다른 학우들이 채워주고, 또, 그들이 부족한 부분을 내가 채워줌으로서 전반적인 실력향상을 기대할 수 있었다. 남은 강좌도 열심히 해서 더 알찬 수업을 만들어나가면 좋겠다!


2.  Talk about your Team Final Project 1 (& Project2)


 우선 프로젝트 1은 chapter 5에 대해서 정리하고, 관련 문제를 푸는 것으로 이루어져 있다. 앞에서는 개념을 정리하고, 뒤에서는 5단원에서의 몇몇 문제를 풀어보았다. 여기서 여러 기법을 사용하며 문제를 풀기도 하였다.


 프로젝트 2는 최대공배수를 찾는데, 코드로 구현해보고자 했다. 이 때, 재귀를 쓸 때와 안 쓸 때의 차이를 알아보고자 했다. 파이썬을 사용하여 코드를 짜보았다. 두 개의 결과 값을 비교해보았고, time complexity도 비교해보았다. 결론적으로는 재귀적으로 짠 코드의 time complexity가 더 좋았다.


Ch 3.   Your PBL Participation (참여 부분) 


Part 1:   수업 내용 관련하여 답변을 얻은 일반 유의미한 질문들 [Part 1: Your meaningful questions in QnA which you had you got the Final answer.]


1. Question about prove.


Chapter 3. Summary

Original Post or Solved by: Thygeson(2019.3.25.)

Revised by: 담딘바자르(2019.03.25.)

Final by: 김찬호(2019.09.26.)  Final Ok by SGLee


Reference : Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition

 

 

           http://matrix.skku.ac.kr/2018-DM/DM-Ch-3-Lab.html

 Sequences are ordered lists and can be described by a function like C(n) = 5(n-2). Sequences can either be infinite or finite, defined by the function's individual domain. Two important types of sequences are increasing and non-increasing. We can also use the terms decreasing and non-decreasing. Note that a function can be both decreasing and non-increasing, or both increasing and non-decreasing. For instance, the sequence:

{34, 23, 23, 15, 15, 4} is not decreasing, but rather non-increasing.

(23과 15가 같은 수가 연속으로 나와서 decreasing이라고 정의 할 수 없습니다.)

 

A subsequence is a sequence that can be created from another sequence by deleting some elements, but without changing the order. For example, {12, 14, 40, 67} and {12, 80} are subsequences of {10, 12, 14, 40, 67, 80}.

(subsequence란 순서를 바꾸지 않은채 원소를 삭져하면서 만들어지는 부분집합의 개념입니다.)

 

We also learnt the big sigma and big pi denotion of representing the sum or the product of a sequence, respectively.

sigma와 pi의 연산과정을 조금더 이해하기 쉽게 수업 자료를 보면,

 

sigma 연산을 하게되면 sequence 한 an에 대하여 일련의 덧셈연산을 진행하게 되고, pi 연산을 하게되면 일련의 곱 연산을 진행하게 됩니다.

 A string is an finite sequence of characters. A string can be created by using values from a finite set of characters. For instance we can define the set X = {a, b, d, t, i, g} => we can obtain the string "digit". A substring is a sequence of consecutive characters in a string. A substring of "digit" is "it".

(string이란 어떤 문자의 유한한 연속입니다)

 

If a = "aabbbcd", |a| = 7 denotes the length of a. a[2] = "b", as we use zero-indexing. If we in addition have b = "ffg", ab denotes the concatenation of a and b, ab = "aabbbcdffg"

The string with no elements is the null string. is null string.

 

 


Relations

Relations are relationships between 2 or more sets and their objects that related to each set.

If X = Y, we call R a (binary) relation on X. : A function from X ×X to X is a binary operator on X . A (binary) relation R from a set X to a set Y ⇒ xRy.

 

Moreover, A digraph is represented by two letters. The informative ways to picture a relation on a set is to draw its digraph -- Directed Graph. The number of vertices in the graph is equal to the number of elements in the set from which the relation has been defined. For each ordered pair (x, y) in the relation R, there will be a directed edge from the vertex ‘x’ to vertex ‘y’. If there is an ordered pair (x, x), there will be self- loop on vertex ‘x’.

relation 부분에서 중요하다고 생각되는 부분인

symmetric과 antisymmetric의 설명이 필요합니다. 이 부분 설명을 위해 제가 qna에 올린 이부분에 대한 설명을 인용하겠습니다.(asked by 최세현,reply by 김찬호)

 

symmetric이란 X의 원소 (x,y)에 대해서 (x,y)가 R에 포함될때 (y,x)역시 R에 포함 될때 정의되고,

 

antisymmetric이란 X의 원소 (x,y)에 대해서 (x,y)가 R에 포함되고, (y,x)역시 R에 포함될때 x와 y가 같으면 antisymmetric이라고 정의합니다.

 

Comment by 김찬호:


Speaking of the concepts, they are becoming more and more related to Computer Science studies, as they are fundamental studies of CS. The relations are directly connected my other class, so I am keen to learn more of it.



****

4.1 Algorithms

​Principles of Algorithms:

Input : An algorithm has input values from a set.

Output : From each set of input an algorithm produces output from a set. The output values are the solution to the problem.

Definiteness : The steps of an algorithm must be defined precisely.

Effectiveness : It must be possible to perform each step of an algorithm exactly and in a finite amount of time.

Finiteness : An algorithm should produce the desired output after a finite number of steps for any input in the set.

Correctness : An algorithm should produce the correct output values for each set of input values.

Generality : The procedure should be applicable for all problems of the desired form, not just for a particular set of input values.

 

​Pseudocode: Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a normal programming language, but is intended for human reading rather than machine reading.​

 

 

​4.2 Examples of Algorithms


Linear Search:

A linear search or sequential search is a method for finding an element within a list. It sequentially checks each element of the list until a match is found or the whole list has been searched.​


Binary Search:

 Binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array.​


binary search algorithm에 대해 설명을 하겠습니다

 

처음에 어떤 배열이 주어졌을때 i=0, j=len(배열의길이)로 설정하겠습니다.

 

우리가 원하는것은 x라는 원소가 배열 몇번째에 위치해있는지 아는 것 입니다.

 

처음에 mid라는 변수 하나를 설정합니다. mid는 (i+j)/2입니다.

 

우리가 원하는 x라는 원소가 mid 보다 아래쪽에 있는지 위 쪽에 있는지 확인합니다.

 

만약에 밑에 있으면 j=mid로 설정하고 다시 mid값을 (i+j)/2로 합니다

        위에 있으면 i=mid+1로 설정하고 mid값을 (i+j)/2​ 로 설정합니다

 

 

이런식으로 계속 범위를 반씩 줄여 나가며 원하는 값의 위치를 찾는 알고리즘 입니다.

( quoted from

https://medium.com/@jsh901220/toy-problem-%ED%92%80%EA%B8%B0-binarysearch-f50ffb19573f)​


(quoted from my qna)​​

Searching algoritm's one is binary search.


THE BINARY SEARCH We will now consider another searching algorithm.

This algorithm can be used when the list has terms occurring in order of increasing size

(for instance: if the terms are numbers, they are listed from smallest to largest; if they are words, they are listed in lexicographic, or alphabetic, order).

This second searching algorithm is called the binary search algorithm.


And one of algoritm's is sorting algoritm.

 

Sorting:

A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most frequently used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the efficiency of other algorithms which require input data to be in sorted lists.

Sorting is putting these elements into a list in which the elements are in increasing order. For instance, sorting the list 7, 2, 1, 4, 5, 9 produces the list 1, 2, 4, 5, 7, 9. Sorting the list d, h, c, a, f (using alphabetical order) produces the list a, c, d, f, h. An amazingly large percentage of computing resources is devoted to sorting one thing or another. Hence, much effort has been devoted to the development of sorting algorithms.

 

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent pairs and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.

 

Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.



Sorting


 Sorting is putting these elements into a list in which the elements are in increasing order.

 

Sorting is putting these elements into a list in which the elements are in increasing order. For instance,

sorting the list 7, 2, 1, 4, 5, 9 produces the list 1, 2, 4, 5, 7, 9. Sorting the list d, h, c, a, f (using alphabetical order)

produces the list a, c, d, f, h. An amazingly large percentage of computing resources is devoted to sorting one thing or another.

Hence, much effort has been devoted to the development of sorting algorithms.

 

The Bubble sort is one of the simplest sorting algorithms, but not one of the most efficient.


 Time and Space Complexity for Algorithms

While analyzing an algorithm, we mostly consider time complexity and space complexity. Time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the input.​

 


Finiteness

 An operating system never terminates

 

Determinism

 Algorithms for multiprocessor machine or distributed environment are rarely deterministic

 

Generality or Correctness

 Many practical problem are too difficult to be solved efficiently


​4.3 Analysis of Algorithms Problem


​Useless program for certain type of input even though derived from a correct algorithm

  the time needed to run the program is too big or

  the space needed to hold the data is too big.


For Example,

 a set of  elements some elements are labeled 'red', some labeled 'black'.

Find the number of subsets of  that contain at least one red item.

Since a set that has  elements has  subsets, the program would require at least  units of time to execute.

What if  is very big?


Summary of 최세현:

 

4.3에서 알고리즘을 측정하는 방법에 대해 배웠습니다.

n개의 데이터를 연산할때, 시간복잡도를 f(n), g(n)으로 표현하는 것을 알게되었고,

가장 최악의 상황, 최선의 상황, 평균적인 상황일때의 시간복잡도를 서로 다른 기호로 표기하는 방법을 배웠습니다.

보통, 알고리즘의 시간복잡도를 판단할 때 빅-오 표기법을 이용해 최악의 상황에서의 시간복잡도를 측정하고, 비교합니다.

 

Summary of 담딘바자르:

As Algorithms is one of the fundamental concepts of Computer Science, we, Software Engineer students or related fields students are fairly familiar with the concept. Algorithms we use in Discrete Mathematics is used the same way; however, it's usually used like Pseudocode. Sorting is the crucial part of algorithms due to its space and time complexity. As for as I know, quick sorting is the most efficient sorting in most cases, in case someone wonders. On the other hand, bubble sort is the worst in case of time complexity. I haven't taken the Algorithm course, but Algorithm concepts in Discrete Mathematics make me itching for its applications in both CS and DM.​​

Furthermore, it's recommend to review Big O notation, Omega notation, and Theta notation for thorough understanding of time complexity of Algorithms.

 

Summary of 김찬호:​

4.1, 4.2를 배우며 직접적으로 나의 전공인 컴퓨터 공학의 프로그래밍에 직접적인 연관이 있는 알고리즘에 대해 배우게 되었다. 우선 기본적인 linear search, binary search에 대해 복습 하게 되었고, 기본적인 sorting알고리즘에 대해 다시 한번 공부하게 되었다. 이부분에서 매우 흥미를 느끼고, 프로그래밍에 흥미가 많은 나로서는 이 단원에 대해 공부하는게 재밌었다.

binary search : 간단히 소개하자면 배열의 첫번째 index 와 마지막 index의 중간값을 검사를 진행하며 바꿔나가며 검사해야할 배열을 줄여나가 결국 target을 찾게되는 search방법이다.

bubble sort: 배열의 첫번째 값부터 마지막값까지 하나씩 계속 비교를 하면서 가장 큰 값을 혹은 가장 작은 값을 마지막 인덱스에 넣는다. 다시 검사를 진행하면서 결과적으로 모든 배열이 오름차순 혹은 내림차순으로 정렬이 된다.

 

또 프로그래밍의 중요한 부분인 time complexity를 구하는 방법을 배우게 되었고, 그 중에는 빅오 표기법, 오메가, 세타표기법이 있지만 흔히 우리는 일반적으로 worst case를 기준으로 time complexity를 적기 때문에 빅오 표기법을 가장 많이 사용하게 된다.



Chapter 3. Composition of relations

Original Post or Solved by: 최세현(2019.03.27)

Revised by: 감동윤(2019.03.27)

Revised by: 박재형(2019.03.27)

Final by: 김찬호(2019.03.27)

Final Ok by SGLee


Reference : Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition

 

           http://matrix.skku.ac.kr/2018-DM/DM-Ch-3-Lab.html


Problem Solution Part

(Choose problem in each chapter)


Chapter 1. Set & Logics

(page 218. number4)

Solved by 김찬호(2019.4.12)


Ex 37,40)

Let P(x.y) be the propositional function x≥=y. The domain of discourse is Z​+xZ​+​.Tell whether each proposition in Exercises is true of false.

 

37.∀x∀y p(x,y)​

the statement is false. because when x = 2 y =3 , x<y, this proposition is not true.

there is such x,y in the domain that make proposition false. so∀x∀yp(x,y)​​​​ is false.

 

40.∃x∃y P(x,y)

The statement is true. because it is possible to find at least one real number x,y for which the proposition is true. when x=2,y=1. the P(x,y)is true so the statement is true.

 

42-59

Determine the truth value of each statement in Exercises 42-59.

the domain of discourse is RxR. Justify your answers.


42.∀x∀y (x​2​<y+1​)

This statement is false because if x=1 and y=2 , the conditional proposition∀x∀y x​2​<y+1​is false. The pair x=1 and y=2 is counterexample

 

45.∃x∃y(x​2​<y+1)

It is true statement.because it is possible to find at least one real number x,y for which the proposition is true. When x=1 y=1 x​2​<y+1 is true. there is such x,y that make proposition true. so the statement is true.

 

48.∀x∀y(x​2​+y​2​=9)

it is false statement.because if x=1 and y=1 , the conditional proposition∀x∀y(x​2​+y​2​=9)​​is false. The pair x=1 and y=1 is counterexample​.

 

51.∃x∃y x​2​+y​2​=9

It is true statement.

when x=1,y=2*2​(1/2)​ the statement is true.

there is such x,y that make true the statement.

 

54.∃x∀y (x​2​+y​2​≥=0​)

x is in domain R so x​2​≥=0

y is in domain R so y​2​≥=0

​sox​2​+y​2​≥=0 is true.

 

57.∀x∃y((x<y) ->(x​2​<y​2​))

for every positive real number x, there is x that take y=x.

but the x<y is false.

so the proposition is always true.

Chapter 2. proof

(page 83. Number7)

Solved by 감광적(2019.4.13)

Finalized by 김찬호(2019.4.13)


(Reference:Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition)

page 83. example.

 

 

Chapter 2.1 Mathematical Systems, Direct Proofs, and Counterexamples

 

7)

Prove that for all integers m and n, if m and n are even, then m+n is even.


Solution)

Since m is even, there exists an integer K such that

m=2K.

Also, there is also an integer K1 such that

n=2K1.

So the sum is of m+n is 2K+2K1=2(K+K1)=2K3

because K3 is absolutely another integer.

And the fact is that 2 times an arbitrary integer, the product will always be even.


Therefore, m+n is also even.

-----------------------------------------------------------


final comment add by 김찬호)


//우선 m,n 이 짝수인 정수라고 했으므로 m=2k, n=2l 을 각각 만족하는 정수 k,l이 존재합니다.


// m+n = 2(k+l)이므로 m+n역시 짝수입니다.

 

Chapter 2. proof

(page 83. Number13)

Solved by 감광적(2019.4.13)

Finalized by 김찬호(2019.4.13)

 

(Reference:Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition)

page 83. example.

 

 

Chapter 2.1 Mathematical Systems, Direct Proofs, and Counterexamples

 

13)

13.Prove that for all rational numbers x and y, xy is rational.


Solution)

 

Let’s assume 4 non-zero integers which are a,b,c,d and we can derive that x=a/b, y=c/d.

 

So the product of xy is (a/b)(c/d)=ac/bd where ac is an integer and bd is a non-zero number.


Therefore, by the definition of rational number, xy is a rational number.

---------------------------------------------------------



final comment add by 김찬호)


x,y가 각각 유리수라고 문제에서 주어졌으므로 x=a/b, y=c/d (b,d≠0)을 만족하는 각각 정수 a,b,c,d 가 존재합니다.

xy=ac/bd이고 b와d모두 0이 아니므로 bd는 0이 아닙니다.

따라서 xy도 유리수입니다.

Chapter 2. proof

(page 83. Number27)

Solved by 감광적(2019.4.13)

Finalized by 김찬호(2019.4.13)

(Reference:Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition)

page 83. example.

 

Chapter 2.1 Mathematical Systems, Direct Proofs, and Counterexamples


​27)

Prove thatP(X∩Y)=P(X)∩P(Y)for all sets X and Y.


Solution)

Let’s assume A∈P(X∩Y),

→Ais in X∩Y

→A is in X and A is in Y

→A∈P(X)and A∈P(Y)

→A∈P(X)∩P(Y)

→P(X∩Y) is in P(X)∩P(Y)

And then we suppose that B∈P(X)∩P(Y),then

→B∈P(X)and B∈P(Y)

→B is in X and B is in Y

→B is in (X∩Y)

→B∈P(X∩Y)

→P(X)∩P(Y) is in P(X∩Y)


Therefore,P(X∩Y)=P(X)∩P(Y)     

-------------------------------------------------------

final comment add by 김찬호)


​A∈P(X∩Y) 인 A가 있다고 가정합니다.

A는 X와 Y 모두에 포함되어야 합니다.

따라서 A는 P(X) , P(Y)에 모두 속한다고 할 수 있습니다.

그렇게 되면 P(X∩Y)​가​P(X)∩P(Y)에 속한다고 최종적으로 말할 수 있습니다.

 

B∈P(X)∩P(Y)​인 B가 있다고 가정합니다.

B는 P(X), P(Y)에 모두 속합니다.

따라서 B는P(X∩Y)​에 속한다고 할 수 있습니다

최종적으로 P(X)∩P(Y)​가P(X∩Y)​에 속한다고 말할 수 있습니다.​

두가지 결론을 통해P(X∩Y)=P(X)∩P(Y)​라고 말할 수 있습니다.

 

Chapter 2. proof

(page 218. number4)

Solved by 김찬호(2019.4.12)

Finalized by 최세현(2019.4.12)

(Reference:Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition)

page 83. example.

 

Ch.2, Page 110, Exercise 1


using induction, verify that each equation is true for positive integer n.

1+3+5+....+(2n-1)=n2

 

Basic step)

if k=1.

1=12

 

inductive step)

suppose this equation satisfy when k.

 

Let's check if the equation is true when we take k as k+1.

2(k+1) - 1 = 2k+1

So, we add 2k+1 to both side


So, we could know that the equation is true for k+1.

 

Thus, this is true for all k.

****

comment by 최세현 :

I add more detail to 김찬호's solution,

While solving this exercise, I could clearly know how to use the mathematical induction

and make basic step, inductive steps to solve problems.

Chapter 2. Proof

(page 83)

Solved by 감광적(2019.4.13)

Finalized by 김찬호(2019.4.13)


(Reference:Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition)

page 83. example.

 

 

Chapter 2.1 Mathematical Systems, Direct Proofs, and Counterexamples

 

7)

Prove that for all integers m and n, if m and n are even, then m+n is even.


Solution)

Since m is even, there exists an integer K such that m=2K.

Also, there is also an integer K1 such that n=2K1.

So the sum is of m+n is 2K+2K1=2(K+K1)=2K3 because K3 is absolutely another integer.

And the fact is that 2 times an arbitrary integer, the product will always be even.

Therefore, m+n is also even.

-----------------------------------------------------------

add by 김찬호)


우선 m,n 이 짝수인 정수라고 했으므로 m=2k, n=2l 을 각각 만족하는 정수 k,l이 존재합니다.

m+n = 2(k+l)이므로 m+n역시 짝수입니다.

---------------------------------------------------------

13)

13.Prove that for all rational numbers x and y, xy is rational.


Solution)

Let’s assume 4 non-zero integers which are a,b,c,d and we can derive that x=a/b, y=c/d.

So the product of xy is (a/b)(c/d)=ac/bd where ac is an integer and bd is a non-zero number.

Therefore, by the definition of rationalnumber, xy is a rational number.

--------------------------------------------------

add by 김찬호)


x,y가 각각 유리수라고 문제에서 주어졌으므로 x=a/b, y=c/d (b,d≠0)을 만족하는 각각 정수 a,b,c,d 가 존재합니다.

xy=ac/bd이고 b와d모두 0이 아니므로 bd는 0이 아닙니다.

따라서 xy도 유리수입니다.

-----------------------------------------------------

27)

Prove thatP(X∩Y)=P(X)∩P(Y)for all sets X and Y.


Solution)

Let’s assume A∈P(XY), so we can say,

→Ais in X∩Y

→A is in X and A is in Y

→A∈P(X)and A∈P(Y)

→A∈P(X)∩P(Y)

→P(X∩Y) is in P(X)∩P(Y)

And then we suppose that B∈P(X)∩P(Y),then

→B∈P(X)and B∈P(Y)

→B is in X and B is in Y

→B is in (X∩Y)

→B∈P(X∩Y)

→P(X)∩P(Y) is in P(X∩Y)

Therefore,P(X∩Y)=P(X)∩P(Y)         

-------------------------------------------------------

add by 김찬호)


A∈P(X∩Y) 인 A 있다고 가정합니다.

A는 X와 Y 모두에 포함되어야 합니다.

따라서 A는 P(X) , P(Y)모두 속한다고 할 있습니다.

그렇게 되면 P(X∩Y)P(X)∩P(Y)에 속한다고 최종적으로 말할 수 있습니다.

 

B∈P(X)∩P(Y)인 B 있다고 가정합니다.

B는 P(X), P(Y)에 모두 속합니다.

따라서 B는P(X∩Y)속한다고 수 있습니다

최종적으로 P(X)∩P(Y)가P(X∩Y)에 속한다고 말할 수 있습니다.

두가지 결론을 통해P(X∩Y)=P(X)∩P(Y)라고 말할 수 있습니다.

Chapter 4. Algorithm

(page 218. number4)

Solved by 김찬호(2019.4.12)


trace algorithm for input 34 20 144 55

 

Input s,n

output s(sorted)

 

insertion_sort(s,n){

for i=2 to n{

​val=s​i​//save s​i​ so it can be inserted into correct place

 j=i-1

 //if val<s​j​,move s​j​ right to make room for s​i

 while(j≥1^val<s​j​)

  s​j+1​=s​j

  j=j-1

 }

s​j+1​=val//insert val

}

}

Solution)

First 20 is inserted in

34

Since 20 < 34, 34 must move one position to the right

 x 34

Now 20 is inserted

20 34

Since 144 > 34, it is immediately inserted to 34’s right

20 34 144

Since 55 < 144, 144 must move one position to the right

20 34 x 144

Since 55 > 34, 55 is now inserted

20 34 55 144

The sequence is now sorted.

Chapter 5. proof

(page 294. Number15)

Solved by 감광적(2019.4.13)

Finalized by 김찬호(2019.4.13)


Reference: 1.Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition

 

Chapter 5.3 The Euclidean Algorithm

Page 294 Exercises


15.If a and b are positive integers, show that gcd(a,b)=gcd(a,a+b).


Solution)

Suppose that d=gcd(a,b) and e=gcd(a,a+b)

Because d|a, d|b, and d|a+b, d is a common divisor of a and a+b.


// because suppose d=gcd(a,b) then a+b=d(p+q) so a+b can divided by d.

so d can also divide a, a+b

Therefore, d<=e. 


// I can't understand this statement.


Since e|a, e|a+b, and e|(a+b)

//there exist e that satisfy e=gcd(a,a+b) then ei=a,ej=a+b

and e can also divide a, b.

 

so we can conclude that d=e.

Chapter 5. Number Theory

(page 294. Number16)

Solved by 감광적(2019.4.13)

Finalized by 김찬호(2019.4.13.)


Reference: 1.Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition

 

Chapter 5.3 The Euclidean Algorithm

Page 294 Exercises


16.Show that if a>b>=0,thengcd(a,b)=gcd(a-b,b).


Solution)


First

Let’s assume that d=gcd(a,b) and d’=gcd(a-b,a)

And as we know, d|a, d|b, and d|a-b, so d is a common divisior of "a"and "a-b".

So, we can say, d <= d’.


// def Set D ={d| d=gcd(a,b)}

// def Set D'={d| d=gcd(a-b,a)}

//we can say DD'


Second

Using the same method, we have that d’|a ,d’|a-b, and d’|b [d’|a-(a-b)]

So, d’ is a common divisor of "a" and "b".

Therefore, d’<=d


        


Conclusion

 


From the "First" and "Second", we can conclude that gcd(a,b)=gcd(a-b,b).

 

 

Chapter 5. Number Theory

(page 294. Number24)

Solved by 감광적(2019.4.13)

Finalized by 김찬호(2019.4.13)


Reference: 1.Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition


24.Suppose that d>0 is a common divisor of nonnegative integers a and b, not both zero. Prove thatd|gcd(a,b).


Solution)


First

d divides a means that there exists an integer k which makes a =dk.

Also, d divides b means that there exists an integer l which makes b=dl

 

Second

Now we assume two integers x and y such that ax+by=gcd(a,b)

So, we can have the following two equations:

dkx+dly=gcd(a,b)

d(kx+ly)=gcd(a,b)


//we show that a=dk, b=dl.

so gcd(a,b)=C*d( C is constant)

so we can show d|gcd(a,b)


Therefore, we can prove that d|gcd(a,b)

Chapter 5. Number Theory

(page 233. Number32)

Solved by 최세현(2019.4.12)

Finalized by 김찬호(2019.4.12)


Reference: 1.Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition


Ch.5, Page 233,

Exercise 32 : Suggest ways to make Algorithm 5.1.8 more efficient.

Solution)

Algorithm 5.1.8 :

Testing Whether an Integer is Prime

Input : n

Output : d

is_prime(n) {

 for d = 2 to [√n]

  if(n mod d == 0)

   return d

 return 0

}

This algorithm checks

if all the integers less than√n can divide the n or not.

But this way is inefficient,

because duplicated values are also checked (which is composite numbers)

For example,if we checked 2 is not divisor of n,

after then, we don't have to check the multiple of 2. (2,4,6,8,10...)

 

Because of above reason, If we want to check the number is prime or not,

we just have to calculate with

prime numbers less than√n.

(For example, we want to check 400 is prime number,

we just check with 2,3,5,7,11,13,17,19 (less then√400 = 20))

 

But, we don't know what are the prime numbers less than√n,

So it is best way to calculate with only "odd" numbers. (first check with 2)

Then, the algorithm will be like this:

Input : n

Output : d

is_prime(n) {

 if(n mod 2 == 0)

  return 2

 for d = 3 to [√n]

  if(n mod d == 0)

   return d

  d = d + 1

 return 0

}

 

Therefore, This algorithm will reduce the number of operation to half of original's.

----------------------------------------------------------

add more about why we can check only prime number...

I quote qna about this question.


Question :

(quoted from :http://matrix.skku.ac.kr/2018-DM/DM-Ch-5-Lab.html)

In this example,

It checks 2017 is prime or not

But It seems like to check if the prime number less than 44 divides 2017..

why it only checks the prime number(2,3,5,7,11....43) divides 2017? not all the integer(2,3,4,5,6,7....44)??

 

Answer :

For the number​nto be a prime number,

The numbern​must not be divided by all the integers less than√n.

(Since all the number bigger than√n are the pairs of the number less than√n)


But, Since all the integers can be shown as the product(multiply) of the prime numbers,

(for example : 2, 3,22​, 5,2*3, 7,23, 32, 2*5....)

We just check thatall the prime numbers less than√ninstead of all the integerscan divide the number n.

----------------------------------------------------------------------------

so we can check only prime number.

and except 2

all prime number is odd

so we can check odd number > 2


we also think about why we cant divide direct prime number

because there is no way that we can make prime number sequence before divide.


왜바로 소수가 아닌 홀수로 나누는지에 대해 의문을 가질수 있지만.

그러면 sqrt(n)보다 작은 소수를 미리 다 구해놔야 하지만.. 그런 코드는 구현을 해도 새로운 코드의 time complexity가 추가되므로 Odd number로 나누는 것이 효율적입니다.

 

n이 정말커진다면 이부분은 같이 한번 토론하고 비교해 볼 수 있을 것 같습니다

Chapter 6. Counting Method.

(page 338. Number29)

Solved by 감광적(2019.5.10)

Finalized by 김찬호(2019.5.11)


Reference: 1.Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition


Exercise 29

Ch.6.3, Page 338, Exercise 29 solved by감광적

 

Problem)

Prove that the number of solutions is integers to

WhereX1, X2, and X3are positive integers, is

 

Solution)

Firstly, because of the domains of x1, x2, and x3 are all positive integers, we leave the case of x1=x2=x3=0. Hence, we have n-3 choices of positive integers.

Secondly, we have three categories so the number of “| is 2.

Finally, apply the C(k+t-1,t-1) to solve the problem. And the answer is

n-3+2C2

 

//we can approach with k=2, t=3


Answer

By the proof above, the number of solutions is[(n-1)(n-2)]/2

 

Comment

It's a simple example solved by applying Theorem 3.5.

 

Theorem 3.5

 

Ifis a set containingelements,the number of unordered,-element selections from, repetitions allowed, is

.


 

//comment by 김찬호

This problem is good to use theorem 3.5

and the solution is simple and exact

thank you


Chapter 7. recurrence relation

(page 377. Number15)

Solved by 김찬호(2019.5.18)

Revised by 최세현(2019.5.18)

Finalized by 박재형(2019.5.18)


Reference: 1.Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition


Question

Solve the given recurrence relation for the initial condition given:

an= 6an-1- 8an-2

a0= 1, a1= 0

 

(Combined both최세현 and 박재형's revisions.)


Solution with최세현's Revision:


Characteristic equation.

(using theorem 7.2.11)

Let)

 

Substitute the initial condition

Answer:

an= 2n+1- 4n

Solution with박재형​​'s Revision:

Theorem 2.11

 

http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html

 

We can use theorem 2.11 in chapter 7

 

Let

Answer:

Chapter 7. recurrence relation

(page 377. Number15)

Solved by 김찬호(2019.5.18)

Revised by 최세현(2019.5.18)

Finalized by 박재형(2019.5.18)


Reference: 1.Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition

Problem

Solve the given recurrence relation for the initial conditions given:


2an= 7an-1- 3an-2 a0= a1= 1.

Solution

Characteristic equation

2t2- 7t +3 = 0

t=3, 1/2


Let)

an= A3n+ B(1/2)n

(Substitute Initial Condition)

a0 = A + B =1

a1 = A*3 +B *(1/2) = 1


A = 1/5  , B = 4/5

 (Substitute Coefficient to recurrence relation)

a​n= 1/5*3n​ +​4/5 * (1/2)n

an = ( 22-n + 3n ) /5

 

an= (22-n+ 3n)/5   (n ≥ 0)  

***

(using theorem 7.2.11)

In this case, using the coefficients of the an,n-1,n-2, we make the quadratic equation

2an,7an-1, -3an-2==> 2t2- 7t + 3 = 0

and by using the solution "t" from above equation, (t = 3, 1/2)

we make the form like this :

an= p3n+ q(1/2)n

Answer:

an= (22-n+ 3n)/5    (n ≥ 0)


Chapter 7. recurrence relation

(Ackerman’s function)

Solved by 김찬호(2019.5.18)

Revised by 최세현(2019.5.18)

Finalized by 박재형(2019.5.18)

Reference: 1.Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition


Explanation


 

Example 1.10

Ackerman’s Function

Ackerman’s function is the recurrence relations

(1.11),

(1.12),

.

The initial conditions

(1.13),

Ackerman’s function is rapid rate of growth.


 

Ackerman's function is the function that represent the recurrence relation.

but the rate of growth is very rapid.


for example, If we find A(1.2), the result is 4, it is very small number we can easily find

But, If we find the result by using a little bigger number, 4or3 ==> A(4,3)

There will be a lot of calculation, and the result is very big number.)

we can get more information from here :


Reference

https://ko.wikipedia.org/wiki/아커만_함수

 

So if you put big number. it cannot work well. even in computer.

So to solve problem efficiently, make a general term in each case. and solve it.

However, Ackerman's function is often used to analyze the complexity of algorithms.

 


Chapter 7.1 Page 363 Problem 40 we compute A(2,2)

 


Reference 

http://icampus.ac.kr/front/study/QnaAction.do?method=view&lmsBdotSeq=2929466&lmsBlbdId=394928&isRply=Y

 

In this problem, we use general terms to solve this problem.


Comment by 김찬호

Exercise를 보다 보면 Ackerman’s function에 관한 문제가 많지만 이 부분을 잘 아는 학생은 드물거라 생각하여 같이 post하게 되었다. 재귀적인 관계로 이루어진 Ackerman’s function은 직접 숫자를 가지고 진행 하다 보면 익숙해 지기 쉽다.









Problem  of recursive function perpective of Programmer

Variables  that are created when you call yourself are newly created variables. Soon, it  can cause memory problems.

One  of the most common mistakes when using recursive function is initialization in  recursive functions

If  you do not initialize the system, the system turns around the recursive function  of the infinite loop, causing a memory error

​Initialization  in a recursive funtion provides a return point to end the recursive funcion.  Therefor, initialization in a recursive funtion is absolutely necessary, and if  you do not use it, you will not be able to find the ending point, so you will  end up in an infinite loop.

Recursive  calls are performed internally through stack memory. The function stores  relevant information in the activation record, which is stored in the stack  memory in order and then popped in turn. Because of limit size of stack memory  it can be forcefully terminated due to insufficient memory if the recursive call  is repeated too much





A  linear search scans one item at a time, without jumping to any item .

The  worst case complexity is  O(n), sometimes known an O(n) search 

2. Time  taken to search elements keep increasing as the number of elements are  increased.

A  binary search however, cut down your search to half as soon as you find middle  of a sorted list.

The  middle element is looked to check if it is greater than or less than the value  to be searched. 

2. Accordingly,  search is done to either half of the given list

Important  Differences

    Input  data needs to be sorted in Binary Search and not in Linear Search 

Linear  search does the sequential access whereas Binary search access data randomly. 

Time  complexity of linear search -O(n) , Binary search has time complexity O(log n). 

   Linear  search performs equality comparisons and Binary search performs ordering  comparisons

 

Linear  Search to find the element “J” in a given sorted list from A-X

Binary  Search to find the element “J” in a given sorted list from A-X

참조  : https://www.geeksforgeeks.org/linear-search-vs-binary-search/





Bubble  sorting is called bubble sorting, as it moves from the first element to the last  spot while continuing between adjacent elements. n memories are used for n  elements. Since data can be compared one by one, it can be compared precisely,  but the number of comparisons increases, which is not a good way of performance.  Repeat from the first element to the last element and align the largest element  to the last element after one step.

Time  complexity :  O(N²)

[69  10 30 2 16 8 31 22]

[10  30 2 16 8 31 22] 69

[10  2 16 8 30 22] 31 69

[2  10 8 16 22] 30 31 69

[2  8 10 16] 22 30 31 69

[2  8 10] 16 22 30 31 69

[2  8] 10 16 22 30 31 69

2  8 10 16 22 30 31 69



출처:
https://tctt.tistory.com/47 [TcTT]

Nevertheless time complexity of Big-O is  O(n^2)(longer than quick sort and other sorts), we use bubble sort often becuase  of precise data result. For example, between quick sort and bubble sort, quick  sort has quick time complexity than bubble sort(nlogn<n^2) but it has less  accuracy than bubble sort.





1.

// 원반을 from에서 to로 옮긴다.
void move(int from, int to){
    printf(
"\nMove from %d to %d", from, to);
}

// n개의 원반을 from 에서 by를 거쳐 to로 옮긴다.
void hanoi(int n, int from, int by, int to){
   
if (n == 1)
        move(from, to);
   
else{
        hanoi(n - 1, from, to, by);   
// 1번  N-1개의 원반을 기둥3을 거쳐 2로 옮긴다.
        move(from, to);               
// 2번 기둥 1에서 1개의 원반을 기둥 3으롱 롬긴다.
        hanoi(n - 1, by, from, to);   
// 3번 기둥 2에서 N-1개의 원반을 기둥 3으로 옮긴다.
    }
}

--> Hanoi tower  code in C

 

2. Another  example in recursive function

int BSearchRecur(int ar[], int first, int last, int target){

    int mid = (first + last) / 2;

    if (first > last)

        return -1;

    else{

        if (ar[mid] == target)

            return mid;

        else{

            if (ar[mid] > target){

                last = mid - 1;

                BSearchRecur(ar, first, last, target);

            }

            else{

                first = mid + 1;

                BSearchRecur(ar, first, last, target);

            }

        }

    }

--> This is binary search code in C which we learn in Chaper 4 (Algorithm  chpater). Binary search algorithm also use recursive function



In computability  theory, the Ackermann function, named  after Wilhelm Ackermann, is  one of the simplest[1] and  earliest-discovered examples of a total computable  function that is not primitive  recursive. All primitive recursive functions are total and computable, but  the Ackermann function illustrates that not all total computable functions are  primitive recursive.

After  Ackermann's publication[2] of  his function (which had three nonnegative integer arguments), many authors  modified it to suit various purposes, so that today "the Ackermann function" may  refer to any of numerous variants of the original function. One common version,  the two-argument Ackermann–Péter function, is defined as  follows for nonnegative  integers m and n:

C code that  represent Ackermann-function 

int acker(int m, int n) {
if (m == 0)
  return n +  1;
else if (n == 0)
  return acker(m - 1, 1);
else
  return  acker(m - 1, acker(m, n - 1));
}

 





Every n-cube  of n > 0 is composed of elements, or n-cubes of a lower  dimension, on the (n−1)-dimensional surface on the parent hypercube. A  side is any element of (n−1)-dimension of the parent hypercube. A  hypercube of dimension n has  2n sides (a 1-dimensional line has 2 endpoints; a  2-dimensional square has 4 sides or edges; a 3-dimensional cube has 6  2-dimensional faces; a 4-dimensional tesseract has 8 cells). The number of  vertices (points) of a hypercube is (a  cube has vertices,  for instance).

The  number of m-dimensional hypercubes (just referred to  as m-cube from here on) on the boundary of  an n-cube is

,[3]      where and n!  denotes the factorial of n.

For  example, the boundary of a 4-cube (n=4) contains 8 cubes (3-cubes), 24 squares  (2-cubes), 32 lines (1-cubes) and 16 vertices (0-cubes).

This  identity can be proved by combinatorial arguments; each of  the vertices  defines a vertex in a m-dimensional boundary. There  are ways  of choosing which lines ("sides") that defines the subspace that the boundary is  in. But, each side is counted times  since it has that many vertices, we need to divide by this number.

This  identity can also be used to generate the formula for  the n-dimensional cube surface area. The surface area of a  hypercube is:
These  numbers can also be generated by the linear
recurrence relation

For  example, extending a square via its 4 vertices adds one extra line (edge) per  vertex, and also adds the final second square, to form a cube,  giving  =  12 lines in total.



 

 

<What is Euclidean Algorithm>

 

The Euclidean Algorithm. Recall that the Greatest Common Divisor (GCD) of two integers A and B is the largest integer that divides both A and B. The Euclidean Algorithm is a technique for quickly finding the GCD of two integer.

 

<Proof Euclidean Algorithm in Korean>

 


 

<Euclidean Algorithm code in python>

Understanding this important part of python code will be good.

 while b != 0:

        

        r = a % b

        a = b

        b = r



Finalize by 김도훈.

Let's assume that n≥m is not lost to generality. (n = max(n,m))

 

Then, m≥n%m is clear, considering the n characteristic of the remaining operations.

So get_gcd goes as shown below.

get_gcd(n,m) → get_gcd(n%m,m) → get_gcd(m%m,n%m)

So time complexity can be O(log(max(n,m))) and, it can be O(log(n+m)).

=====

Add)

I take the above mentioned expression

'get_gcd(n,m) → get_gcd(n%m,m) → get_gcd(m%m,n%m)',

I will give you a further explanation.

It is clear that the constant number of operations was required until 'get_gcd(m%(n%m), n%m) is called. And let this first sentence.

Next, the maximum value of 'm%(n%m)' or 'n%m' is 'n%m'. And let this second sentence.

In case of n≥m, n > 2*(n%m) is formed. And let this third sentence.

Combining first and second sentence means that the maximum value of the two numbers was changed from 'n' to 'n%m' by counting the constant number, which means that the maximum value was less than half by third sentence.

This allows you to prove that the time-complexity of the above source is O(log(n,m)). This is because the maximum value was less than half due to the computation of the constant number. Also, if you change it to a simple marker, it becomes an O(log(n+m)).


 

Comment by 채상은:

Since I had a difficulty for understanding the proof of Euclidean Algorithm,

 I did search in Google for easy proof of this algorithm, then I can understand it easily.

Also because I’m major in software, I can understand intuitively by looking the python code.


Comments by 김도훈:

Comments : There are few more time-complexities of Euclidean Algorithm, because there are some different expressions that can express Euclidean Algorithm - such as using recursion or iteration etc. So I was impressed that there are many ways to express one algorithm!




A bit is  a binary digit..

 

The binary  Number System consists  of  symbols(bit).

The octal  Number System consists  of  symbols.

The decimal  Number System consists  of  symbols.

The hexadecimal  Number System consists  of  symbols.

The  system is based the base of  the number system.

 

      Decimal numbers

the  numbers we use in everyday life are decimal numbers, because they are based on  10 digits (0,1,2,3,4,5,6,7,8 and 9).

 

Binary  Numbers use only the digits 0 and 1.


Examples:
•  0 in Binary equals 0 in the Decimal Number System,
• 1 in Binary equals 1 in  the Decimal Number System,
• 10 in Binary equals 2 in the Decimal Number  System,
• 11 in Binary equals 3 in the Decimal Number System,

•  100 in Binary equals 4 in the Decimal Number System,

 

Octal  Number System

Definition: The  number system whose base is 8 is known as the octal number system.  The base 8 means the system uses eight digits from 0 to 7. All the  eight digits from 0 to 8 have same physical meaning as that of decimal numbers.  The next digit in octal number is represented by 10, 11, 12, 13, 14, 15, 16, 17  which represents the decimal digits 8, 9, 10, 11, 12, 13, 14, 15. In this manner  the octal number 20 represents the decimal number 16 and subsequently 21, 22,  23….octal numbers will show the decimal digits 17, 18, 19…etc

https://circuitglobe.com/octal-number-system.html

 

Hexadecimal  number​

Hexadecimal  describes a base-16 number system. That is, it describes a numbering system  containing 16 sequential numbers as base units (including 0) before adding a new  position for the next number. (Note that we're using "16" here as a decimal  number to explain a number that would be "10" in hexadecimal.) The hexadecimal  numbers are 0-9 and then use the letters A-F.

https://whatis.techtarget.com/definition/hexadecimal


에서 보듯이

집합 X 위의  관계 R이   아래의 3가지 조건을 모두 만족하므로 동치관계 라는 것을 보여주는 예이다.

  X는  다음  3 조건들을 만족한다.

 

(반사관계)  임의의 X 에  대하여, x=x

(대칭관계)  임의의 X 에  대하여, 만약 x =y라면,y=x 

  (추이관계)  임의의 X 에  대하여, 만약 x=y이고 y=z라면 x=z

 

그리고 동치관계이므로 동치류가 존재하고, 그 동치류를 집합으로, 그 안의 성분들을   X 라는 집합으로 보여준 것이다.

집합 X 위에  동치관계 R 이  주어졌을 때, 원소 x 의,  동치관계 y 에  대한 동치류(同値類, 영어: equivalence class) R 는  그 원소와 동치인 원소들의 집합이다

 

처음에  이해를 하지 못했던 부분은 symmetric 부분에서 왜 3이 x-y로 나누어지면 y-x도 3으로 나누어지는것이 symmetric일까 생각을  했지만, 조금만 더 symmetric의 정의에 대해서 생각해보면 당연한 얘기 입니다.

이  문제를 통하여 Equivalence class 에 관련된 내용을 조금더 확실히 이해할 수 있었습니다.



Solved by 김세진

Added by 김두원

Finalized by 김찬호


1.Solution of Ex.6.2.23


출처 : http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html 

 

Example 2.23

 

How many routes are there from the lower-left corner of an  square grid to the   upper-right corner if we are restricted to traveling only to the right or upward and if we are allowed to touch but not go above a diagonal line from the lower-left corner to the upper-right corner?

 

//이 문제는 catalan number에 대한 문제입니다. 

교재 Ex.6.2.23 에서의 설명이 조금 부족한 것 같아 제가 이해한 대로 설명하고자 합니다.

 

문제에서와 같이 4 x 4 grid 와 3 x 5 grid 가 주어져 있습니다.

원래의 4 x 4 grid 에서 배드 루트가 되려면 그림에 표시한 지점 1~4 중에서 적어도 한 곳을 지나야 함은 자명합니다. 또한 3 x 5 grid 에서 왼쪽 아래에서 오른쪽 위 까지의 루트는 마찬가지로 표시한 1~4 지점 중 적어도 한 곳을 지나야 함을 알 수 있습니다.

 이제 각각의 루트들이 bijective 하게 나타내어질 수 있는지 확인해 보겠습니다.

 먼저 4 x 4 grid 에서 배드 루트가 지점 1 을 첫번째로 통과할 경우, 이를 스트링으로 나타내면 U □ □​ □​ □​ □ ​□​ □ 가 되고 빈 자리에는 남은 U 세개와 R 4개가 들어가야 될 것입니다.​ 따라서 지점 1을 첫번째로 통과하는 배드루트의 갯수는 C(7,3)= 7! / (4!*3!) 입니다.

 

한편 3 x 5 grid 에서 지점 1을 먼저 통과하는 루트를 스트링으로 나타내면

U □ □​ □​ □​ □ ​□​ □ 가 되고 빈 자리에는 남은 U 4개와 R 3개가 들어가야 됩니다.

따라서 지점 1을 첫번째로 통과하는 루트의 갯수는 C(7,4) = 7! / (3!*4!) 이며 

이는 위의 배드루트의 갯수와 같음을 알 수 있습니다. 따라서 각각의 루트는 서로 one-to-one 으로 매칭이 가능합니다.

 

4 x 4 grid에서 배드 루트가 지점 2를 첫번째로 통과하는 경우, 이를 스트링으로 나타내면 

R U U​ □​ □​ □ ​□​ □​ 이고 빈 자리에 R 3개와 U 2개가 들어가야 됩니다.

따라서 이 경우 배드루트의 갯수는 C(5,2)= 5! / (3!*2!)

 

3 x 5 grid 에서 지점 2를 첫번째로 통과하는 경우는 마찬가지로 R U U​ □​ □​ □ ​□​ □​ 이고​ 빈 자리에는 R 2개와 U 3개가 들어가므로 C(5,3) = C(5,2)

 

따라서 이 경우도 각각의 루트가 서로 one-to-one으로 매칭됨을 알 수 있습니다.

마찬가지 방법으로 지점3 과 4 를 첫번째로 통과하는 경우도 서로 one-to-one 임을 알 수 있습니다. 여러 지점을 동시에 첫번째로 통과할 수 없기 때문에, 위에서 살펴본 4 종류의 case는 서로 독립적입니다. 

  

또한 모든 루트는 위 4 지점 중 적어도 하나를 통과하여야 하기 때문에 4 cases 의 route set 들은 pairwise disjoint family 를 이룸을 알 수 있습니다. 따라서 Addition principle 에 따라 4 cases 를 전부 합하면 4 x 4 grid 에선 모든 배드루트들의 수가, 3 x 5 grid 에선 모든 루트들의 수가 구해집니다.

 

이 루트들이 서로 빠짐없이 one-to-one 으로 매칭되므로, 이 루트들은 onto function이기도 합니다. 따라서 두 루트들은 서로 bijective 함을 알 수 있습니다.

 

같은 원리로 이를 n x n matrix 로 generalization 이 가능합니다. 

이에 따라 Bn=C(2n, n-1) 임이 증명됩니다.

 

// general 하게 위에 있는 경우를 나타내어 보면

모든 bad route에 해당하는 점들이 y=x+1을 지나는 것을 알 수 있습니다.

따라서 제 qna에 올렸던 자료를 인용하겠습니다.

quoted from 

http://wiki.mathnt.net/index.php?title=%EC%B9%B4%ED%83%88%EB%9E%80_%EC%88%98_(Catalan_numbers)​

 

일단계

(0,0)에서 (n,n)까지 갈 수 있는 모든 방법의 수를 구해 보자.

이것은 매우 간단한 문제인데, 일대일대응을 통하여 문제를 풀어보자. 각 경로에서 x축으로 움직이는 것을 X로 표시하고 y축으로 움직이는 것을 Y로 표시하면, 각 경로는 X와Y를 n개 씩 쓴 문자열로 표현된다. 이것이 일대일 대응이다. 각각의 경로는 서로 다른 문자열로 표현될테고, 문자열은 또한 어떤 경로를 표현할테니까 말이다. 따라서 죽 늘어놓은 2n개 중에서 n개를 골라 X라고 써 놓으면 나머지 위치는 Y가 될 것이고 결정될 것이고, 그런 방법의 수는 (2nCn)이다. 즉, (0,0)에서 (n,n)까지 갈 수 있는 모든 방법의 수는 (2nCn)이다


이단계

이제 직선 y=x를 넘어서서 가는 경로의 수를 구하자. 경로는 반드시 y=x+1과 만나게 될 것이다.



이 때, 이 경로의 (0,0)에서부터 y=x+1과 처음으로 만나는 점까지를 잘라서, y=x에 대칭시키자.


그리고 나머지 경로를 평행이동시켜 대칭이동된 경로에 갖다붙이자.



그 결과는 (0,0)에서 출발하여 (n+1,n−1)에 도착하는 경로일 것이다.



위에서 한 작업은 서로 다른 두 경로의 집합 사이에 어떤 대응을 만들어 낸 것이다. 이 대응은 일대일 대응이다. 일대일대응임을 보이기 위해서는 두 가지를 생각해야 한다. 첫번째는, 서로 다른 것으로 대응되었는지를 살피고, 두번째는 공역의 모든 원소가 대응되었는지를 살피는 것이다.

 


comment 김두원:

해설의 이해를 돕기 위해서 문맥을 약간 수정했습니다. 이 문제를 이해하는데 애를 먹고 있었는데 훌륭한 설명 덕분에 쉽게 이해할 수 있었습니다. 감사합니다.


final comment 김찬호:

일반적인 예시로 설명을 잘 해주었습니다. 조금 더 general 한 설명을 인용해서 덧붙입니다.

Solution by 김두원

Solution added by 최세현

Final OK by 이상구 교수님


2.Three solutions to Ch.6.1 Example1.13

 

Example  1.13

 

 A committee composed of Alice, Ben, Connie, Dolph, Egbert and Francisco is to select a chairperson, secretary and treasurer. How many selections are there in which either Alice or Dolph or both are offices?


Solution 1 (Original)

Let  be the set of selection in which Alice is an officer.

Let  be the set of selection in which Dolph is an officer.

We first count the number of selection in which Alice is an officer.

Alice can be assigned an office in three ways. (3, chairperson, secretary and treasurer)

The highest remaining office can be filled in five ways.  (5)

The last office can be filled in four ways. (4)

There are three ways to assign Alice.

The number of selection in which Alice is an officer is , that is .


Dolph can be assigned an office in three ways.

The highest remaining office can be filled in five ways.

The last office can be filled in four ways.

There are three ways to assign Alice.

The number of selection in which Dolph is an officer is , that is .


[Both]  is the set of selection in which both Alice and Dolph are officers.

Alice can be assigned an office in three ways. (3)

The last office can be filled in four ways. (4)

The number of selection in which both Alice and Dolph are officer is , that is  and .

By the Inclusion-Exclusion Principle, there are

 = .      (Exs 92~97)

 

 

 

 Solution 2 (Solved by 김두원)

Above solution noted in "http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html" is a clean solution. But I found another simple solution to solve this problem effectively.

 

Selections are there in which either Alice or Dolph or both are offices is same as complementary selection of both Alice and Dolf is not an officer.​

Let U be the set of selection in which contains all of the possible cases.

Let X be the set of selection in which both Alice and Dolf is not an officer. 

 

The number of selection of all possible cases is 6*5*4 = 120. 

that is │U│=120

The number of selection in which both Alice and Dolf is not an officer.​ is 4*3*2 = 24, that is │X│​ = 24.

 

│U│​-│X│​=120-24=96. 

 

 ​Solution 3 (solved by 최세현)

We can easily solve this problem by multiplication principle with out using Sets or Diagram.

If both or one of Dolph and Alice is Officer, then the following is true.

1. One the other four person(Ben, Connie, Egbert and Francisco​) must be officer.

The number of this case is 4 * 3 (four person * three ways to officer)


2. and, we assign Alice or Dolph in to one of the remain two officer.

The number of this case is 2 (Alice or Dolph)

(We don't consider the number of ways. If we consider, the duplicate cases will be counted)

(So we determine the way of officer according to first process

If first process's officer is chairperson, now we assign Alice or Dolph in secretary. If first process's officer is secretary, now we assign Alice or Dolph in treasure. If first process's officer is treasure, now we assign Alice or Dolph in chairperson)


3. finally, we assign one of remain four persons at the one remain way of officer. The number of this case is 4 (four person)

(This process will assign remain Alice/Dolph or other three persons.

So this will satisfy the condition that both or one of Alice and Dolph is the officer)

 

the answer will be 4 * 3 * 2 * 4 = 96

C​omment by 최세현: ​

(This process will assign remain Alice/Dolph or other three persons.

So this will satisfy the condition that both or one of Alice and Dolph is the officer)


So the answer will be
4 * 3 * 2 * 4 = 96

 

(한글로 추가 설명을 하자면,

2번과정에서 남은 2가지 Officer 과 2명(엘리스 혹은 돌프) 로 보고 4가지경우로 보지 않고 1번과정에 따라서 한가지 Officer을 정한 후 2명(엘리스 혹은 돌프) 로 보는 이유는, 3번과정에서 남은 한자리에 사람을 배정할 때에 중복된 경우가 생성되기 때문입니다.)


Solved By PIRAN CACI, Date: 2019.03.18.

Finalized by 김두원, Date: 2019.03.18

       Final OK by SGLee


Question

 

Let prove that the sum of two even integers is even.


Solution


We know that every integer multiplied by two will be an even integer. Let a = 2x and b = 2y, where x and y are integers.

This gives us: x + y = 2a + 2b = 2(a+b),

Because of that the sum of a and b must also be an even integer.


Solved By 강동윤, Date: 2019.03.18.

Finalized by 김두원, Date: 2019.03.18

       Final OK by SGLee


Question


In induction step, objective is to show that for all k, 4 < = k < n (n >= 6) k cents partage can be done

I understand basic​ step and objective of induction step.

But I can't understand next step.

Why is 4 < n-2 < k?


Solution


At the inductive step of the solution, we assumed that k cents postage can be done for all 4<=k<n for n>=6.

Because we supposed n>=6, we can say n-2>=4.

Also we already assumed the statement is true for all k when 4<=k<n

As a result there exists n-2 which fulfill the condition 4<=n-2<k.


Summurized by 최세현​

Added by 김찬호​

Added by 김두원​

Finalized by ​​박재형​

Re-Finalized by 담딘바자르​​

3.SKKU DM Chapter 6.3 Summary

(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html)​

6.3 Generalized Permutations and Combinations

 

 Theorem  3.2

 

Suppose that a sequence  of  item has

    identical objects of type ,

    identical objects of type , and

    identical objects of type .

 Then the number of orderings of  is

.

 

This Theorem shows how to count the cases that there are same objects of distinct types.

We count the number of cases of n elements by using factorial ==> n!

But there are same objects, Duplicated cases exist.

So we have to divide it by the number of objects

 

Example of above Theorem :

 

Example  3.1

 

How many strings can be formed using the following letters?

                              

 

There are 11 elements and one M, four i, four S, two P.

So, If we apply above theorem to this example,

the answer will be (11!)/ (4! 4! 2! 1!). 


 

 

 Theorem  3.5

 

 If  is a set containing  elements, the number of unordered, -element selections  from , repetitions allowed, is

.

 

This Theorem shows how to count the number of cases that Dividing same k elements to t groups.

 

It's same as Combination principle ​8​C​2​ =  ​8​C​6

 

Example of it :

 

Example 3.4

 

Consider three books; a computer science book, a physics book and a history book. Suppose that the library has at least six copies (should have six copies) of each of these books. In how many ways can we select six books?

In this example, by using above theorem, we have to divide 6 same copies to 3 groups (computer science, physics, and history)

Then, the answer will be ​8​C​2​.

The principle of it is, put two bar that divide 6 same copies to three groups.

If there are 6 copies,

(X X X X X X),

and we put two bars between them,

(XX|XXX|X)

We need 8 positions, and we choose 2 positions of the two bars.

The cases of it is ​8​C​2​. 

 

.

 

In this, we can choose t(책의 종류) = 3  k(분류하는 선택지) = 6.

 

Theorem  3.5

 

 If  is a set containing  elements, the number of unordered, -element selections  from , repetitions allowed, is

.


 

this is exciting theorem. and we can apply this at next example.

 

 

Example 3.6

 

 Suppose that there are piles of red, blue and green balls (=3) and that each pile contains at least eight (8=) balls.

 (a) In how many ways can select eight balls?

 (b) In how many ways can select eight balls if we must have at least one ball of each color?


solution)

By Theorem 3.5, the number of ways of selecting eight balls is (공을 3개 상자에 8개 담는 방법) (=3, 8=)

.

We can also use Theorem 3.5 to solve part (b) if we first select one ball of each color. To complete the selection, we must choose five additional balls (5=). This can be done in

 

 

 

The following table summarizes the various formulas:

 

 

No Repetitions

Repetitions Allowed

Ordered Selections

Unordered Selections

 

 

 

Comment by 김찬호:

최세현 군의 summary에서 중요한 theorem 과 example을 덧붙였습니다.

6.3장은 저희가 앞에서 배운 순열과 조합의 연장선이고 응용입니다. 내용이 어렵지만 공부하면 다루기 쉬운 부분이라고 생각합니다 

 

Comment by 김두원:

6.3장의 내용을 훌륭하게 정리한 요약이라고 생각합니다. 마지막에 문제마다 적용할 수 있는 공식을 쉽게 알 수 있는 테이블을 lab에서 참조하여 가져왔습니다. 이 공식들은 까다로운 문제를 쉽게 해결할 수 있는 공식이므로 꼭 숙지해야합니다. 

 

Comment by 박재형:

조합의 theorem에서 비슷한 이론을 덧붙였습니다. 그리고 예제에 이론이 어떻게 쓰였는지 붙였습니다.

6.3장의 내용은 생각보다 어렵지만 문제를 많이 풀다보면 식을 자유자재로 쓸 수 있을만큼 실력이 향상될 것을 믿습니다. 적용할 수 있는 공식을 이해하고 외운다면 문제를 쉽게 풀 수 있을 것임을 깨달았습니다. 

 

Comment by 담딘바자르​:

Chapter 6.3 has some background basics based off of middle school Mathematics concepts in my opinion, specifically statistics and probabilities. The crucial concept is on accountability of repeats.

 

 

Summary by 이승원

Add by 김두원

Finalized by 채상은

Re-Finalized by 에인젤피트리사리

 

 4. Summary of Chapter 5.2

 

(By 채상은​) 5.2 Representations of Integers and Integer Algorithms​

bit is a binary digit. A bit has a 0  and a 1  .

The binary Number System consists of  2  symbols(bit).

The octal Number System consists of 8  symbols.

The decimal Number System consists of  10 symbols.

The hexadecimal Number System consists of 16  symbols. 

The system is based the base of the number system.


    Decimal numbers

 

the numbers we use in everyday life are decimal numbers, because they are based on 10 digits (0,1,2,3,4,5,6,7,8 and 9).

 

Binary Numbers use only the digits 0 and 1. 
Examples: 
• 0 in Binary equals 0 in the Decimal Number System,
• 1 in Binary equals 1 in the Decimal Number System,
• 10 in Binary equals 2 in the Decimal Number System,
• 11 in Binary equals 3 in the Decimal Number System,

• 100 in Binary equals 4 in the Decimal Number System,

 

Octal Number System

Definition: The number system whose base is 8 is known as the octal number system. The base 8 means the system uses eight digits from 0 to 7. All the eight digits from 0 to 8 have same physical meaning as that of decimal numbers. The next digit in octal number is represented by 10, 11, 12, 13, 14, 15, 16, 17 which represents the decimal digits 8, 9, 10, 11, 12, 13, 14, 15. In this manner the octal number 20 represents the decimal number 16 and subsequently 21, 22, 23….octal numbers will show the decimal digits 17, 18, 19…etc 

https://circuitglobe.com/octal-number-system.html

Hexadecimal number​

 

Hexadecimal describes a base-16 number system. That is, it describes a numbering system containing 16 sequential numbers as base units (including 0) before adding a new position for the next number. (Note that we're using "16" here as a decimal number to explain a number that would be "10" in hexadecimal.) The hexadecimal numbers are 0-9 and then use the letters A-F.

https://whatis.techtarget.com/definition/hexadecimal

 

 

Can also switch from decimal to hexadecimal:

 

 

Example  2.9

 Decimal to Hexadecimal

 

 


We can covert a decimal inter into base b integer by the algorithm stated below.\

By using this algorithm, we can learn how the number system is consisted and understand the way to converting decimal to binary, octal and hexadecimal number. 

 

Algorithm  2.7

Converting a Decimal Integer into Base 

 This algorithm convert the positive integer   into the base   integer  .    The variable   is used as an index in the sequence  .

 The value of     is the remainder when   is divided by  .

 The value of   is the quotient when   is divided by  .

      Input:   , 

    Output:   , 

    dec_to_base_b( ,  ,  ,  ) 

       

       while ( )   

 

 (By 이승원​)  In today's class we learned about 5.2 which is about Representations of integers and integer algorithms.

We already know about decimal and binary number system, but we also learned other system such as octal and hexadecimal number system. In octal number system, we use only 0,1,2,3,4,5,6,7 to use any number. It is little bit same as decimal and binary system. For example, 33210 can be writen as 5148 because 332 is 5*8^2+1*8+4. We call the value on which the system is based such as 10 or 8 is the base of number system. In hexadecimal system, we have to use 16number from 0 to 15, but we can't use number bigger than 9 because we have to use one number in one symbol. So we use alphabet by using A B C D E F as 10 11 12 13 14 15. The other method is same as other system.

We can add two or more number in binary, not decimal in binary addition such as example below.

 

 

Example  2.10

 Binary Addition

 Add the binary numbers  and .


 Solution

                                         

                                        

                                       

We begin from the right, adding  and . This sum is .

We write  and carry . At this point the computation is

                                           

                                         

                                        

                                            

Next, we add  and  and . This sum is .

We write  and carry . At this point the computation is

                                          

                                         

                                        

                                                   00                     

Continuing in this way, we obtain

                                         

                                        

                                                   

 

(By 김두원​) Similarly, we can add two hexadecimal number like below.

 

 

Example  2.13

 Hexadecimal Addition

 Add the hexadecimal numbers  and .

 

Solution

     

                                            

                                      

We begin from the right, adding  and . This sum is .

We write . At this point the computation is

     

                                            

                                                      

Next, we add  and . This sum is .

We write  and carry . At this point the computation is

                                             

     

                                            

                                                     

Continuing in this way, we obtain

     

                                           

                                                           

 

Add on theorem (By 에인젤피트리사리): 

Theorem 2.17 Quoted by Chapter 5 Notes 

http://matrix.skku.ac.kr/2018-DM/DM-Ch-5-Lab.html 

 



Comment by 에인젤피트리사리: ​

I feel that the Hexadecimal Addition is more complicated than the binary addition because in Hexidecimal Addition, it uses Hexadecimal numbers and the numbers 10-16 are represented with letters such as A,B,C,D,E,F. Whereas in Binary Addition it just uses 0 and 1, in which 1+1 = 0 and will carry another 1 that will be added with the next column. It is not that difficult to do the Hexadecimal Addition but it is sometimes confusing. However, I will make sure to keep on practicing to get better! 

 

 

Summary by 김두원

Add by 최세현

Finalized by 박재형

 

5.Summary of 4.3, 4.4

(quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-4-Lab.html)

4.3 Analysis of Algorithms Problem

 

* The program is useless If the time needed to run is too big or the space needed to run is too big.

​The time needed to execute an algorithm is a function of the input.

Instead of dealing directly with the input, we use parameters that characterize the size of the input.​

For example,

The input is a set containing  elements.      The size of the input is .

Best-case-time: We can ask for the minimum time needed to execute the algorithm among all inputs of size .  This time is the best-case-time for inputs of size .

 Omega

Worst-case-time: We can ask for the maximum time needed to execute the algorithm among all inputs of size .  This time is the worst-case-time for inputs of size .

 ​Big-Oh

Average-case time: Another important case is average-case time that the average time needed to execute  the algorithm over some finite set of inputs all of size .

 ​Theta


Here is example for it.

   (quoted from  http://matrix.skku.ac.kr/2018-DM/DM-Ch-4-Lab.html

 

 

Definition  3.2

 

Let  and  be functions with domain 

     is big oh of        is of order at most 

                    is positive constant such that 

 

       is omega of      is of order at least 

                      is positive constant such that 

 

       is theta of        is of order 

                      and 

 

There is three notation about complexity.

Big O notation is often described for complexity because it indicates worst case. 

 

Example  3.3

 

Show that .


To show whether the theta notation above is true, we have to show both of big-O notation and Omega notation are same.

 

Solution

Since

     for all ,

Taking  in Definition  to obtain

.

Since

       for all ,

Taking  in Definition  to obtain

.

Therefore,

 and   

 

.                  

 

 

​4.4 Recursive Algorithms 

​Recursive Algorithms means calling the function IN THE FUNCTION ITSELF. 

 

For example, If we want to find the n! (factorial of n)

​The recursive function will be like this : 

 

factorial(n) = n * factorial(n-1) (n >1)

If n = 1, factorial(n) = 1.

 

So, It will provide like this (for example of n = 5)

factorial(5) = 5 * factorial(4) = 5 * 4 * factorial(3) = ... = 5 * 4 * 3 * 2 * factorial(1) = 5*4*3*2*1.

 

This recursive algorithm is very efficient to repeat the similar operations.

 

Robot Walk Problem

 

 Example  4.5

 

A robot can takes of  meters or  meters.

We write an algorithm to calculate the number of ways the robot can walk  meters.

We are going to find the number of ways the robot can walk, by using recursive algorithm.

 

Testing for the short distances (1,2,3,4),

If distance is 1, robot can walk through 1 way   (1)

If distance is 2, robot can walk through 2 ways (1,1)(2)

If distance is 3, robot can walk through 3 ways (1,1,1)(1,2)(2,1)

If distance is 4, robot can walk through 5 ways (1,1,1,1)(2,1,1)(1,2,1)(1,1,2)(2,2)

 

There are only 2 ways to go. 2 steps or 1 step.

 

According to above fact, If we make the function to find the number of ways the robot can walk n meters,

Then, the function will be like this :

 

Walk(n) = Walk(n-1) + Walk(n-2) (n >2)

if n = 2, Walk(n) = 2

if n = 1, Walk(n) = 1


=> Walk(n) = Walk(n-1) + Walk(n-2) = Walk(n-2) + Walk(n-3) + Walk(n-4) + Walk(n-3) = .....

This algorithm repeats to divide the last step to two cases that one meter step or two meter step.

So, it will provide the all cases that robot can walk. 

 

​Summary :​ 

In 4.3, We have learned about analysising the program (with time, space complexity) when the case is worst, best, and regular.

Also in 4.4, We learned to build recursive function to solve the problem like finding fibonachi, factorial.


Preview of 김찬호

Added by 김은민, 박재형, 최세현, 담딘바자르

Finalized by 김두원


6.Preview 6.1, 6.2


(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html)

6   Counting Methods and the Pigeonhole Principle

  

In chapter 6, we will learn about Counting Methods and Pigeonhole Principle.

 

6.1   Basic Principles

 

Example of counting:

Menu for Quick Lunch:

There are two appetizer, three main courses and four beverages and .

 

 

HTHMHCHRCTCMCCCRFTFMFCFR ()

And

    NHTNHMNHCNHRNCTNCMNCCNCRNFTNFMNFCNFR,

                    12 with Nachos   (N),   +

                                        12 with Salad     (S)  = 24.

    SHTSHMSHCSHRSCTSCMSCCSCRSFTSFMSFCSFR 


We can solve this problem by using Multiplication Principle noted below.

Multiplication Principle  (Product Rule)


 


Using product rule to solve above problem :

The problem of counting the number of dinners consisting of one appetizer, one main course and one beverage,

  First step is “select the appetizer.”

  Second step is “select the main course.”

  Third step is “select the beverage.”

 

By the Multiplication Principle,

 and , the total number of dinner is .

 

if any activity that consist of t times succesive steps,

step 1, n1 ways

step 2, n1 ways

..

step t, nt ways

than we can represent the total different possible activity n1*n2*...nt


Addition Principle

simmillary we can make addition principle.

we can pick the elements of each sets.

than the total union of sets's element is n1+n2+...+nt



There is a theorem about Inclusion exclusion principle for two sets

 

 

 Theorem  1.12

Inclusion-Exclusion Principle for Two Sets

If  and  are finite sets, then

.

 
6.2   Permutations and Combinations

 

 Definition  2.1

 

 A Permutation of  distinct elements  is an ordering of the  elements ,    .

 

 Definition  2.8

-permutation of (distinct) elements

 

permutation means the ordering of n elements

and r-permutation of n elements is an ordering of an r-element subset of

{x1,x2,,,xn}

The number of this is P(n,r)

and we can calculate in this form

 

 Theorem  2.10

 

The numbers of -permutation of a set of  distinct objects is

,     .

 

simillary we can define combination with

 

 

Definition  2.15

 

 Given a set  containing  (distinct) elements,

 (a) An -combination of  is an unordered selection of -elements of (i.e. an          -element subset of ).

 (b) The number of -combination of a set of  distinct elements is  or .

 

And this is detailed explanation about r- combination of a set of n distinct elements. The numbers of -combinations of a set of  distinct objects is

,     

***

Comment by 최세현 : We will learn about counting methods, permutation and combinations.

I think that it will be very useful to check the cases to solve problems or calculate the number of all the cases. 

 

Comment by 담딘바자르​:

In my opinion, counting methods are used to determine the complexity of algorithms ,and they can be used to solve other sorts of problems. I think counting is related to probabilities and statistics because it has some elements and techniques from the subjects such as finding all possible results to determine the best result. Moreover, these sections are even big part of our life, so they should be familiar with us. 

 

Comment by 김두원:

Multiplication Rules and Addition Rule are the most important basic principle to solve counting problem. By counting, we can calculate the complexity of an algorithm and statics kind problems.

 

 

summary by 웅요빈

add by 김진녕​/​김도훈​/한진수​/담딘바자르​/김은민​/김두원)​

Finalized by 박재형

7. Summary 3.4,3.5


​(quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-3-Lab.html,

 summary of 웅요빈/김진녕​/​김도훈​/한진수​/담딘바자르​/김은민​/김두원)

3.4   Equivalence Relations

 

The next theorem shows that some relation is always reflexive, symmetric and transitive. -> This is equivalence relation.

 

 

 Theorem  4.1

 

Let   be a partition of a set . Define  to mean that for some set  in , both  and  belong to . Then  is reflexive, symmetric and transitive.

 

This proof displays how the 3 properties formed:

 

Proof 

Let .

By the definition of partition,  belongs to some numbers  of .

Thus  and  is reflexive.

   Suppose that .

Then both  and  belong to some set .

Since both  and  belong to  and  is symmetric.

    Finally suppose that  and .

Then both  and  belong to some set  and both  and  belong to some set .

Since  belong to exactly one member of .

Therefore, both  and  belong to  and .

We have shown that  is transitive.                                          ■

 

By definition in order for us to consider a relation to be equivalence is to satisfy the following 3 conditions

1. Must be transitive

 and   


2. Must be Symmetric

  

 

3. Must be reflexive


Theorem  4.8 equivalence relation, partition

 

 

 However, if it breaks any one of these conditions, it will never be equivalent.

Here is a counter example:

 

 

  Example  4.6

  Not an equivalence relation

 The relation  on  defined by  if  is Not an equivalence relation  because

  is not symmetric (      ).

 But this relation  is reflexive and transitive.

 

 

 This example shows that the relation R isn't symmetric. So it isn't equivalence relation.

 

3.5  Matrices of Relations

 

 

In section 3.5 we learned about Matrices of Relations

In short, matrices relations are correlations and relations in entries of matrices. As we learn matrices in high school, this new concept in Discrete Math is not much different from what we had learn before. The whole concept is Matrices and Relations combined within.

 

To define the Matrix Relations

Let X={x1,x2,...,xn} be a finite n-element set and let R be a relation on set X. The Matrix Representation of R on set X is defined to be the n×n matrix where the entries are given.

 

-> Plus, the matrix of a relation R on a set X (from X to X), we use the same ordering for the rows as we do for the columns.s

 

 

 

this example is not symmetric. Because the relation is not on set X or Y, this relation can't be symmetric.

I introduce what is matrix of relation symmetric and also can satisfy reflexive.


X={1,2,3,4,5,6}


R on set X = [(1,1),(1,3),(1,5),(3,1),(3,3),(3,5),(5,1),(5,3),(5,5),(2,2),(2,6),(6,2),(6,6),(4,4)]


[1 0 1 0 1 0]

[0 1 0 0 0 1]

[1 0 1 0 1 0]

[0 0 0 1 0 0]

[1 0 1 0 1 0] 

[0 1 0 0 0 1 ]


The matrix of relation on a set X is square matrix. And this relation R is reflexive because R has (x,x) for all x. In brief,  for all  is reflexive.


Also, It is symmetric because  for all .

 

아마도 R2가 Y to Z의 관계, R1이 X to Y의 관계를 나타낸다고 했을때, R2 o R1을 나타내기 위해서 R1의 matrix of relation인 A1 과 R2의 matrix of relation인 A2를 곱한 행렬인 을 곱하는 방법을 적으시려 했던 것 같습니다.​ 이는 김찬호 학생의 answer에서 나타낸 행렬의 곱셈방법을 이용하면 됩니다. 


https://ko.wikipedia.org/wiki/행렬_곱셈

위 링크에 행렬곱셈 연산에 대한 자세한 설명이 나와있습니다.

(quoted from 김찬호's answer Link:

http://icampus.ac.kr/front/study/QnaAction.do? method=view&lmsBdotSeq=2869551&lmsBlbdId=394928&isRply=Y​) 


Matrix of relation 에서는 1과 0으로 이루어져 있기 때문에 nonzero인 부분만 생각하면 쉽게 계산할 수 있습니다.

 

 

 Theorem  5.6

 

 Let  be a relation from  to   and  be a relation from  to .

 Choose orderings of  and .

  is the matrix of  is the matrix of  with respect to the orderings selected.

The matrix of the relation  with respect to the ordering selected is obtained by   replacing each nonzero term in the matrix product  by .

 

마지막으로 행렬관계에서 transitive가 되는 행렬을 추가로 넣으면서 마무리 하겠습니다.


 

Example  5.7

 

 Matrix of the relation

 on , relative to the ordering  is

.      .

 

 Whenever  is nonzero, then  is nonzero.

                           

 Thus,  is transitive.


In this relation, we can think about transitive.

,   and        : A relation  on a set is transitive.

여기서 행렬의 곱의 특성을 이용하면, 결국 transitive가 되기 위해서는 A( 관계 R의 행렬) 을 스스로 곱하여 nonzeroterm인 부분에서 A의 같은 부분이 nonzero임을 만족하면 transitive가 된다는걸 알 수 있습니다.

 Conclusion

 

 담딘바자르 : ​In my personal experience, I have studied Computer Graphics semesters ago, there were lots of concepts related to Matrix and its relations, now it makes so much sense to what I had learnt in that class. The concepts are getting more related my class, which I am keen for.


김은진 : This chapter we learn about equivalent relation: must be symmetric, transitive, and reflexive. We also learn about matrices of relations. we can see that matrices have relations within one another and we can have a clear visual representation of these numbers. we can also multiply them to find a relation between the two matrices. We can determine if they are symmetric, transitive, or reflexive, or all.

This lesson is helpful because it wraps up chapter 3 where the main focus was functions, sequences, and relations.  We learn about more examples of relations: equivalence and a new way, through matrices.


김도훈 : Among concepts, I was impressed at above concept, because we can show element's relation with matrix, not graph!

With this concept, I think, we can represent lots of another concepts not only in DM, but also computer systems, computer graphics etc. 

 

 

Questioned by 김세진

Answered by 최세현, 김두원

Finalized by 최세현

8.Question about free variable.


Question by 김세진 :

From the text book, it says,

The variable   is a free variable.

(The idea is that ​ is "free" to roam over the domain of discourse.)

The variable  in the universally quantified statement 

 

is a bound variable.(The idea is that ​ is "bound" by the quantifier ∀.)

 

Then how about the variable ​ in the existentially quantified statement 

​ ?

I Think that The symbol  means "for some " so is free to roam over the domain of discourse and thus it is free variable. but after that, textbook says,


A statement with free variables is not a proposition.

A statement with no free variables is a proposition. 

 

and I know that the existentially quantified statement has a truth value and is a proposition. so it should be bound variable for the variable .​

what I misunderstood?

 

Answer by 김두원, 최세현:

If we see the definition 1.5.9

(quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-1-Lab.html)

the P is a propositional function with domain of discourse D.

so ∃x means some x "in the domain of discourse D."

x can not free to roam over the domain of discourse D.

 For example,

There is ​when P(x) = x <0.

If we consider x as free variable and take x = 3,

​is false statement. (3 <0)

But the ​itself is the true statement that "There is negative number."

Thus, we can know that x is dependent variable in ​.

 

 

Questioned by : 김찬호

Answered by : 김도훈, 김두원, 이상구 교수님

Finalized by : 김도훈

 

9.Question : Chapter 3 Example 3.6


 

 Example  3.6

 

 Show that .

 

Solution

Therefore

.

Now

                            .

,    .

Therefore, 

.

Hence, 

Therefore, 

 and        

 

 

Can anyone explain this solution clearly?

I cannot understand well.

in first sentence why lnn instead of lgn? 

 

Answer

--------------------------------- 

It is a typing error!

 

Therefore

 

In Big-O notation, it wrote as log n, so it is a typing error.


+) Usually until high school, log means log with a base of 10.

However, in practice, a log that is generally not underlined means a log with an e (natural constant) at the bottom, such as an ln.

But, In this question, it is a typing error.

 

 

Comment : At first, I just considered between log and ln, but the answer was not about that notation. So, I realized that I have to read solution's process more carefully.

 

 

Questioned by : 김찬호

Answered by : 김도훈, 김두원, 이상구 교수님

Finalized by : 김도훈


10.Question

From the text book, it says,

The variable   is a free variable.

(The idea is that ​ is "free" to roam over the domain of discourse.)

The variable  in the universally quantified statement 

 

is a bound variable.(The idea is that ​ is "bound" by the quantifier ∀.)

Then how about the variable ​ in the existentially quantified statement 

​ ?

I Think that The symbol  means "for some " so is free to roam over the domain of discourse and thus it is free variable. but after that, textbook says,


A statement with free variables is not a proposition.

A statement with no free variables is a proposition. 

 

and I know that the existentially quantified statement has a truth value and is a proposition. so it should be bound variable for the variable .​

what I misunderstood?

 

Answer

 

 Definition  1.5.9

 

Let  be a propositional function with domain of discourse .

 The statement

there exists       

 is an existentially quantified statement.

 The symbol  means “there exists.”

 The symbol  is an existential quantifier of .

If we see the definition 1.5.9

(quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-1-Lab.html)

the P is a propositional function with domain of discourse D.

so ∃x means some x "in the domain of discourse D."

x can not free to roam over the domain of discourse D.


For example, There is ​when P(x) = x <0.

If we consider x as free variable and take x = 3,

​is false statement. (3 <0)

But the ​itself is the true statement that "There is negative number."

Thus, we can know that x is dependent variable in ​.


 

Questioned by 김도훈

Answered by 이상구 교수님

문제를 풀면서 느낀점 comment : 항진명제에 대해 의문점이 들어 질문을 올렸는데 교수님께서 답변을 해주셨다! 수학을 처음 접할 때는 – 특히 이런 명제 파트에서는 – 용어가 항상 어려웠는데 교수님께서 직접 답변을 해주셔서 잊어버리지 않을 것 같다.




 

Questioned by 김도훈

Answered by 강동윤, 최세현, 김은빈

문제를 풀면서 느낀점 comment :  Sequence에 대해 궁금했던 점에 대해 학우들이 친절하게 자신들의 의견을 공유해주었고, 이를 바탕으로 궁금했던 점을 해결할 수 있었다. 집단지성의 중요성을 다시 한 번 깨달았다.


 

Reviewed by 김도훈

Final OK by 이상구 교수님

 

 


문제를 풀면서 느낀점 comment :  수업시간에 행렬을 이용한 관계를 나타낸 모습을 보고 다른 분야에도 이러한 개념을 접목시킬 수 있을 것이고, 이는 정말 대단할 것이라는 글을 게시하였다. 교수님께서 그러한 이유 때문에 행렬을 배운다고 답글을 달아주셨고, 이를 통해 이산수학을 더 열심히 배워야겠다는 다짐을 할 수 있었다!



Question about Theorem 5.6

Solved by 김도훈, Date: 2019.03.18

Finalized by 김도훈, Date: 2019.03.18

       Final OK by SGLee




Problem




Solution


문제를 풀면서 느낀점 comment : 유일함을 증명하기 위해서는 명확한 보여지는 무언가가 필요하다는 사실을 다시 한 번 알 수 있었고, 그러기 위해서는 두 개가 같음을 보이면 된다는 사실 역시 알 수 있었다.


mod vs (negaive) remainder

 

Solved by 김도훈, Date: 2019.03.23

Finalized by 김도훈, Date: 2019.03.24

       Final OK by SGLee



Problem



Solution


문제를 풀면서 느낀점 comment : mod와 remainder의 차이점에 대해서 다른 수업시간(시스템프로그래밍)시간에 간단하게 다룬 적이 있다. 그 때 궁금해서 찾아보았는데, 이번에 Q&A 게시판에 한 학우가 관련해서 글을 적어주었다. 그래서 그 때 찾아본 내용을 상기하여 조금 더 추가하였고, 교수님께 칭찬을 들을 수 있어서 좋았다.





Completeness axiom

Solved by 김도훈, Date: 2019.03.23

Finalized by 김도훈, 채상은, Date: 2019.03.24

       Final OK by SGLee


Solution



문제를 풀면서 느낀점 comment : 고등학교 때 극한과 수열에 대해 배우면서 관련 내용을 잠깐 다룬적이 있다. 그래서 그 때 공부했던 경험을 복기하여 적었고, 다른 학우가 관련 내용을 추가해주면서 finalize가 될 수 있었다. 한 번 읽어보면 좋은 내용이라고 생각한다.





Question about ch 3.3 (ex3.10 & ex3.16)

Solved by 김도훈, Date: 2019.03.25

Finalized by 김도훈, 김찬호, Date: 2019.03.27

       Final OK by SGLee




Problem




Solution


문제를 풀면서 느낀점 comment : 교과서가 잘못되어있었는데, 이를 한 학우가 찾아서 질문하였고 나와 다른 학우가 코멘트를 달아 잘못된 것을 증명하였다. 개념이 무엇보다도 중요하다는 사실을 다시금 깨달을 수 있었던 문제였다.





Question about ch 3

Solved by 김도훈, Date: 2019.03.26

Finalized by 김도훈, Piran Caci, Date: 2019.03.26

       Final OK by SGLee




Problem



Solution



문제를 풀면서 느낀점 comment : 이 문제 역시 고등학교 때 수열부분에서 여러 번 풀어본 문제를 바탕으로 답변을 해주었다. 이러한 꼴의 문제가 많이 나왔기 때문에 비교적 쉽게 풀 수 있었다. 문제를 여러 번 푸는 것도 개념을 이해하는데 도움이 될 것 같았다.

 

Question about antisymmetric(ex3.16)

Solved by 김도훈, Date: 2019.03.25

Finalized by 김도훈, 김찬호, Date: 2019.03.27

       Final OK by SGLee




Problem




Solution



문제를 풀면서 느낀점 comment : 나에게도 어려운 개념이여서 그런지 더 조사를 열심히 해서 답변을 달았던 기억이 난다. 남에게 가르쳐 주면서 배우는 것은 기억에 오래 남는다는 것을 알게 되었다.

 

Question about Section 4.3

Solved by 김도훈, 김두원, 이상구 교수님, Date: 2019.04.03

Finalized by 김도훈, Date: 2019.04.13

       Final OK by SGLee


Problem



Can anyone explain this solution clearly?

I cannot understand well.

in first sentence why lnn instead of lgn?



Solution

It is a typing error!

  Therefore 

In Big-O notation, it wrote as log n, so it is a typing error.


+) Usually until high school, log means log with a base of 10.

However, in practice, a log that is generally not underlined means a log with an e (natural constant) at the bottom, such as an ln.

But, In this question, it is a typing error.


문제를 풀면서 느낀점 comment : At first, I just considered between log and ln, but the answer was not about that notation. So, I realized that I have to read solution's process more carefully.

 

 

Question about prime number

Solved by 김찬호, 김도훈, Date: 2019.04.05

Finalized by 김도훈, Date: 2019.04.13

       Final OK by SGLee


Problem


(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-5-Lab.html Chapter 5.1)



This example says 5 is neither prime nor composite.


I agree with 5 is not composite, but I think 5 is definitely prime!


Since 5 has only two divisors(5 and 1), So 5 must be prime. isn't it?


Is it a typing error? or am I missing something?



Solution

It is a typing error - number 5 is definitely prime number.

 

+) Why 1 is neither prime nor composite?

-> A natural number is called a prime number if it has more than two positive factors, 1 and the number itself. Natural numbers that have more than two positive factors are called composite.

However, 1 has only one positive factor only. Hence 1 is neither prime nor composite. It forms its own special category as a "UNIT".



문제를 풀면서 느낀점 comment : I have to read our textbook carefully - their are some mistakes! And also, I realized that why 1 is neither prime nor composite.



Question about programming language...

Solved by 이상구 교수님, Date: 2019.04.08

Finalized by 김도훈, Date: 2019.04.13

       Final OK by SGLee




Problem


Just a question - a kind of silly question - why we use 'Python' instead of Java, C, C++ etc??

Is it just because easy to explain something or it has lots of built-in functions?

Just curious while I'm studying......





Solution

'Python'  and R is what you need to know for now and the Future^






문제를 풀면서 느낀점 comment : By professor's answer, I decided that remind 'Python', and study hard about contents or grammar which I can't remember.





What does d|n means?

Solved by 담딘바자르, 김도훈, 최세현, Date: 2019.04.08

Finalized by 김도훈, Date: 2019.04.13

       Final OK by SGLee




Problem



I think ∤ should be used to denote d cannot divide n. Am I wrong?




Solution

According to the definition 1.1, it is correct.

 

d|n means d divides n.

dn means d can not divide n. 


However, there are some font problems such as the font looks blurry.

So the questioner was confused about this.





문제를 풀면서 느낀점 comment : I noticed that when we study math, the definition is one of the most important thing. Because this question was solved very easily by using definition!





Checking the prime number

Solved by 김도훈, 담딘바자르, 박재형, 김찬호, Date: 2019.04.08

Finalized by 최세현, Date: 2019.04.08

       Final OK by SGLee




Problem


(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-5-Lab.html)

In this example,

It checks 2017 is prime or not

But It seems like to check if the prime number less than 44 divides 2017..

why it only checks the prime number(2,3,5,7,11....43) divides 2017? not all the integer(2,3,4,5,6,7....44)?? 




Solution

For the number ​n ​to be a prime number,

The number ​n​ must not be divided by all the integers less than √n.

(Since all the number bigger than √n are the pairs of the number less than √n)


But, Since all the integers can be shown as the product(multiply) of the prime numbers,

(for example : 2, 3, 2​2​, 5, 2*3, 7, 2​3​, 3​2​, 2*5 ....)

We just check that all the prime numbers less than √n instead of all the integers ​can divide the number n.





문제를 풀면서 느낀점 comment : 집단지성의 중요성과, 그리고 내가 아는 것을 남들에게 가르쳐주고 나서 고맙다는 말을 들을 때의 희열에 대해 알 수 있게 되었다! 더 열심히 공부해서 남들을 가르쳐주고 싶다는 생각이 많이 들었다!





Question about Algorithms

Solved by 이상구 교수님, 김도훈, Date: 2019.04.10

Finalized by 김도훈, Date: 2019.04.13

       Final OK by SGLee




Problem


I can not solve this problem:


Write an algorithm that returns the sum of the sequence of numbers S1,.....Sn.



Solution

https://www.quora.com/How-do-you-write-an-algorithm-to-find-the-sum-of-the-first-50-numbers

 

How do you write an algorithm to find the sum of the first 50 numbers?


1.)Start

2.)Declare a variable of type int i=0 and sum = 0

3.)Iteration

        for i =0 and i<50 {

                sum = sum + i

                increment i = i + 1

        }

4.)Print Sum

5.)Stop


<C++ Syntax>

#include<iostream.h>

using namespace std

int main() {

        int i=0;

        sum =0;

        for(i=0;i<50;++i) // for loop to iterate upto 50

        {

                sum + = i //sum = sum + i (C++ Shorthands)

        }

        cout<<”Sum of first 50 numbers : “<<sum;

        return 0;

}

As professor give us an algorithm which can return the sum of first 50 numbers.

So by using this, we can return the sum of the sequence of numbers!

We can repeat the sum process for number of elements of sequence.

With C++ syntax we can write as following :


<C++ Syntax>

#include<iostream.h>

using namespace std

int main() {

        int i=0;

        int n ;

        sum =0;

        cout <<"Enter the number of elements : ";

        cin >>n;

        for(i=0; i<n; i++) // for loop to iterate upto 50

        {

                sum + = i  // sum = sum + i (C++ Shorthands)

        }

        cout<<”Sum of sequence : “<<sum;

        return 0;

}


문제를 풀면서 느낀점 comment : 알고리즘을 어떻게 생각하느냐에 따라 여러 가지 방법이 있다는 사실을 알게 되었다. 그래서 교수님이 제시하신 방법 말고도 더 있을 것 같아서 더 찾아보고자 한다.





Why dividing by zero is undefined?

Solved by 감광적, Date: 2019.04.09

Finalized by 김도훈, Date: 2019.04.13

       Final OK by SGLee



Problem


Why dividing by zero is undefined??




Solution

The video may give a clear imputation about why we don't choose 0 as a divisor.

https://www.khanacademy.org/math/algebra/introduction-to-algebra/division-by-zero/v/why-dividing-by-zero-is-undefined

Why dividing by zero is undefined


The problem with dividing zero by zero

Undefined &indeterminate expressions 


Division is an operation calculated as 'repeating subtraction', divided by zero equals counting the number of times minus zero. The problem is that no matter how much you subtract, the value does not change.


The reason why the number cannot be divided into zero is that the number will never change if you exclude it as zero, which is why it will not change because it is the constant source of addition.

 

If you ask the calculator or computer to divide it into zero, send the message "You cannot divide it into zero." If a calculator implements division simply as a 'repeat of subtraction', this task will become an infinite loop and will not end forever, and the same task may not be repeated indefinitely before the calculator will fail. Therefore, before division, make sure that the quantity is zero and if zero, you will immediately output the division by zero or separated by zero error.


Okay, let's accept the fact the x/0=x but accepting it leads to all sorts of contradictions,

Consider V=S/T (Velocity=displacement divided by time) 
say you have to cover 1m in 0 sec,which means in no time,then you ask what is the velocity, according to you it must be 1m/s. Does that make sense?
The contradiction becomes more apparent after you rearrange the equation by solving for time.
T=S/V (Time=displacement/velocity)
Say you have to cover 1 metre,with a velocity of 0m/s,but a velocity of 0m/s means that you are standing still,and if you are standing still how can you cover a given distance?Even if you stand motionless at a fixed point for an eternity you will never be able to cover any given distance,in this case asking the question 'what is the time if the velocity is 0 and distance 1' does not make sense,the solution is not infinity,the solution is not 1,there is no solution.

I guess in this universe dividing by 0 does not make sense but probably in a universe where you could cover distance without moving,it would make sense.




문제를 풀면서 느낀점 comment :  I think this is not sense. I mean, the equation about time, displacement and velocity cannot express that situation. Because physics describes the phenomenon of our lives because the above example is a situation that cannot really happen.






Question about Euclidean Algorithm

Solved by 김도훈, Date: 2019.04.10

Finalized by 김도훈, Date: 2019.04.13

       Final OK by SGLee



Problem


Is this algorithm used when there are more then 2 integers?



Solution

Yes. We can use Euclidean algorithm more than two numbers!

 

According to Wikipedia,

 

One can handle the case of more than two numbers iteratively. 

 

First we show that

 

To prove this let 

By definition of gcd  is a divisor of  and 

Thus  for some 

 

Similarly   is a divisor of  so  for some 

 

Let 

By our construction of  but since  is the greatest divisor  is a unit

And since  the result is proven.

 

So if  then there are  and  such that  so the final equation will be

So then to apply to n numbers we use induction

with the equations following directly. 

 

Therefore, we can use this algorithm more than 2 integers.




문제를 풀면서 느낀점 comment :  I also surprised that Euclidean Algorithm can be used more than 2 integers, and it looks very powerful algorithm I thought!

Euclidean Algorithm Time Complexity

Solved by 한진수, 김도훈, Date: 2019.04.11

Finalized by 김도훈, Date: 2019.04.13

       Final OK by SGLee



Let's assume that n≥​m is not lost to generality. (n = max(n,m))

Then, m≥n%m is clear, considering the n characteristic of the remaining operations.

So get_gcd goes as shown below.

get_gcd(n,m) → get_gcd(n%m,m) → get_gcd(m%m,n%m)

So time complexity can be O(log(max(n,m))) and, it can be O(log(n+m)). 


=====

Add)

 

I take the above mentioned expression 

'get_gcd(n,m) → get_gcd(n%m,m) → get_gcd(m%m,n%m)', 

I will give you a further explanation.


It is clear that the constant number of operations was required until 'get_gcd(m%(n%m), n%m) is called. And let this first sentence.


Next, the maximum value of 'm%(n%m)' or 'n%m' is 'n%m'. And let this second sentence.


In case of n≥​m, n​ >2*(n%m) is formed. And let this third sentence.


Combining first and second sentence means that the maximum value of the two numbers was changed from 'n' to 'n%m' by counting the constant number, which means that the maximum value was less than half by third sentence.

 

This allows you to prove that the time-complexity of the above source is O(log(n,m)). This is because the maximum value was less than half due to the computation of the constant number. Also, if you change it to a simple marker, it becomes an O(log(n+m)).



문제를 풀면서 느낀점 comment : There are few more time-complexities of Euclidean Algorithm, because there are some different expressions that can express Euclidean Algorithm - such as using recursion or iteration etc. So I was impressed that there are many ways to express one algorithm!



Question about chapter 3

Solved by 웅요빈, 김도훈, Date: 2019.04.13

Finalized by 김도훈, Date: 2019.04.13

       Final OK by SGLee



Problem


I want to know exact difference between symmetric and anti-symmetric

It is better to show me some example!



Solution

I think the mathematical concepts of symmetry and anti-symmetry are independent. 

Anti-symmetry is concerned only with the relations between distinct elements within a set, and therefore has nothing to do with reflexive relations​.

For example, consider the equality relation over the set {1, 2}. This relation is symmetric, since it holds that if a = b then b = a. It is also anti-symmetric, since there is no relation between the elements of the set where a and b are not equal where the equality relation still holds. 

 

+) 'Antisymmetric' is not same as 'Not symmetric'. So you should not confuse these concept. You can easily understand by this example 3.15



문제를 풀면서 느낀점 comment :  As I mentioned above, 'Antisymmetric' is not same as 'Not symmetric'. So we should not confuse these concept.



Question about Catalan number

Solved by 김도훈, 최세현, Date: 2019.05.01

Finalized by 김찬호, Date: 2019.05.04

       Final OK by SGLee



Problem


우리가 흔히 catalan number라고 정의하는 수는 다음과 같이 정의 된다. 

 

C​0 ​= 1   C​n​ = ∑(from i = 0 to n) C​i​C​n-i ​ (n≥0)

 

이 점화식을 만족하는 수열의 n 번째 항을 n번째 카탈란 수라고 한다.


이제 카탈란 수의 예제를 들어보겠습니다.

이 예제들의 답은 모두 카탈란 수로 나타내어집니다.

 

(quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html)


Solution

good route: a route that touches but does not go above the diagonal

bad route: a route that goes above the diagonal

We count the number of good routes.

 denote the number of good routes.

 denote the number of bad routes.

Compute the number of bad routes.  in Figure 6.2.5 (b)

 grid : from the lower-left corner to the upper-right corner

                             route.

The number of bad routes is equal to the number of  routes.

             using bijection function on the set of bad routes and the set of ...

Given a bad route

  find the first move that takes it above the diagonal

  replace each right move by up move

  replace each up move by right move

This transformation can also be effected by rotating the portion of the route following the first move above the diagonal above the dashed line.

Each bad route is an  route.

Show that onto function.

Consider  route. Since this route ends above the diagonal, there is a first move where it goes above the diagonal. 

We may then route the remainder of the route above the dashed line to obtain a bad route. The image of this bad route under our function is the  route which we started.

Therefore, our function is onto.

Our function is one-one.

The function transforms distinct bad routes to distinct  route.

Therefore the number of bad routes equals the numbers of  routes.

The numbers of  routes is equal to .

Thus the number of good routes is equal to

              

 

 

출처: https://suhak.tistory.com/77 [수학 이야기] 

 

1. 잘 짜인 괄호

괄호 ()는 열고 닫았을 때, 잘 짜였다고 한다. 예를 들어 (())은 잘 짜인 것이지만 ())(은 잘못 짜인 것이다.  


2. 다각형을 삼각형으로 나누기

n+2개의 변으로 이루어진 볼록다각형을 서로 만나지 않는 대각선을 써서 n개의 삼각형으로 나누는 방법의 수?

 

I want to solve this problem together ! let's discuss about this! 


Solution

1. 잘 짜인 괄호

괄호 ()는 열고 닫았을 때, 잘 짜였다고 한다. 예를 들어 (())은 잘 짜인 것이지만 ())(은 잘못 짜인 것이다. 

n쌍의 ()를 잘 짜인 모양으로 늘어 놓는 방법은 모두 몇 가지가 있을까?


Solution)

이 문제는 Catalan number와 같습니다.

Catalan number를 도출하는 과정에서 n*n의 정사각형에서 (0,0) -> (n,n)으로 가는 y=x를 지나지 않는​ 경로의 수를 구할 때, y=x를 지나지 않는 방법은, 경로를 오른쪽으로 움직이는 R, 위쪽으로 움직이는 U로 볼 때, 순서대로 R이 항상 U의 갯수보다 많거나 같아야 합니다.


이것을 위의 괄호문제에 적용하면 첫번째 괄호부터 순서대로 셋을 때, 항상 여는 괄호 '(' 가 닫는괄호 ')' 보다 많거나 같아야 합니다. 열기전에 닫는 괄호가 나오면 그것은 틀린 모양이 됩니다. 따라서 ( 를 R로 보고, ) 를 U로 봤을 때​ R이 항상 U보다 많거나 같아야 한다는 Catalan number의 규칙과 똑같기 때문에 답은 Catalan number인 ​​C​n​입니다.

------------------------------------------------------------------------

1. 잘 짜인 괄호

괄호 ()는 열고 닫았을 때, 잘 짜였다고 한다. 예를 들어 (())은 잘 짜인 것이지만 ())(은 잘못 짜인 것이다. 


sol) Re-interpreting the symbol X as an open parenthesis and Y as a close parenthesis, Cn counts the number of expressions containing n pairs of parentheses which are correctly matched:


((()))     ()(())     ()()()     (())()     (()())


 

2. 다각형을 삼각형으로 나누기

n+2개의 변으로 이루어진 볼록다각형을 서로 만나지 않는 대각선을 써서 n개의 삼각형으로 나누는 방법의 수?

 

sol) A convex polygon with n + 2 sides can be cut into trianglesby connecting vertices with non-crossing line segments (a form of polygon triangulation). The number of triangles formed is n and the number of different ways that this can be achieved is Cn. The following hexagons illustrate the case n = 4:



wikipedia를 참고하였습니다.




문제를 풀면서 느낀점 comment :  catalan number를 이용하여 문제를 풀 수 있는 경우에 대해서 정리하여 게시물을 작성한 적이 있었는데, 이와 비슷한 경우여서 재밌게 풀었던 것 같다!



 





 

Comments :작년 1학년 2학기때 소프트웨어 전공수업인 자료구조 개론을 들으면서 Sorting Algorithm에 대해 자세히  배운적이 있다. 그리고 이번 학기인 2학년 1학기 이상구 교수님 이산수학을 들으면서 Sorting Algorithm에 대해 다시 배웠다. 하지만  이산수학만으로는 Sorting Algorithm을 자세히 파헤치기는 학생들로 하여금 어렵지 않을까 라는 생각이 들었다. 그래서 이산수학을  수강하는 학우들께 내가 작년에 배운 지식을 정리하고 공유하여 여러 학우들로 하여금 조금더 깊게 이산수학의 Algorithm Chpater에 대한  내용을 같이 이해했으면 한다. 따라서 많고도 많은 Sorting Algorithm중 많이 쓰이고 중요한 Sorting 종류만 C코드와  Algorithm에 대한 설명을 적어 학우들과 공유하고자 Q&A에 Finalized해서 글을 올린다.

 

 

Question about chapter 6

Solved by SIMEN, 김도훈, Date: 2019.05.01

Finalized by 김도훈, Date: 2019.05.01

       Final OK by SGLee



Problem


Exercise 6.2.5 and 6.2.6, page 331


5. How many 3-combinations are there of six objects?

​P(6, 3) = 6!/(6-3)! = 6!/3! = 120 


6. How many strings can be formed by ordering the letters ABCDEF, if A appears before C and E appears before C?

 

Both A and E needs to appear before C in the strings.

Let's consider putting A as the first element: 5!*(1/2) = 60 strings where E appears before C.

Second: ​5!*(1/2) = 60 (E in appears before C in half of the 5! strings)

 

Third: ​5!*(1/2)*(3/5) = 4!*(3/2) = 36 (--A---, C has to be one of the three last elements and has to come after E)

 

Fourth: 1 (---AEC is the only valid string)

Fifth: 0

Sixth: 0

 

All in all: 60 + 60 + 36 + 1 = 157 valid strings

 

Not entirely sure about the last exercise, maybe somebody has another solution?​ 



Solution

+) Let's ​consider there is 6 blanks, and we have to fill it with A~F.

Then A, C, and E as a one string as C.

Then we have to fill it first with these 4 strings.

We know that C cannot position at both first and second blank - because A and E have to position in front of C.

So, we have to consider when C is located at third to sixth blank.

 

i) When C is located at third blank

front of C : 2!

back of C : 3!

-> 2! * 3! = 12

 

ii) When C is located at fourth blank

front of C : 3! * 3C1 = 18

back of C : 2! = 2 (because we already choose one string which position in front of C)

-> 18 * 2 = 36

 

iii) When C is located at fifth blank

front of C : 4! * 3C2 = 72

back of C : 1! = 1

-> 72

 

iv) When C is located at sixth blank

front of C : 5! = 120

back of C : 0

-> 120

 

So, 12 + 36 + 72 + 120 = 240

 

I think its answer is 240. 




+Another solution) - I recommend this solution

Let's consider A, C, and E as a one string.​

Then we can treat these strings ordering as a permutation with same elements (같은 것이 있는 순열) -> 6!/3! = 120

We can change A and E's position -> 2

So the answer of this question is 120 * 2 = 240


문제를 풀면서 느낀점 comment :  두 가지 풀이방법을 제시해주었다. 이 당시에는 같은 것이 있는 순열을 막 배웠을 때라 문제에 적용하기 쉽지 않았을 때라고 생각한다. 하지만, 이를 이용한다면 쉽게 문제를 해결할 수 있었다.








Page 288 Problem 7, 8

Solved by 김도훈, Date: 2019.05.02

Finalized by 감광적, Date: 2019.05.03

Added by 김찬호, Date: 2019.05.03

Finalized by 감광적, Date: 2019.05.10

       Final OK by SGLee



Problem


In how many ways can we select a chairperson, vice-chairperson, and recorder from a group of 11 persons?



Solution

First, let's think about how to select chairperson. 

We can choose chairperson among 11 persons. -> 11

Next, we can choose vice-chairperson among 10 persons. Because we already select chairperson! -> 10

Then, we can choose recorder among 9 persons. -> 9

 

So, the answer is 11*10*9 = 990

 

Or, we can use this -> P(11, 3) = 990


Answer

We have 990 ways to select a chairperson, vice-chairperson, and recorder from a group of 11 persons.


Comment

It's a good example by applying Theorem 2.10 

 

//quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html


Problem


#8. In how many ways can we select a chairperson, vice-chairperson, secretary, and treasurer from a group of 12 persons?


Solution

Also, we want to select four persons among 12 persons.

So, the answer is P(12, 4) = 11880

 

//we can choose chair person in 12.

 and after choice chair person, there is 11 person left.

 so we can choose vice- chairperson in 11.

 same reason

 we can make all case in 12*11*10*9.

 this is ​12​P​4​ (choose 4 in 12 that there is a order)


Answer

We can know that their are many possibilities although we want to choose only 4 persons among 12 persons!


Comment

​It's another application in Theorem 2.10, p(n,r)=n! / (n-r)!




문제를 풀면서 느낀점 comment :  크게 의미를 가지지 않는 문제였는데, 학생들이 내 풀이에 대해서 코멘트를 많이 해주었다! 이러한 피드백을 통해 더 좋은 결과가 나올 수 있는 것 같다.




Ch 6.2 problem 60 (p.289)

Solved by 강동윤, Date: 2019.05.03

Finalized by 김도훈, Date: 2019.05.05

       Final OK by SGLee



Problem


How many outcomes are possible? (An outcome is a list of 10 H's and T's that gives the result of each of 10 tosses. For example, the outcome [H H T H T H H H T H] represents 10 tosses, where a head was obtained on the first two tosses, a tail was obtained on the third toss, a head was obtained on the fourth toss, etc.) 



Solution

For each flip, there's two possible cases. H(Head) or T(Tail).

We will do 10 tosses, so we have to multiply 2 by number of tosses.

So there's 2^10 = 1024 possible cases. 

 

We can refer to Ex. 1.5



문제를 풀면서 느낀점 comment :  문제 위치 수정, 문제 자세한 내용 추가, 설명 부분 추가하였습니다. 또 교수님이 올려주신 수업자료에서 비슷한 문제를 찾아 링크하였습니다.



 


Ch 6.2 problem 61 (p.289)

Solved by 강동윤, Date: 2019.05.03

Finalized by 김도훈, Date: 2019.05.05

       Final OK by SGLee



Problem


A coin is flipped 10 times. How many outcomes have exactly three heads?



Solution

We can consider this problem as a problem of selecting H's position - 3 positions.

Because, when we choose 3 positions, and the other 7 positions will become T.

So, we can only think about the H's position.


C(10, 3) = 10! / (3!)*(7!) = 10 x 9 x 8 / (3 x 2 x 1)​ = 120 

 

There's 120 outcomes which has exactly 3 heads 

 

 

Please refer to the following :



문제를 풀면서 느낀점 comment :  문제 위치 수정, 문제 자세한 내용 추가, 설명 부분 추가하였습니다. 또 교수님이 올려주신 수업자료에서 비슷한 문제를 찾아 링크하였습니다.





Ch 6.2 problem 62 (p.289)

Solved by 강동윤, Date: 2019.05.03

Finalized by 김도훈, Date: 2019.05.05

       Final OK by SGLee



Problem


A coin is flipped 10 times. How many outcomes have at most three heads? 



Solution

We can consider this problem as a problem of picking position of H.

But in question, it said 'at most', so we have to consider whether count of head can be 0, 1, 2 or 3.

 

If count of head is different, outcome cannot overlap. So we don't need to subtract duplicated cases (Inclusion exclusion principle).

 

The Inclusion-Exclusion Principle generalizes the Addition Principle by giving a formula to compute the number of elements in a union.

      

 

Figure 1.13  counts the number of elements in  and , and  counts the number of elements in  and .

Since  double-counts the elements in  

 

 

So the answer is, C(10, 0)​​ + C(10, 1)​​​ + C(10, 2)​​​ + C(10, 3) = 1 + 10 + 45 + 120 = 176​


문제를 풀면서 느낀점 comment :  문제 위치 수정, 문제 자세한 내용 추가, 설명 부분 추가하였습니다. 또 교수님이 올려주신 수업자료에서 비슷한 문제를 찾아 링크하였습니다.




Ch 6.2 problem 63 (p.289)

Solved by 김도훈, Date: 2019.05.05

Finalized by 담딘바자르, Date: 2019.05.10

       Final OK by SGLee



Problem


A coin is flipped 10 times. How many outcomes have a head on the fifth toss?



Solution

As we must have a head on the fifth toss, so the position of H of fifth is fixed.

So we only have to consider about first - fourth, sixth - tenth.

Therefore, the answer is 2^9 = 512

 

We can refer to Ex. 1.5



문제를 풀면서 느낀점 comment :  This problem highlights the middle school probability problems, which should be easy for us in my opinion. Updated the format and layout.




Ch 6.2 problem 64 (p.289)

Solved by 김도훈, Date: 2019.05.05

Finalized by 담딘바자르, Date: 2019.05.10

       Final OK by SGLee



Problem


A coin is flipped 10 times. How many outcomes have as many heads as tails?



Solution

As we must have a same count of head and tails, we have to consider when their count is same. Let count of head as x, and count of tail as y. Then x+y = 10, and x=y. So, the answer is x=y=5.

By this conclusion, we can find out that we have to find the position of 5 H's.

C(10, 5) = 10! / 5!*5! = 252


문제를 풀면서 느낀점 comment :  This problem highlights the middle school probability problems, which should be easy for us in my opinion. 10 times are reduced by 1 in each flip. The probability of both head and tail in half in 10 times are 5 and 5 respectively. Updated the format and layout. 





Ch 6.3 problem 4 (p.298)

Solved by 최세현, Date: 2019.05.06

Finalized by 김도훈, Date: 2019.05.06

Re-Finalized by 담딘바자르, Date: 2019.05.10

       Final OK by SGLee



Problem


How many strings can be formed by ordering the letters

SALESPERSONS if the four S’s must be consecutive?



Solution

If four S's must be consecutive, We can regard the four S as one S.

It will not matter the solution of problem.

 

So, there are S, A, L, E, E, P, R, O, N.

(9 letters ==> 8 different letters and two E.)

 

Thus, the answer will be 9! / 2. (Dividing by 2 will remove the duplicated cases which occurred by two E) 

 

// S는 연이여 있어야 함으로 하나로 간주해도 무방합니다.

S뿐만 아니라 E라는 중복된 문자가 있기 때문에 중복 순열을 푸는 방법으로 풀면 될 것 같습니다.

따라서 9개의 문자를 나열하는 방법인 9! 에서 중복된 문자열을 배열하는 순서인 2!으로 나눠주면됩니다.

사실 이 문제는 Ch.6.3의 Exercise입니다. ㅎㅎ 


문제를 풀면서 느낀점 comment :  ​What we have consider in this question is, in my opinion, we must notice that there are 2 Es and consecutive S. Updated the layout. 






Ch 6.2 problem 33

Solved by 에인젤피트리사리, Date: 2019.05.07

Finalized by 김도훈, Date: 2019.05.07

       Final OK by SGLee



Problem


In how many ways can we select a committee of five persons?



Solution

Original Answer by​ 에인젤피트리사리

 

These are the possibilities:

1.       5 men and 0 women

2.       4 men and 1 women

3.       3 men and 2 women

Therefore, we could calculate it as,

5 men and 0 women = 6C= 6!/(6-5)!5! = 6 ways

4 men and 1 women = 6C4 * 7C= 6!/(6-4)!4! * 7!/(7-1)!1! = 105 ways

3 men and 2 women = 6C3 * 7C2 = 6!/(6-3)!3! * 7!/(7-2)!2! = 420 ways

In conclusion, the total number of ways will be = 6 + 105 + 420 = 531 ways of selecting a committee of five persons. 

 

에인젤피트리사리's answer is super impressive but I hold a different idea about this question. Firstly​, I think that the description of "six distinct men and seven distinct women" is kind of weird because I believe every individual is unique. It's a little bit wandering of the point so let's go back to the problem. Therefore, I think we should consider it as 6+7 = 13 distinct people. Hence, the answer should be computed by applying the formula (No repetitions, Unordered Selections), that is C(13,5)= 13!/(13-5)!5!=1287.

 

And I don't know whether my idea is right so if you guys have the different ideas about this problem, leave a comment, please.  

 

// I agree with your opinion.

It is right to use C(13, 5) because question does not provide the number of men or women, it just say choose the five persons.

So, I think your solution will be the answer of this question.


문제를 풀면서 느낀점 comment :  ​문제 해석에서의 차이가 생각보다 크다는 사실을 알 수 있게 되었다. 아마 문제 해석 방식의 차이로 인해 발생한 문제 같았다.

 

 

Ch 6.7 problem 4 (p.364)

Solved by 감광적, Date: 2019.05.08

Finalized by 김도훈, Date: 2019.05.09

       Final OK by SGLee



Problem


Find the coefficient of the term when the expression is expanded.

s6t6; (2s-t)​12



Solution

Solution 1 )

Apply the Binomial theorem, the coefficient is C(12,6)(2)6(-1)6=59136

 

Solution 2 )

S : we have to choose six Ss from twelve letters, so there will be C(12, 6)

T : we have to choose six Ts from six letters, it will be 1.

However, there are 2 in front of s, -1 in front of t, so we also have to calculate 2​and (-1)6

So the answer is 59136

 

Answer

The coefficient is 59136

 

Comment

Compare the expression (2s-t)12 with (a+b)n. Then, we can derive that a=2s, b=-t, and n=12. And then apply the Binomial Theorem to calculate the coefficient.  


문제를 풀면서 느낀점 comment :  이항정리를 사용하여 방정식의 계수를 구할 수 있다는 사실을 알 수 있었다. 방정식의 계수를 빠르게 구할 수 있는 것 같아 좋은 것 같다.





Ch 6.7 problem 5 (p.364)

 

Solved by 감광적, Date: 2019.05.08

Finalized by 김도훈, Date: 2019.05.09

       Final OK by SGLee



Problem


Find the coefficient of the term when the expression is expanded.


x2y3z5; (x+y+z)10


Solution

1.      X choose form 2 of the 10 items,

2.      Y choose from 3 of the 8 items,

3.      Z choose from 5 of the 5 items,

 

Choose two items for x in C(10,2) ways.

Choose two items for y in C(8,3) ways.

Choose two items for z in C(5,5) ways.

 

The coefficient is C(10,2) C(8,3) C(5,5)=2520

 

// x는 총 10개의 문자중에서 두 번 선택되어 제곱의 꼴로 나타난 것입니다. 그래서 C(10, 2)로 나타나집니다.

y는 x를 선택하고 남은 8개의 문자중에서 세제곱을 나타내기 위해 3개를 선택하는 경우입니다. 그래서 C(8, 3)로 나타나집니다.

z는 x와 y를 선택하고 남은 모든 문자들을 선택해야합니다. 그래서 계산에 포함되어도, 포함되지 않아도 상관없습니다. 경우는 1가지 밖에 존재하지 않습니다.

따라서 이들의 곱을 구하면 2520이 되고, 이는 정답입니다.

 

Answer

The coefficient is 2520 


문제를 풀면서 느낀점 comment :  조합을 이용하여 방정식의 계수도 구할 수 있다는 사실이 신기했습니다.






Ch 6.7 problem 15 (p.364)

Solved by 감광적, Date: 2019.05.08

Finalized by 김도훈, Date: 2019.05.08

       Final OK by SGLee



Problem


Use the Binomial Theorem to show that


Solution

Set a = 1 and b = -1 in the Binomial Theorem.

Then, it goes like this:


And it is proved!

 

In this solution, we have to set a and b properly 

Answer

The coefficient is 2520 


문제를 풀면서 느낀점 comment :  순열과 조합 파트에서도 식들을 증명할 수 있다는 사실에 대해 뿌듯함을 느꼈습니다.



Ch 6.7 problem 13 (p.364)

Solved by 감광적, Date: 2019.05.08

Finalized by 김도훈, Date: 2019.05.08

       Final OK by SGLee



Problem


Find the next row of Pascal’s triangle given the row

1 7 21 35 35 21 7 1


Solution

Pascal's triangle is a triangular way of the binomial coefficients. So the problem wants to ask us that whether we know about binomial coefficients. 

 

As problem gave us 8th line, so we need to solve a 9th line.

 

a9,1 = C(8, 0) = 1​

a9,2 = C(8, 1) = 8

a9,3 = C(8, 2) = 28

a9,4 = C(8, 3) = 56

a9,5 = C(8, 4) = 70

a9,6 = C(8, 5) = 56

a9,7 = C(8, 6) = 28

a9,8 = C(8, 7) = 8

a9,9 = C(8, 8) = 1


So the answer is 1 8 28 56 70 56 28 8 1.​

 

Every value in the interior triangle is the sum of the two numbers above it, so the numbers in the interior are 8, 28, 56, 70, 56, 28, and 8.

      Finally, add the two 1 at the both sides of the border.

 

  1  7  21  35  35  21  7  1

1  8  28  56 70  56  28 8 1.

 

Therefore, the next row is 1  8  28  56 70  56  28 8 1.



문제를 풀면서 느낀점 comment :  He's solution was great, but it is not appropriate to this chapter. However that solution was also creative!

Ch 6.8 problem 6 (p.368)

Solved by 감광적, Date: 2019.05.08

Finalized by 김도훈, Date: 2019.05.08

       Final OK by SGLee



Problem


Suppose that six distinct integers are selected from the set {1,2,3,4,5,6,7,8,9,10}. Prove that at least two of the six have a sum equal to 11.


Solution

At first, we assume the set {1,2,3,4,5,6,7,8,9,10} to be the pigeon and then, we randomly choose 6 distinct integers.

In problem, we have to prove that at least two of the six integer have a sum equal to 11. Then, we have to find out which numbers can be 11.

{1,10}, {2,9​​}, {3,8}, {4,7}, {5,6} - these pairs sum can be 11,​ and let them as pigeonholes.

 

As we shown, the sum of each pair is 11 and the number of such pairs is 5.

 

 (Observe: We now have only 5 pigeonholes and have to assign 6 pigeons in them.)

Hence, when we choose 6 numbers from {1,2,3,4,5,6,7,8,9,10}, there are 5 numbers that should come from the numbers in the above pairs.

​  (We may choose 1, 2, 3, 4, 5  and choose one more)

   And, there is one more number that must be chosen among the remaining 5 numbers put into one of the other pairs  <그리고  하나를 더 골라야 한다.>

// 최상의 경우는 5개의 쌍에서 2개의 숫자를 선택하여 11을 만드는 경우입니다.

하지만 최악의 경우 5개의 각각 다른 쌍에서 5개의 숫자를 선택할 수 있습니다.

그럼에도 불구하고 마지막 6번째 숫자는 이미 선택한 쌍에서 남은 수를 하나 뽑아야합니다.

 So​  when we choose 6 numbers from {1,2,3,4,5,6,7,8,9,10}, then two of them must be formed to be same as one the following set {1,10}, {2,9​​}, {3,8}, {4,7}, {5,6}.

그래서 이는 비둘기집의 원리에 의해 항상 11이 완성됩니다.


문제를 풀면서 느낀점 comment :  비둘기집의 원리는 항상 흥미로운 주제라고 생각합니다. 이렇게 문제에 적용되니 더욱 신선했습니다.

 

 

Ch 6.2 problem 2 (p.293)

Solved by 김세진, Date: 2019.05.10

Finalized by 김도훈, Date: 2019.05.10

       Final OK by SGLee



Problem


2. Divide the routes into classes based on when the route crosses the slanted line shown.

Use the Addition Principle to derive a formula like that proved in this section. (The routes are from the lower-left corner to the upper-right corner of an m x n grid and those are restricted to traveling only to the right or upward) ​


Solution

If we divide the routes into classes based on when the route crosses the slanted line as shown, we can see this classes are disjoint since a route cannot cross two or more point where the slanted line meets the grid.

 

And because the route must pass this slanted line, every route will be in some class.

 

Therefore the classes partition the set of routes,

and the sum of the numbers of routes in each class will be equal to the total number of routes.


Now we first think of 4 x 5 grid as shown,

 

And divide the routes into classes crossing the point 1~5.

 

For the classes crossing the point 1 : 

There is only one route, in string notation, U U U U R R R R R .

Thus the number of routes is C(4,0) * C(5,5) = 1 .

 

For the point 2 :

It is same as the combination of 3 x 1 grid and 1 x 4 grid.

Because it is constructed in a successive steps, by multiplication principle,

we should count all routes for each grids and multiply it.

Then the number of routes is C(4,1) * C(5,4) = 20 .

 

In the same way, we can derive;

 

Point 3 : C(4,2) * C(5,3) = 60

Point 4 : C(4,3) * C(5,2) = 40

Point 5 : C(4,4) * C(5,1) = 5

 

Therefore the total number of routes for 4 x 5 grid is 1+20+60+40+5=126 .

which is same as C(4+5,4) = 126 as it should be.

 

Now generalize this result for m x n grid.

 

We can see there will be m+1 point where grid meets the slanted line,

so we must divide the routes into m+1 classes.


And the numbers of routes for each classes will be;


C(m,0) * C(n,n) , C(m,1) * C(n,n-1), C(m,2)*C(n,n-2), ... , C(m,m)*C(n,n-m)

 

The sum of these will be equal to the total number of routes C(m+n,n) .

 

Thus we can derive the formula :


(k=0 to m) [C(m,k) * C(n,n-k)] = C(m+n,m) . 

 

// 결국에는 경로는 위의 그림에서 대각선으로 그었을 때, 교점들을 한 곳을 무조건 지나가야 한다는 것을 알 수 있다. 따라서 경로를 구하기 위해서는 각각의 교점들까지의 경우수를 확인하고, 이들을 다 더하면 구할 수 있다.

그래서 각각 점들에 대해 위에서 경우의 수을 구했다. 그리고 이들을 일반화했다.

mxn의 경우에 대해서 각각의 점에 대해 경우의 수가 나와있고, 이들을 다 더한 값이 결국에는 경로의 경우의 수가 된다.


따라서 일반화를 할 경우 다음과 같은 식이 도출된다.


문제를 풀면서 느낀점 comment :  단계별로 잘 설명해주셔서 보다 쉽게 이해할 수 있었습니다. 또한, 경로의 경우의 수를 하나의 식으로 구할 수 있다는 사실이 매우 신기했습니다.






Ch 6.3 problem 48 (p.299)

Solved by 김세진, Date: 2019.05.10

Finalized by 김도훈, Date: 2019.05.10

       Final OK by SGLee



Problem


48. Use Example 6.3.9 to prove the formula


C(k-1,k-1) + C(k,k-1) + ... + C(n+k-2,k-1) = C(k+n-1,k) .


Solution

From the example 6.3.9 :

 

 

 

This is same as selecting an unordered k-elements 

from the set which containing n elements, 

with repetitions allowed.

 

Now we look this algorithm in detail :

 

If we let i1 = 1, then i1 = 1 ≥​ i2 ≥​ i3 ≥​ ... ≥​ ik ≥​ 1.

Then the number of possible output is just 1.

 

If we let i1=2,  then 2 ≥​ i2 ≥​ i3 ≥​ ... ≥​ ik ≥​ 1.​

This is same as the number of unordered, (k-1)-element selections 

from a set containing 2 elements.

Thus the number of output is C(2+(k-1)-1, k-1) = C(k,k-1) .

 

In the same way,

 

For i1=3, C(3+(k-1)-1, k-1) = C(k+1,k-1),

...

For i1=n, C(n+(k-1)-1, k-1) = C(n+k-2,k-1)

 

By summing this cases, we can derive the expecting formula;

 

C(k-1,k-1) + C(k,k-1) + C(k+1, k-1) + ... + C(n+k-2,k-1) = C(k+n-1,k) .​

 

And we can see this result corresponds with the Eq. 6.7.4 (page 323) ;

 

∑​(i=k to n)C(i, k) = C(n+1, k+1) . 

 

// 앞서서 주어진 식을 이용하여 식을 풀면 된다. i1이 무엇인지에 따라 각각의 식을 계산하고, 이 계산식의 가능한 경우의 수를 구하기 위해 조합을 사용한다. 그래서 이들을 다 더하면 우리가 원하는 식이 나오고, 곧 뒤쪽 단원의 주어지는 식에 해당한다.


문제를 풀면서 느낀점 comment :  이 식이 중요하다고 생각했었는데 이렇게 알고리즘을 이용하여 쉽게 만들 수 있다는 사실이 매우 신기했다.






Ch 6.7 problem 27 (p.325)

Solved by 김세진, Date: 2019.05.10

Finalized by 김도훈, Date: 2019.05.10

       Final OK by SGLee



Problem


27. Give a combinatorial argument to prove that


∑(k=0 to n) C(n,k)2 = C(2n, n) .



Solution

We can think of C(2n, n) as making 2n-string which consists of n-A's and n-B's as shown,

So first choosing n spaces to place A and the left will be filled by B.​

 

But this can be executed in a different way.

 

First we divide the string to 2 sector with each of length n.


 

Now if we place the A's, there will be k-A's in the first sector and (n-k) in the second,

and the left space will be filled by B. Here k will varies over 0 to n.

 

Thus the number of arrangement for the first sector is C(n,k) 

and second is C(n,n-k) = C(n,k).

Since this to steps are successive, by applying the multiplication principle,

The total number of arrangement will be C(n,k)*C(n,n-k) = C(n,k)2

 

∴  ∑(k=0 to n) C(n,k)2 = C(2n, n)​.

 

* First I tried to prove this by using the equations ( i.e. C(n,k) = n! / k!(n-k)! ),

  but I failed to do this. Does anyone can prove this in equation? 

 

Write D=d/dx D=d/dx. From the Leibniz rule, we have

(2n)!n!=Dnx2n|x=1=Dn(xnxn)|x=1=k=0n(nk)(Dkxn)(Dnkxn)|x=1=k=0n(nk)n!(nk)!n!k!.

 

Then the identity follows by dividing both sides by nand simplifying it.


문제를 풀면서 느낀점 comment :  새로운 방식으로 증명하는 법에 대해서 알 수 있었다. 배열로 접근하는 방법은 신선했다.







Ch 6.8 problem 33 (p.329)

Solved by 김세진, Date: 2019.05.10

Finalized by 김도훈, Date: 2019.05.10

       Final OK by SGLee



Problem


33. Let f​ be a one-to-one function from X = {1, 2, ..., n} onto X.


Let f​k = f​ ◌​ f​​ ◌​ ... ◌​ f​  denote the k-fold composition of f with itself.


Show that there are distinct positive integers i and j such that


fi(x) = f​j(x) for all x ∈​ X​.


Show that for some positive integer k, ​f​k(x) = x for all x ∈​ X​.​



Solution

Because the function is bijective, fi(x)​ will have some values between [1,n]

Then we can think of this as a pigeonhole problem.


​Assume that ¬​( ∃​i ∃​j ​fi(x) = f​j(x)​ )​ = ∀i ∀​j ​fi(x) ≠​ f​j(x)​ for all x ∈​ X​,

then every ​fi(x)'s must have a distinct values between [1,n].


​​But if we let the integer i greater than n, than the number of the set of fi(x)'s

( let |X| ) become greater than the number of the set of the variables ( let |Y| ).

→​ |X| = i > |Y| = n .


Thus by the pigeonhole principle (second form),


∃​i ∃​j (i≠​j) ​fi(x) = f​j(x)​​ for all x ∈​ X​​ .


Express in figure;


If we define f​0(x) = x​, and expand the i, j to be a nonnegative integer,

Then we can use the above result to verify


∃​k (k≠​0)​ f​k(x) = f​0(x)​ for all x ∈​ X​.​​


 

// 비둘기집의 원리를 이용하여 증명을 하는 문제이다.

보통 비둘기집의 원리를 이용하여 간단한 문제를 증명한다고 생각했는데, 약간 일반화 되어있는 식을 증명할 수 있었다는 사실이 매우 신기했다.

증명 과정에 대해서는 이미 처음으로 작성한 학우분이 잘 해주셔서 딱히 추가해서 얘기할 것은 없을 것 같다.


문제를 풀면서 느낀점 comment :  비둘기집의 원리는 항상 흥미로운 주제라고 생각합니다. 이렇게 문제에 적용되니 더욱 신선했습니다.







Ch 6.7 problem 1 (p.324)

Solved by 김도훈, Date: 2019.05.11

Finalized by 박재형, Date: 2019.05.12

Re-Finalized by 김도훈, Date: 2019.05.15

       Final OK by SGLee



Problem


Expand (x+y)​using that Binomial Theorem.



Solution

​So, when we using the Binomial Theorem, given equation will be change to the following equation :

 

(x+y)4 = C(4, 0)x4y0 + C(4, 1)x3y1 + C(4, 2)x2y2 + C(4, 3)x1y3 + C(4, 4)x0y4

x4​ + 4x3y + 6x2y2 + 4xy3 + y4


So the answer is x4​ + 4x3y + 6x2y2 + 4xy3 + y4​  ■



Comment by 김도훈:

이 문제를 풀기위해서는 개념을 알아야 풀 수 있다.

위 문제에서 사용된 개념은 다음과 같다.



 

 

comment by 박재형:

(a+b)​n​ 에서 곱셈은 두개의 a,b 숫자중에서 총 n개를 고르는 것이기 때문에 a​n-k​b​k​로 나타 낼 수 있으며, 고른 n개중 k개인 b의 순서를 결정하는 방법으로 C(n,k)를 쓸 수 있습니다. 이렇게 시그마와 조합으로 표현이 가능하다는 것을 알 수 있었습니다. 


문제를 풀면서 느낀점 comment :  조교님의 피드백을 통해 QED를 붙여야한다는 사실을 알 수 있었습니다.

 

 

 

Ch 6.7 problem 6 (p.324)

Solved by 김도훈, Date: 2019.05.11.  Finalized by 박재형, :

 Re-Finalized by 김도훈, Date: 2019.05.15   Final OK by SGLee


Problem

Find the coefficient of the term when the expression is expanded.

w2x3y2z5; (2w+x+3y+z)12



Solution By using the Binomial theorem, the coefficient is 

{C(12,2)*(2)2}{C(10,3)*(1)3}{C(7,2)*(3)2}{C(5,5)*(1)5

= C(12,2) * 4 * C (10,3) * C(7,2) * 9 * C(5.5)

= 66 * 4 * 120 * 21 * 9 * 1 

= 5,987,520 ■

                       So the answer is 5,987,520

 

Comment by 김도훈: 

보다 복잡한 방정식의 꼴도, 이항정리를 사용하여 계수를 구할 수 있다는 사실을 알 수 있었다. 방정식의 계수를 빠르게 구할 수 있는 것 같아 좋은 것 같다.   

 

comment by 박재형:

 

(2w+x+3y+z)12​ 은 기존 2개의 항이 아닌 4개의 항을 가지고있다. .​

quote : http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html

 

이 식에서 유추해보면 a는 n개중에서 n-k개를 가지고 있으므로 C(n,n-k)를 얻고, b는 남은 k개에서 k개를 고르는 수이므로 C(k,k) = 1 이다.

 

위의 식을 가지고 변형하여 문제를 풀어보면,

w2x3y2z5​의 계수는 C(12,2) * 4 * C (10,3) * C(7,2) * 9 * C(5.5) 임을 알 수 있다.

66 * 4 * 120 * 21 * 9 * 1 = 5,987,520

 답은 5,987,520 이다.

 김도훈 학생은 덧셈으로 풀었지만, 계수를 구할때는 같은 시간 선상에 있다고 보고 곱해야 맞는 답이다. 

문제를 풀면서 느낀점 comment :  곱셈으로 식을 세우고 덧셈을 해버렸는데, 다행히도 박재형 학생이 내 오류를 찾아 고쳐주었다. 감사하다. 또한, 조교님의 피드백을 통해 풀이과정을 보인후, QED를 붙여주었다.



Ch 6.7 problem 6 (p.324)

Solved by 김도훈, Date: 2019.05.11

Finalized by 박재형, Date: 2019.05.12

       Final OK by SGLee



Problem


Find the coefficient of the term when the expression is expanded.

a2x3; (a+x+c)2(a+x+d)3

 

I don't know how to solve this problem...

Does anyone who can help me?

I tried to solve it with binomial expansion. 



Solution

To get coefficient of a2x3​,  의 계수를 구하기 위해서는 a should be selected 2 times and x 3 times.

From (a+x+c)​2​, there are some cases as following : [a - 1 time, x - 1 time], [a - 2 times, x - 0], [a - 0. x - 2 times]

From (a+x+d)​3, there are some cases as following : [a - 1 time, x - 2 times], [a - 0, x - 3 times], [a - 2 times, x - 1 time] -> and we should find coefficients of these cases.

 

C(2,1) * C(3,1) = 6

 

C(2,2) * C(3,0) * C(3,3) = 1


C(2,0) * C(2,2) * C(3,2) = 3


So, the answer is 6 + 1 + 3 = 10.  


문제를 풀면서 느낀점 comment :  ​문제를 풀다가 한 부분에서 막혔는데 박재형 학생의 도움으로 해당 문제를 잘 풀 수 있었다.





Ch 6.3 problem 31 (p.338)

Solved by 그르크차리예브쇼흐차헌, Date: 2019.05.12

Finalized by 김도훈, Date: 2019.05.13

       Final OK by SGLee



Problem


​How many integers between 1 and 1.000.000 have the sum of the digits equal to 15?



Solution

Here’s some code to solve it that will work in SQL Server:

1.

1. ;WITH X(N) AS (SELECT * FROM (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) X(N))SELECT *, CONCAT(A.N,B.N,C.N,D.N,E.N,F.N) NumberFROM X A,X B,X C,X D,X E,X FWHERE A.N+B.N+C.N+D.N+E.N+F.N=15ORDER BY 7;

1.

The answer is 13.992

 

// Another solution

This is a problem of n balls on b boxes. n is 15, and b is 6 (the digits of a number less than 1 million).

A further condition is that the number of 'balls' in each box should be less than 10.

 

The number of distributions of n balls in b boxes is 

B(n, b) = (n+b-1)!/n!(b-1)!

 

The number of distributions of 15 balls in 6 boxes is

B(15, 6) = (15+5)!/15!5! = 15504

 

Those with more than 9 ball in the first cage are calculated by putting 10 balls in the first cage and distributing that remaining balls:

B(15-10, 6) = (5+5)!/5!5! = 252

 

As the 'offending' box might be any, the correct number is

B(15, 6) - 6*B(5, 6) = 15504 - 6*252 = 13992.  


문제를 풀면서 느낀점 comment :  ​여러 풀이 방법으로 해당 문제를 접근할 수 있다는 사실이 신기하였다.



Problem 1 (p.344)

Solved by 그르크차리예브쇼흐차헌, Date: 2019.05.12

Finalized by 김도훈, Date: 2019.05.13

       Final OK by SGLee



Problem


Define lexicographic order


Solution

Lexicographic order is the way of ordering of words based on the alphabetical order of their component letters. It is also known as lexical order, dictionary order and alphabetical order. It is similar to the way in we search any word in the dictionary. We start our searching by simply searching for the first letter of the word. Then we try to find the the second letter and so on. The words in dictionary are arranged in a lexicographic order.

 

Let us understand it clearly with the help of some examples.

 

In case of strings for example consider ABC then all its permutations in lexicographical order will be “ABC, ACB, BAC, BCA, CAB, CBA”.

 

We can also apply it to arrange subsets of a set in mathematics in order.For example, the subsets of {1,2,3} in lexicographic order are “{},{1},{1,2},{1,2,3},{1,3},{2},{2,3},{3}”.

 

In case we consider the permutations of {1,2,3} in lexicographical order then they will be “123, 132, 213, 231, 312, 321”. If you look at these numbers properly you will find that it is the increasing numerical order possible with digits 1,2 and 3 together.​ 

 

// In Korean, it called '사전식 순서', which means 'A dictionary order'. 

By wikipedia, its definition is this.

 

 

 

Ch 6.3 problem 35 (p.339)

Solved by 그르크차리예브쇼흐차헌, Date: 2019.05.12

Finalized by 김도훈, Date: 2019.05.13

       Final OK by SGLee



Problem


​A domino ​is a rectangle divided into two squares with each square numbered one of 0,1,....,6, repetitions allowed. How many distinct dominoes are there?


Solution

Start with ordered pairs, which are easier. Obviously there are seven choices for the first element, (because there are 7 numbers - 0~6, not from 1) and (independently) seven choices for the second. 7 x 7 = 49 pairs.

 

If think about un-ordered pairs, mostly this pairs off (a,b) with (b,a) and we have two ordered pairs to each un-ordered pair. However, this doesn't work for (a,a) doubles — they stay aloof. There are, of course, just seven doubles among the dominoes. The remaining ordered pairs number 49−7 = 42, corresponding to 42 / 2 = 21 un-ordered pairs. So there are 7 + 21 = 28 dominoes.​​ 


// It is a good solution, and he didn't miss at divide two without un-ordered pair. It was awesome! So, there are 49 possible pairs, and we don't have to count same pairs. So, the answer is 28 dominoes while there are 49 possible pairs.


문제를 풀면서 느낀점 comment :  ​여러 풀이 방법으로 해당 문제를 접근할 수 있다는 사실이 신기하였다.






Ch 8.1 problem 9 (p.386)

Solved by 김도훈, Date: 2019.05.22

Revised by 강동윤, Date: 2019.05.22

       Final OK by SGLee



Problem


#9. Show that the graph has a path from a to a that passes through each edge exactly one time by finding such a path by inspection

 


Solution

To find the path that through all edges, we have to find edges which located to each vertex.

In this case, we can find out that all vertex have even number edges.

So, we can say that this figure is a Eulerian circuit.

Therefore, the answer is 

(a, c, f, e, c, b, e, d, b, a) ■


// Comment: all vertices has even edges, so it has infinitely many answers.


문제를 풀면서 느낀점 comment :  this is a interesting question, and it looks like a game! So, I think to study this graph part, you can study with your friends like game!







Ch 8.1 problem 10 (p.386)

Solved by 김도훈, Date: 2019.05.22

Revised by 강동윤, Date: 2019.05.22

       Final OK by SGLee



Problem


#10. Show that the graph has a path from a to a that passes through each edge exactly one time by finding such a path by inspection

 


Solution

To find the path that through all edges, we have to find edges which located to each vertex.

In this case, by the unique path (c-g), we can find out that all vertex have even number edges.

So, we can say that this figure is a Eulerian circuit.

Therefore, the answer is 

(a, b, c, e, b, d, e, f, c, g, h, i, f, h, e, g, d, a) ■

 


// Comment: All vertices in the graph has even edges, so there are infinitely many answers


문제를 풀면서 느낀점 comment :  This is also an interesting question, and it looks like a game! So, I think to study this graph part, you can study with your friends like game!


 



Ch 8.1 problem 1 (p.386)

Solved by 김도훈, Date: 2019.05.22

Revised by 김은민, Date: 2019.05.23

       Final OK by SGLee



Problem


#12. For each graph G=(V, E) , find V, E, all parallel edges, all loops, all isolated vertices, and tell whether G is a simple graph. Also, tell on which vertices edge e1 is incident.

 


Solution

V = {v1, v2, v3, v4, v5}

E = {e1, e2, e3, e4, e5, e6, e7, e8}

 

There are no parallel edges, no loops, and no isolated vertices.

 

G is simple. e1 is incident on v2 and v4 ■ 


김은민  comment

To find V, we must find all the points in the v graph

To find E, we must find all the points in the e graph

To find parallel edges, are edges parallel to each other, in this case, there are none

To find loops, must find an vertex that connects to itself, in this graph there are none

To find isolated vertices, must find a vertex with no edge, in this case there are none

If a graph has no loops or parallel edges, it is a simple graph

and the point e1 is incident on v2 and v4 as shown on the graph above



문제를 풀면서 느낀점 comment :  ​그래프의 정의와, 각각의 요소들에 대해 생각해볼 수 있는 문제였던 것 같다.

 

 

 

 

 

Question about cardinaility

Solved by 양세중, Date: 2019.05.22

Revised by 김도훈, Date: 2019.05.22

       Final OK by SGLee



Problem


What is the cardinaility of {a,b,a,c}? 



Solution

In a set  {a,b,a,c} = {a,b,c} 

Cardinality is defined as

: the number of elements in a set or other grouping, as a property of that grouping.

 

So there are 3 elements : a, b, c

 

Therefore I think its cardinality is 3.



문제를 풀면서 느낀점 comment :  ​단순 정의에 관한 질문이다. 정의를 바르게 알아두어야 나중에 문제를 풀 때에도 헷갈리지 않는다.






Ch 8.1 problem 12 (p.386)

Solved by 김도훈, Date: 2019.05.22

Revised by 김은민, Date: 2019.05.22

       Final OK by SGLee



Problem


#12. For each graph G=(V, E) , find V, E, all parallel edges, all loops, all isolated vertices, and tell whether G is a simple graph. Also, tell on which vertices edge e1 is incident.

 


Solution

To find the path that through all edges, we have to find edges which located to each vertex.

we can find out that all vertex have even number edges.

So, we can say that this figure is a Eulerian circuit.

Therefore, the answer is 

(a, b, d, f, e, d, c, b, e, c, a) ■

Another answer is

(a, c, e, f, d, b, e, d, c, b, a)

You can also start from f and do the same pattern from the above two answers.



문제를 풀면서 느낀점 comment :  There are also lots of solutions, so I think you can find another solutions! 




Ch 8.2 problem 20 (p.396)

Solved by 김도훈, Date: 2019.05.22

Revised by 김은민, Date: 2019.05.23

       Final OK by SGLee



Problem


#20. Find all simple paths from a to e in the graph of Exercise 19

 

Solution

To find all path, check each neighboring point of each vertex.

And think about its all possibility.

 

Therefore, the answers are

(a, b, c, d, e)

(a, b, c, d, f, e)

(a, b, c, g, f, e)

(a, b, c, g, f, d, e)

(a, b, g, f, e)

(a, b, g, c, d, e)

(a, b, g, f, d, e)

(a, b, g, c, d, f, e)

■ 

김은민 comment:

In this problemwe must find all simple paths of the given graph.

in order to do that, we must always start with a and end with e.

Then we just need to find a point next to and go from there. 

Since the graph is big enough, there can be more than one correct answer. 



문제를 풀면서 느낀점 comment :  ​하나씩 경로를 찾아가는 과정이 매우 신기하고 재미있었던 것 같다!

 

 

 

 

Ch 8.2 problem 21 (p.396)

Solved by 김도훈, Date: 2019.05.22

Revised by 채상은, Date: 2019.05.26

       Final OK by SGLee



Problem


#21. Find all connected subgraphs of the following graph containing all of the vertices of the original graph and having as few edges as possible. Which are simple paths? Which are cycles? Which are simple cycles?

 

Solution

We can draw like these :


 


 

But in problem, it ask us the simple path. The simple path is this:

 

Definition about simple path : 
A simple path is a path without duplicate vertices except for the first vertex and the end vertex

Definition about cycle​ :

Starting from the first node and then back to the first node

Definition about simple cycle :

A simple cycle is a cycle without dupulicate node except for the first node

 

In this question we can find subgraph such as

 


But, First and Second subgraph is not a simple path and cycle. The final case is simple path.

So the answer is this case.



문제를 풀면서 느낀점 comment :  ​하나씩 경로를 찾아가는 과정이 매우 신기하고 재미있었던 것 같다!






Ch 5 problem 2

Solved by 강동윤, Date: 2019.06.01

Finalized by 김은민, Date: 2019.06.01

Re-Finalized by 김도훈, Date: 2019.06.10

       Final OK by SGLee



Problem


Trace algorithm 1.8 for the given input.

n = 47


Solution

def is_prime(n):

  for d in range(2, 6 + 1):

     if n % d == 0:

        return false

  return true;


trace:


d = 2: 47 % 2 == 1​

​d = ​3: 47 % 3 == 2

​d = ​4: 47 % 4 == 3

​d = ​5: 47 % 5 == 2

​d = ​6: 47 % 6 == 5


return true


Thus, 47 is prime. 


This checks the number for a prime number.

First iteration is when divisor is 2, if the value has a remainder of 0 when divided by the divisor, then it is not a prime number. However if the remainder never equals 0, then it will be a prim e number.



문제를 풀면서 느낀점 comment : 앞서서 우리가 다뤘던 - Q&A 게시판에서도 화제였던 - 소수를 판별하는 문제가 생각났다. 47이 소수임을 판별하기 위해서 꼭 4와 6으로 나눈 나머지를 구할 필요가 있었나하는 생각이 들었다. for을 위해서 그렇게 넣은 것 같은데, 이 부분이 보완되면 좋겠다는 생각을 할 수 있었다.

 

 

 

 


Ch 5.2 problem 3

Solved by 김은민, Date: 2019.06.03

Finalized by 김도훈, Date: 2019.06.10

Final OK by SGLee



Problem


How many bits are needed to represent each integer in Exercises 1-7?


Exercise 3. 64


Solution


2^0 = 1


2^1 + 2^0 = 3


2^2 + 2^1 + 2^0 = 7


2^3 + 2^2 + 2^1 + 2^0 = 15


2^4 + ​2^3 + 2^2 + 2^1 + 2^0 ​= 31


2^5 + 2^4 +​2^3 + 2^2 + 2^1 + 2^0 ​= 63


2^6 + 2^5 + 2^4 + ​2^3 + 2^2 + 2^1 + 2^0 ​= 127


 


We need at least 7 bits


Comments : We need 6 bits to represent the number '63'. So we need 7 bits to represent the number '64'. Therefore the answer is 7 bits.




문제를 풀면서 느낀점 comment : 컴퓨터와 관련되어서 생각할 수 있는 문제여서 좋았던 것 같다. 약간 전공 공부하는 느낌도 나서 흥미로웠다.



Ch 8.3  Example 3.3

 BWOC : Answer to 채상은's question


Solved by 김도훈, Date: 2019.06.10

Finalized by 김도훈, Date: 2019.06.10

Final OK by TA



Problem


I can't understand this problem's answer.

Can someone help me to understand in Korean?



Solution (Proof)


우선 문제는 Show [주어진 그래프 G가 해밀턴 사이클을 포함하지 않음을 밝히는 것입니다.​]

 

해밀턴 사이클은 주어진 그래프에서 출발점과 도착점만 두 번 나타나는 것을 제외하고 각 정점이 한 번씩만 나타나는 사이클을 말합니다.

 

문제를 보이기 위해, 우리는 귀류법을 사용하고자 합니다.

 

BWOC G가 해밀턴 사이클 H를 포함한다고 가정합시다. 

=> 간선 (a, b), (a, g), (b, c), (c, k)는 해밀턴 사이클 안의 각 정점의 차수가 2이므로 H안에 있다고 할 수 있습니다. 

=> 따라서 간선 (b, d)와 (b, f)는 H안에 있지 않습니다. 

 

=> 그러므로 간선 (g, d), (d, e), (e, f), (f, k)는 H안에 있다고 할 수 있습니다. 

=> H안에 있다고 알려진 간선들 - 앞에서 언급한 간선들 - 은 사이클 C를 형성합니다.

 

C에 부가적인 간선을 첨가하는 것은 H안에 있는 어떤 정점의 차수를 2보다 더 크게 만들 것입니다.

=> 따라서 사이클이 만들어진다는 것은 틀리게 되고, 

=> 이는 앞서서 가정한 해밀턴 사이클 H를 포함한다는 가정에 위배됩니다. (모순) 

 

(모순에 의한 증명에 따라) 

           G는 해밀턴 사이클을 포함하지 않습니다.



문제를 풀면서 느낀점 comment : 무엇인가가 존재하지 않음을 증명할 때는 귀류법을 사용하라고 들었던 것 같아 귀류법을 사용한 풀이를 생각했었다. 이미 교과서에서 잘 설명되어 있었지만, 이를 따라가며 증명을 하는 과정 역시 신기하고 재밌었다.


#1

Questioned by : 김두원

Answered by : 김도훈, 정준영


Question

--------------------------------- 

 I have a small question for today's class.

 there is only 3 set venn diagram in the text book.

 is it possible to draw 4 or more set venn diagram?


Answer

--------------------------------- 


This is the example of Venn diagram for four sets.

We can draw a Venn diagram for four or more sets using other shapes. But, we cannot draw it using circles.

If you want to find about 'how to show that a Venn diagram using circles to represent the intersections among n>=4 sets can't exist', please follow the link below.

http://www.brynmawr.edu/math/people/anmyers/PAPERS/Venn.pdf



문제를 풀면서 느낀점 comment : 보통 벤 다이어그램을 그릴 때 3개까지만 생각했는데, 이 문제를 풀면서 n개의 벤 다이어그램을 그리는 방법에 대해 생각해볼 수 있었다. 기존의 상식을 깨는 매우 신선한 문제였다.

 

#2

Finalized by : 김도훈

 

Question

--------------------------------- 

Add to Euclidean algorithm - Extended Euclidean Algorithm

 

Answer

--------------------------------- 

Euclidean algorithm - a.k.a. 유클리드 호제법 - is not included in Korea's regular curriculum, but I think most of students have heard of it while preparing for the Olympiad etc.

 

Anyway, we have learned about Euclidean algorithm in class, and I discovered Extended Euclidean Algorithm while I was studying Euclidean algorithm.

 

Extended Euclidean Algorithm is an extension to the Euclidean algorithm, and computes, in addition to the greatest common divisor(gcd) of integers a and b, also the coefficients of Bézout's identity, which are integers x and y such that 

 

Also, It is known that the value of c in ax + by = c is only known to have an integer number of gcd(a, b). Therefore, the maximum value of c with ax + by = c is gcd(a,b). But the extended Euclidean algorithm is an algorithm that also obtains x and y that satisfies the maximum pledged number of a, b, and ax + by = gcd(a,b).

 

The extended Euclidean algorithm is particularly useful when a and b are coprime. With that provision, x is the modular multiplicative inverse of a modulo b, and y is the modular multiplicative inverse of b modulo a. Similarly, the polynomial extended Euclidean algorithm allows one to compute the multiplicative inverse in algebraic field extensions and, in particular in finite fields of non prime order. It follows that both extended Euclidean algorithms are widely used in cryptography. In particular, the computation of the modular multiplicative inverse is an essential step in RSA public-key encryption method.​

 

 

Reference : Wikipedia - Extended Euclidean algorithm


문제를 풀면서 느낀점 comment : Euclidean Algorithm was much stronger and powerful algorithm then I thought! And also there are many diffenrent types of Euclidean algorithm, so I was surprised at math!




 

#3

Questioned by : 감광적

Answered by : 김도훈

 

Question

--------------------------------- 

 

Answer

--------------------------------- 

문제를 풀면서 느낀점 comment : 유일함을 증명하기 위해서는 명확한 보여지는 무언가가 필요하다는 사실을 다시 한 번 알 수 있었고, 그러기 위해서는 두 개가 같음을 보이면 된다는 사실 역시 알 수 있었다.



 

#4

Questioned by : 강동윤

Answered by : 김도훈

 

Question

--------------------------------- 

 

 

Answer

--------------------------------- 

 

 


문제를 풀면서 느낀점 comment : mod와 remainder의 차이점에 대해서 다른 수업시간(시스템프로그래밍)시간에 간단하게 다룬 적이 있다. 그 때 궁금해서 찾아보았는데, 이번에 Q&A 게시판에 한 학우가 관련해서 글을 적어주었다. 그래서 그 때 찾아본 내용을 상기하여 조금 더 추가하였고, 교수님께 칭찬을 들을 수 있어서 좋았다.



 

#5

Questioned by : 최세현

Answered by : 김도훈, 김찬호

 

Question

--------------------------------- 

 

 

Answer

--------------------------------- 

 

문제를 풀면서 느낀점 comment : 교과서가 잘못되어있었는데, 이를 한 학우가 찾아서 질문하였고 나와 다른 학우가 코멘트를 달아 잘못된 것을 증명하였다. 개념이 무엇보다도 중요하다는 사실을 다시금 깨달을 수 있었던 문제였다.


 

#6

Questioned by : 채상은

Answered by : 김도훈, Piran Caci

 

Question

--------------------------------- 

 

Answer

--------------------------------- 

문제를 풀면서 느낀점 comment : 이 문제 역시 고등학교 때 수열부분에서 여러 번 풀어본 문제를 바탕으로 답변을 해주었다. 이러한 꼴의 문제가 많이 나왔기 때문에 비교적 쉽게 풀 수 있었다. 문제를 여러 번 푸는 것도 개념을 이해하는데 도움이 될 것 같았다.


 

#7

Questioned by : 이승원

Answered by : 김도훈, 김찬호

 

Question

--------------------------------- 

 

Answer

--------------------------------- 

 

 


문제를 풀면서 느낀점 comment : 나에게도 어려운 개념이여서 그런지 더 조사를 열심히 해서 답변을 달았던 기억이 난다. 남에게 가르쳐 주면서 배우는 것은 기억에 오래 남는다는 것을 알게 되었다.


 

#8

Questioned by : 김찬호

Answered by : 김도훈, 김두원, 이상구 교수님

 

Question

--------------------------------- 

 

Can anyone explain this solution clearly?

I cannot understand well.

in first sentence why lnn instead of lgn?

 

Answer

--------------------------------- 

It is a typing error!

  Therefore 

In Big-O notation, it wrote as log n, so it is a typing error.

 

+) Usually until high school, log means log with a base of 10.

However, in practice, a log that is generally not underlined means a log with an e (natural constant) at the bottom, such as an ln.

But, In this question, it is a typing error.

문제를 풀면서 느낀점 comment : At first, I just considered between log and ln, but the answer was not about that notation. So, I realized that I have to read solution's process more carefully.

 

#9

Questioned by : 최세현

Answered by : 김찬호, 김도훈

 

Question

--------------------------------- 

(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-5-Lab.html Chapter 5.1)

 

 

This example says 5 is neither prime nor composite.

 

I agree with 5 is not composite, but I think 5 is definitely prime!

 

Since 5 has only two divisors(5 and 1), So 5 must be prime. isn't it?

 

Is it a typing error? or am I missing something?

 

 

Answer

--------------------------------- 

It is a typing error - number 5 is definitely prime number.

 

+) Why 1 is neither prime nor composite?

-> A natural number is called a prime number if it has more than two positive factors, 1 and the number itself. Natural numbers that have more than two positive factors are called composite.

However, 1 has only one positive factor only. Hence 1 is neither prime nor composite. It forms its own special category as a "UNIT".

 

문제를 풀면서 느낀점 comment : I have to read our textbook carefully - their are some mistakes! And also, I realized that why 1 is neither prime nor composite.


 

#10

Questioned by : 강동윤

Answered by : 김도훈, 담딘바자르, 최세현

 

Question

--------------------------------- 

 

I think ∤ should be used to denote d cannot divide n. Am I wrong?

 

Answer

--------------------------------- 

According to the definition 1.1, it is correct.

 

d|n means d divides n.

dn means d can not divide n. 

 

However, there are some font problems such as the font looks blurry.

So the questioner was confused about this.

 

문제를 풀면서 느낀점 comment : I noticed that when we study math, the definition is one of the most important thing. Because this question was solved very easily by using definition!



Answer:


2. Answer about composition of relation

Answer:

 

 

3.Answer about Matrix relation.

Answer:




4.Question about Mod of Product

Answer:


Solve-Revise-Finalize and Final OK by SGLee/TA 된 문제들


Finalize ) Summary on Sec 3.4,3.5 by 박재형 with  웅요빈/김진녕​/​김도훈​/한진수​/담딘바자르​/김은민​/김두원)​​

------------------------------------------------------------------------

Original Reivew by 웅요빈/김진녕/김도훈/한진수/담딘바자르/김은민, Date 19.03.27

Finallize by 박재형, Date 19.03.28

Final OK by Professor


​(quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-3-Lab.html, summary of 웅요빈/김진녕​/​김도훈​/한진수​/담딘바자르​/김은민​/김두원)

3.4   Equivalence Relations

 

The next theorem shows that some relation is always reflexive, symmetric and transitive. -> This is equivalence relation.

 

 Theorem  4.1

 

Let  be a partition of a set . Define to mean that for some set in , both and belong to . Then is reflexive, symmetric and transitive.

 

This proof displays how the 3 properties formed:

Proof 

Let .

By the definition of partition, belongs to some numbers of .

Thus and is reflexive.

   Suppose that .

Then both and belong to some set .

Since both and belong to , and is symmetric.

    Finally suppose that and .

Then both and belong to some set and both and belong to some set .

Since belong to exactly one member of , .

Therefore, both and belong to and .

We have shown that is transitive.

 

By definition in order for us to consider a relation to be equivalence is to satisfy the following 3 conditions

1. Must be transitive

 and


2. Must be Symmetric

 

3. Must be reflexive

,

 

 

Theorem  4.8

equivalence relation, partition

 

 

Definition  4.9

equivalence class

 

 However, if it breaks any one of these conditions, it will never be equivalent.

Here is a counter example:

 

 

  Example  4.6

  Not an equivalence relation

 The relation on defined by if , is Not an equivalence relation  because

 is not symmetric (      ).

 But this relation is reflexive and transitive.

 

 

 

This example shows that the relation R isn't symmetric. So it isn't equivalence relation.

 

3.5  Matrices of Relations

 

In section 3.5 we learned about Matrices of Relations

In short, matrices relations are correlations and relations in entries of matrices. As we learn matrices in high school, this new concept in Discrete Math is not much different from what we had learn before. The whole concept is Matrices and Relations combined within.

 

To define the Matrix Relations

Let X={x1,x2,...,xn} be a finite n-element set and let R be a relation on set X. The Matrix Representation of R on set X is defined to be the n×n matrix where the entries are given.

 

-> Plus, the matrix of a relation R on a set X (from X to X), we use the same ordering for the rows as we do for the columns.s

 

 

 

 Example  5.1

 

 

-> this example is not symmetric. Because the relation is not on set X or Y, this relation can't be symmetric.


I introduce what is matrix of relation symmetric and also can satisfy reflexive.


X={1,2,3,4,5,6}


R on set X = [(1,1),(1,3),(1,5),(3,1),(3,3),(3,5),(5,1),(5,3),(5,5),(2,2),(2,6),(6,2),(6,6),(4,4)]

[1 0 1 0 1 0]

[0 1 0 0 0 1] [1 0 1 0 1 0] [0 0 0 1 0 0] [1 0 1 0 1 0]

[0 1 0 0 0 1 ]

The matrix of relation on a set X is square matrix. And this relation R is reflexive because R has (x,x) for all x. In brief,
for all is reflexive.


Also, It is symmetric because
, for all .


-> 아마도 R2가 Y to Z의 관계, R1이 X to Y의 관계를 나타낸다고 했을때, R2 o R1을 나타내기 위해서 R1의 matrix of relation인 A1 과 R2의 matrix of relation인 A2를 곱한 행렬인 을 곱하는 방법을 적으시려 했던 것 같습니다.​ 이는 김찬호 학생의 answer에서 나타낸 행렬의 곱셈방법을 이용하면 됩니다.


https://ko.wikipedia.org/wiki/행렬_곱셈

위 링크에 행렬곱셈 연산에 대한 자세한 설명이 나와있습니다.

(quoted from 김찬호's answer

 Link:http://icampus.ac.kr/front/study/QnaAction.do? method=view&lmsBdotSeq=2869551&lmsBlbdId=394928&isRply=Y​)


Matrix of relation 에서는 1과 0으로 이루어져 있기 때문에 nonzero인 부분만 생각하면 쉽게 계산할 수 있습니다.

 

 

 Theorem  5.6

 

 Let be a relation from to   and be a relation from to .

 Choose orderings of , and .

 is the matrix of . is the matrix of with respect to the orderings selected.

The matrix of the relation with respect to the ordering selected is obtained by   replacing each nonzero term in the matrix product by .

 

마지막으로 행렬관계에서 transitive가 되는 행렬을 추가로 넣으면서 마무리 하겠습니다.

Example  5.7

 

 Matrix of the relation

 on , relative to the ordering , , , is

.      .

 

 Whenever is nonzero, then is nonzero.                          

 Thus, is transitive.


In this relation, we can think about transitive.

and       : A relation on a set is transitive.

여기서 행렬의 곱의 특성을 이용하면, 결국 transitive가 되기 위해서는 A( 관계 R의 행렬) 을 스스로 곱하여 nonzeroterm인 부분에서 A의 같은 부분이 nonzero임을 만족하면 transitive가 된다는걸 알 수 있습니다.


-------------------------------------

 Conclusion

 담딘바자르 : ​In my personal experience, I have studied Computer Graphics semesters ago, there were lots of concepts related to Matrix and its relations, now it makes so much sense to what I had learnt in that class. The concepts are getting more related my class, which I am keen for.
김은진 : This chapter we learn about equivalent relation: must be symmetric, transitive, and reflexive. We also learn about matrices of relations. we can see that matrices have relations within one another and we can have a clear visual representation of these numbers. we can also multiply them to find a relation between the two matrices. We can determine if they are symmetric, transitive, or reflexive, or all.

This lesson is helpful because it wraps up chapter 3 where the main focus was functions, sequences, and relations.  We learn about more examples of relations: equivalence and a new way, through matrices.
김도훈 : Among concepts, I was impressed at above concept, because we can show element's relation with matrix, not graph!

With this concept, I think, we can represent lots of another concepts not only in DM, but also computer systems, computer graphics etc.


 


------------------------------------------------------------------------------------------------------------------------

 

Finalized: Summary of chapter 3.2, 3.3 (add to SIMEN SVERDRUP-THYGESON,담딘바자르, 김찬호, 박재형)

 

 

 

 

 

Original review by Simen Sverdrup-Thygeson, 담딘바자르, 김찬호, 박재형

Date: 2019.03.25

Finalized by 최세현, Date: 2019.03.26

Final OK by Professor


(quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-3-Lab.html,​

Final by

SIMEN SVERDRUP THYGESON,

담딘바자르,

김찬호,

박재형's summary)

​3.1 Sequences and Strings

Sequence


Sequences are ordered lists and can be described by a function like C(n) = 5(n-2).

Sequences can either be infinite or finite, defined by the function's individual domain.

Two important types of sequences are increasing and non-increasing.

We can also use the terms decreasing and non-decreasing.

Note that a function can be both decreasing and non-increasing, or both increasing and non-decreasing.

For instance, the sequence: {34, 23, 23, 15, 15, 4} is ​not ​decreasing, but rather non-increasing.

(23과 15가 같은 수가 연속으로 나와서 decreasing이라고 정의 할 수 없습니다.)

 

A subsequence is a sequence that can be created from another sequence by deleting some elements, but without changing the order. For example, {12, 14, 40, 67} and {12, 80} are subsequences of {10, 12, 14, 40, 67, 80}.

(subsequence란 순서를 바꾸지 않은채 원소를 삭져하면서 만들어지는 부분집합의 개념입니다.)

 

We also learnt the big sigma and big pi denotion of representing the sum or the product of a sequence, respectively.

sigma와 pi의 연산과정을 조금더 이해하기 쉽게 수업 자료를 보면,

 

 

 Definition  2.14

 

If is a sequence, we define

read the summation from equals to of -sub-, is the sum of all the terms , , , .

 is the expanded form of the sum.

 is a sequence, we define

.

read the product from equals to of -sub-, is the product of all the terms , , , .

 is the expanded form of the product.

 
​sigma 연산을 하게되면 sequence 한 a​n​에 대하여 일련의 덧셈연산을 진행하게 되고, pi 연산을 하게되면 일련의 곱 연산을 진행하게 됩니다.

​String

A string is an finite sequence of characters. A string can be created by using values from a finite set of characters. For instance we can define the set X = {a, b, d, t, i, g} => we can obtain the string "digit". A substring is a sequence of consecutive characters in a string. A substring of "digit" is "it".

(string이란 어떤 문자의 유한한 연속입니다)

A string is a sequence, order is taken into account.

Repetitions in a string can be specified by superscripts.

 

If a = "aabbbcd", and |a| = 7 denotes the length of a

a[2] = "b", as we use zero-indexing.

If we in addition have b = "ffg",

ab denotes the concatenation of a and b, ab = "aabbbcdffg"

 

The string with no elements is the null string. is null string.

 is the set of all strings over , including the .

 is the set of all nonnull strings over .

​(NULL string의 개념을 한번 살펴볼 필요가 있습니다. 원소가 없는 string을 NULL string이라고 합니다.

 ​-> Null string을 포함하는 string​

 -> Null string을 포함하지 않는 string.​)

 

3.3 Relations

Relations are relationships between 2 or more sets and their objects that related to each set.

If X = Y, we call R a (binary) relation on X.

A function from X ×X to X is a binary operator on X .

A (binary) relation R from a set X to a set Y ⇒​ xRy.

 

Moreover, A digraph is represented by two letters. The informative ways to picture a relation on a set is to draw its digraph -- Directed Graph. The number of vertices in the graph is equal to the number of elements in the set from which the relation has been defined. For each ordered pair (x, y) in the relation R, there will be a directed edge from the vertex ‘x’ to vertex ‘y’. If there is an ordered pair (x, x), there will be self- loop on vertex ‘x’.​

 

Here is more expression about symmetric and antisymmetric.

 

​Symmetric and Antisymmetric Relations

 

Definition  3.9

 

 A relation on is symmetric  if  (, if , then ).

 

 

 

Definition  3.12

 

 

symmetric이란 X의 원소 (x,y)에 대해서 (x,y)가 R에 포함될때 (y,x)역시 R에 포함 될때 정의되고,

 

antisymmetric이란 X의 원소 (x,y)에 대해서 (x,y)​가 R에 포함되고, (y,x)역시 R에 포함될때 x와 y가 같은것이 antisymmetric이라고 정의합니다.

 

 Example  3.10

 

 Relation

 on is symmetric

,       .

R이 (1,4)와 (4,1) 그리고 (2,2), (3,3)을 포함하므로 이 관계 R에서 집합 X는 symmetric 입니다.

 

추가적으로 reflexive(반사성) 와 transitive(이행성)에 대해서도 정의해보면,


Reflexive relation

 

Definition  3.6

 

,       A relation on a set is reflexive.

집합 X에 대해서 모든실수 x가 (x,x)를 만족하는 R에 포함될 경우, 이는 집합 X에서 관계 R은 reflexive라고 불립니다.

 

 

Example  3.7

 

The relation on defined by if , .

Then

.

This relation is reflexive.

Because for each element , ;

, , ,

 The digraph of a reflexive relation has a loop at every vertex.

 The digraph of this relation has a loop at every vertex.

 

 

 

By the generalized De Morgan’s laws for logic,

,       A relation on is not reflexive.

이 예시에서, X = {1,2,3,4} 이고, R 이 {(1,1),(2,2),(3,3),(4,4)}를 포함하고 있기 때문에,

즉 X의 모든 원소가 다 자기자신으로 돌아가는 관계를 가지기 때문에 X는 reflexive라고 할 수 있습니다.


Transivive relation

 

Definition  3.17

 

 

and       : A relation on a set is transitive.

​여기서 transitive란 X의 원소 (x,y)와 (y,z)가 R에 포함될 때, (x,z) 또한 포함될 때 정의됩니다. 예제를 들어보면,

 

 Example  3.19

 

 The relation

 on is not transitive.

 and       .

여기서 X={1,2,3,4}인데 R 이 (1,4), (4,1)을 포함한다고 해도 (1,1)은 포함하지 않으니 집합X에서 관계 R은 transitive가 아닙니다.

 

​Inverse of Relation

 

Definition  3.23

 

 Let be a relation from to . The inverse of , denoted , is the relation  from to defined by

.

relation R의 inverse(반대)는 모든 (x,y)를 (y,x)로 바꾼 R​-1​을 뜻합니다.

즉, R = {(1,2),(1,3)} 의 반대는 {(2,1),(3,1)}이 되겠습니다.


 Example  3.24

 

 

        

예시에서 위에 설명한 대로, 모든 (x,y) 를 (y,x)로 바꾼 inverse of R을 보여줍니다.

 

​Composition of Relations


Definition  3.25

 

 Let be a relation from to .

Let  be a relation from to .

Let  be a subset of . is a subset of .

Then  is the composition of and .

And  is the relation from to .

.

composition(합성) ​은 relation 두개를 연결할 수 있습니다.

만약 R1 = {(1,a),(2,b),(3,c)} 이고 R2 = {(a,A).(b,B),(c,C)} 이라면,

R1과 R2의 합성인 R1.R2 = {(1,A),(2,B),(3,C)}가 됩니다.

 

 

 Example  3.26

 

 

 

 

예시에서 R1 과 R2 를 composition하여 연결시키는 것을 볼 수 있습니다.

 

***************

My thought about this chapter (3.2, 3.3)

 시퀀스와 스트링, 그리고 관계에 대해 배웠습니다.

시퀀스를 4가지 타입(증가,감소,증가하지않는,감소하지않는)으로 나누는데,

삼각함수 같은 증감을 반복하는 시퀀스의 타입에 대한 내용은 없어서 아쉬웠습니다.

스트링의 개념에서 코딩할때 존재하는 null string도 들어있어서 신선했습니다^^.

관계를 학습하면서, 예시 3.10과 3.16의 오타때문에 잠시 헤맸지만, 큐앤에이를 통해 해결했고

많은 예시를 통해 다양한 종류의 관계에 대해 배울 수 있었습니다​~~




--------------------------------------------------------

Finalization of Definition of composition relation by 최세현(with 박재형, 김찬호, 강동윤)

--------------------------------------------------------

Solved by 박재형, 김찬호, 강동윤, Date 19.03.27

Finalized by 최세현, Date 19.03.27

 

 

Definition  3.25

 

 Let be a relation from to .

Let  be a relation from to .

Let  be a subset of . is a subset of .

Then  is the composition of and .

And  is the relation from to .

.

 

In this definition, is the relation from X to Z. (R1 = X to Y, R2 = Y to Z)

So if R1 = {1,2} and R2 = {2,3}, Then will be {1,3} Right?

 

but if we see Example 3.26

 

 Example  3.26

 

 

In this Example, R2 o R1 seems to be relation From X to Z. (R1 = X to Y and R2 = Y to Z.)

 

Then,, (R2 o R1) and (R1 o R2) are the same expression???

 

위 정의에서는 R1 o R2 가 x -> z 로 연결된다고 설명되어있는데

밑의 예시에서는 R2 o R1 가 x -> z 로 연결된다고 보입니다..

 

만약 R1 이 x to y 이고 R2 가 y to z 라면

x to z 는 R1 o R2 인가요 R2 o R1 인가요...?

예시가 잘못된건가요? 아니면 제가 잘못이해하고 있는건가요..

 

Answer

이산수학 교재 155페이지를 보면,

R1 이 from X to Y 이고, R2 가 from Y to Z 일때,

R2 o R1 이 from X to Z 이라고 명시되어 있습니다.


즉, R1 -> R2 composition 의 표현은 R2 o R1 이 맞는 표현입니다.


위의 질문에서, Definition이 오류고, Example이 맞는 설명입니다.

Definition 의

Then  is the composition of and .

And  is the relation from to .

Then  R2 o R1 is the composition of R1 and R2.

And  R2 o R1 is the relation from to .
로 고치면 되겠습니다.





-----------------------------------------------------------------------------

Final: preview : 4.3 4.4 by 김찬호, 최세현, 김은민, 박재형, 담딘바자르

------------------------------------------------------------------------
preview by 김찬호 Date 19.04.02

Final by 박재형Date 19.04.02

Final add by 담딘 바자르 Date 19.04.03

Final OK by professor



revise of preview 4.3 4.4 by 김찬호, 최세현, 김은민, 박재형

 

​In preview 4.3  and 4.4, we  added notations about Big-O, Omega, Theta notation

 

 

Chapter 4.3 is about Analysis of Algorithm problems.

 

  We can determine if an algorithm has too big of time or too big of space,

then we can tell that it is an inefficient problem or useless. There are three main cases.

 

1. Best case for time: minimum time taken

2. Worst Case for time: maximum time taken

3. Average case for time: average time taken

 

We can use something called the big O notation to determine the time complexity of a program.

some O notations are:

O(n), O(n^2), O(lnn), O(logn) and etc.

 

This is Big-O notation. Here is example for it.

 

   (quoted from  http://matrix.skku.ac.kr/2018-DM/DM-Ch-4-Lab.html

 

 

Definition  3.2

 

Let and be functions with domain .

     is big oh of       is of order at most

                    is positive constant such that

 

       is omega of     is of order at least

                      is positive constant such that

 

       is theta of       is of order

                      and

 

There is three notation about complexity.

Big O notation is often described for complexity because it indicates worst case.

 

4.4 is on Recursive Algorithms. Recursion is a function that calls itself to solve a certain problem. A popular problem is the factorial.

It is as shown below:

 

 

 Algorithm  4.2

Computing Factorial

 This non-recursive algorithm computes .

    Input:  , an integer greater than or equal to

  Output: 

 1. factorial()

 2.   

 3.    for to

 4.    *

 5.    return

 6. 

 

n factorial 을 구하는 non recursion 알고리즘 입니다.

for문을 활용하여 fact에 값을 계속 곱해나가고 최종적인 result를 return 하게 됩니다.

 

그렇다면 이 factorial 예제를 recursion 알고리즘으로 구현을 해 보겠습니다.

 

multiplyNumbers(int n)

{if (n >= 1)return n*multiplyNumbers(n-1);elsereturn 1;

} 

​ 

(quoted from https://www.programiz.com/c-programming/examples/factorial-recursion)

 

우선 n>=1인 경우에 multiplyNumber라는 함수에 n-1을 대입하여 나온 값에 n을 곱합니다.

그러면 multiplyNumber(n-1)은 다시 (n-1)*multiplyNumber(n-2)의 값을 호출합니다.

이런식으로 n=1이 될때 까지 계속 같은 함수를 호출합니다.

 

recursive함수는 향후 코딩을 할때 유용합니다.

왜냐하면 non recursive에서 보다싶이 재귀함수를 사용하지 않으면 변수의 사용이 많아집니다.

하지만 recursive는 굉장한 메모리와 시간복잡도를 가질수도 있기 때문에, 신중하고 정확하게 사용하셔야 합니다.

 

 

Robot Walk Problem

 

Example  4.5

 

A robot can takes of meters or meters.

We write an algorithm to calculate the number of ways the robot can walk meters.

We are going to find the number of ways the robot can walk, by using recursive algorithm.

 

Testing for the short distances (1,2,3,4),

If distance is 1, robot can walk through 1 way   (1)

If distance is 2, robot can walk through 2 ways (1,1)(2)

If distance is 3, robot can walk through 3 ways (1,1,1)(1,2)(2,1)

If distance is 4, robot can walk through 5 ways (1,1,1,1)(2,1,1)(1,2,1)(1,1,2)(2,2)

 

There are only 2 ways to go. 2 steps or 1 step.

 

According to above fact, If we make the function to find the number of ways the robot can walk n meters,

Then, the function will be like this :

 

Walk(n) = Walk(n-1) + Walk(n-2) (n > 2)

if n = 2, Walk(n) = 2

if n = 1, Walk(n) = 1


=> Walk(n) = Walk(n-1) + Walk(n-2) = Walk(n-2) + Walk(n-3) + Walk(n-4) + Walk(n-3) = .....

This algorithm repeats to divide the last step to two cases that one meter step or two meter step.

So, it will provide the all cases that robot can walk.

 

For example with n = 4

Walk(4) = Walk(3) + Walk(2) = (Walk(2) + Walk(1)) + 2 = (2 + 1) + 2 = 5. 

 

​Conclusion:

 

We need to maintain a certain algorithm by making it efficient for both time and space. Putting it into real life perspective, it's similar to putting apples into a box. If we put very few apple in the box, there will be gaps and free spaces in it, so it won't be sufficient because there could have been more apple to fill the gaps in terms of space. in the view of taxis, if the taxi driver chooses the longest route by going on all the routes in the town instead of taking a shortcut, then it will not be beneficial in terms of time. Ultimately, we should be efficient in both space and time for a good algorithm route.



 

------------------------------------------------------------------------

Finalize : Checking the prime number (최세현,김도훈,담딘바자르,박재형,김찬호)

Solved by 김찬호,박재형,담딘바자르,김도훈 Date 19.04.08

Finalize by 최세현 Date 19.04.08

------------------------------------------------------------------------

Question :

(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-5-Lab.html)

In this example,

It checks 2017 is prime or not

But It seems like to check if the prime number less than 44 divides 2017..

why it only checks the prime number(2,3,5,7,11....43) divides 2017? not all the integer(2,3,4,5,6,7....44)??

 

​Answer :

For the number ​n ​to be a prime number,

The number ​n​ must not be divided by all the integers less than √n.

(Since all the number bigger than √n are the pairs of the number less than √n)

But, Since all the integers can be shown as the product(multiply) of the prime numbers,

(for example : 2, 3, 2​2​, 5, 2*3, 7, 2​3​, 3​2​, 2*5 ....)

We just check that all the prime numbers less than √n instead of all the integers ​can divide the number n.




------------------------------------------------------------------------

Finalize) the summary of 4.1,4.2 add to 강동윤, 최세현,박재형, 담딘바자르

Revise 강동윤 최세현 박재형 담딘바자르 Date 19.04.02

Final by 김찬호 Date 19.04.02

-----------------------------------------------------------

 

는  알고리즘 의 최대 실행 시간이 라는 의미입니다.

 

 

는 알고리즘  의 최소 실행 시간이 라는 의미입니다.​

 

는 알고리즘 의​ 평균 실행 시간 (기댓값) 이  라는 의미입니다.​​

 

Revise 최세현, 담딘바자르 summary of 4.3


I added summary of 4.3

****

4.1 Algorithms

​Principles of Algorithms:

Input : An algorithm has input values from a set.

Output : From each set of input an algorithm produces output from a set. The output values are the solution to the problem.

Definiteness : The steps of an algorithm must be defined precisely.

Effectiveness : It must be possible to perform each step of an algorithm exactly and in a finite amount of time.

Finiteness : An algorithm should produce the desired output after a finite number of steps for any input in the set.

Correctness : An algorithm should produce the correct output values for each set of input values.

Generality : The procedure should be applicable for all problems of the desired form, not just for a particular set of input values.

 

​Pseudocode: Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a normal programming language, but is intended for human reading rather than machine reading.​

 

​4.2 Examples of Algorithms


Linear Search:

​A linear search or sequential search is a method for finding an element within a list. It sequentially checks each element of the list until a match is found or the whole list has been searched.​

Worst complexity: O(n)

Average complexity: O(n)

Space complexity: O(1)​

 

Binary Search:

Binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array.​

Worst complexity: O(log n)

Average complexity: O(log n)

Best complexity: O(1)

Space complexity: O(1)

Data structure: Array

Class: Search algorithm

 

 

Algorithm 2.2

  The Binary Search Algorithm

procedure binary search ( : integer, , , : increasing integers)

 { is left endpoint of search interval}

 { is right endpoint of search interval}

 while

     

      if then

      else

 if then location

 else location

return

 

binary search algorithm에 대해 설명을 하겠습니다

 

처음에 어떤 배열이 주어졌을때 i=0, j=len(배열의길이)로 설정하겠습니다.

 

우리가 원하는것은 x라는 원소가 배열 몇번째에 위치해있는지 아는 것 입니다.

 

처음에 mid라는 변수 하나를 설정합니다. mid는 (i+j)/2입니다.

 

우리가 원하는 x라는 원소가 mid 보다 아래쪽에 있는지 위 쪽에 있는지 확인합니다.

 

만약에 밑에 있으면 j=mid로 설정하고 다시 mid값을 (i+j)/2로 합니다

        위에 있으면 i=mid+1로 설정하고 mid값을 (i+j)/2​ 로 설정합니다

 

이런식으로 계속 범위를 반씩 줄여 나가며 원하는 값의 위치를 찾는 알고리즘 입니다.

(아래 이미지 quoted from https://medium.com/@jsh901220/toy-problem-%ED%92%80%EA%B8%B0-binarysearch-f50ffb19573f)​

 

(quoted from my qna)​​

Searching algoritm's one is binary search.

 

 

THE BINARY SEARCH We will now consider another searching algorithm.

This algorithm can be used when the list has terms occurring in order of increasing size

(for instance: if the terms are numbers, they are listed from smallest to largest; if they are words, they are listed in lexicographic, or alphabetic, order).

This second searching algorithm is called the binary search algorithm.

And one of algoritm's is sorting algoritm.

 

Sorting: 

A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most frequently used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the efficiency of other algorithms which require input data to be in sorted lists.​

Sorting is putting these elements into a list in which the elements are in increasing order. For instance, sorting the list 7, 2, 1, 4, 5, 9 produces the list 1, 2, 4, 5, 7, 9. Sorting the list d, h, c, a, f (using alphabetical order) produces the list a, c, d, f, h. An amazingly large percentage of computing resources is devoted to sorting one thing or another. Hence, much effort has been devoted to the development of sorting algorithms.

 

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent pairs and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.​

 

Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.​

Sorting

Sorting is putting these elements into a list in which the elements are in increasing order.

 

Sorting is putting these elements into a list in which the elements are in increasing order. For instance,

sorting the list 7, 2, 1, 4, 5, 9 produces the list 1, 2, 4, 5, 7, 9. Sorting the list d, h, c, a, f (using alphabetical order)

produces the list a, c, d, f, h. An amazingly large percentage of computing resources is devoted to sorting one thing or another.

Hence, much effort has been devoted to the development of sorting algorithms.

 

The Bubble sort is one of the simplest sorting algorithms, but not one of the most efficient.

 

​​Time and Space Complexity for Algorithms

While analyzing an algorithm, we mostly consider time complexity and space complexity. Time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the input.​

 

 

Best-case-time

 The input sequence is already sorted in nondecreasing order,

(input value)      

 will always be false.  The body of the while loop will never be executed.

 

Worst-case-time

 The input sequence is sorted in decreasing order,

(input value)    

 will be true.

  The while loop will execute the maximum number of times.

 

Finiteness

 An operating system never terminates

 

Determinism

 Algorithms for multiprocessor machine or distributed environment are rarely deterministic

 

Generality or Correctness

 Many practical problem are too difficult to be solved efficiently

 

​Shuffle is skipped.

 

​4.3 Analysis of Algorithms Problem


Useless program for certain type of input even though derived from a correct algorithm

  the time needed to run the program is too big or

  the space needed to hold the data is too big.

For Example,

 a set of elements some elements are labeled 'red', some labeled 'black'.

Find the number of subsets of that contain at least one red item.

Since a set that has elements has subsets, the program would require at least units of time to execute.

What if is very big?

 

 

The time needed to execute an algorithm is a function of the input. Instead of dealing directly with the input, we use parameters that characterize the size of the input.

 

For example,

The input is a set containing elements.      The size of the input is .

 

Best-case-time: We can ask for the minimum time needed to execute the algorithm among all inputs of size .  This time is the best-case-time for inputs of size .

Omega

 if, except for a constant factor and a finite number of exceptions,

 is bounded above by .

 is an asymptotic upper bound for .
Worst-case-time: We can ask for the maximum time needed to execute the algorithm among all inputs of size .  This time is the worst-case-time for inputs of size .

Big - Oh

 if, except for a constant factor and a finite number of exceptions,

 is bounded above by .

 is an asymptotic upper bound for .
Average-case time: Another important case is average-case time that the average time needed to execute  the algorithm over some finite set of inputs all of size .

Theta

 if, except for constant factors and a finite number of exceptions,

 is bounded above and below by .

 is an asymptotic tight bound for .


We usually use Big-Oh NOTATION for measuring time of program to prepare for worst-case.


Summary of 최세현:

4.3에서 알고리즘을 측정하는 방법에 대해 배웠습니다.

n개의 데이터를 연산할때, 시간복잡도를 f(n), g(n)으로 표현하는 것을 알게되었고,

가장 최악의 상황, 최선의 상황, 평균적인 상황일때의 시간복잡도를 서로 다른 기호로 표기하는 방법을 배웠습니다.

보통, 알고리즘의 시간복잡도를 판단할 때 빅-오 표기법을 이용해 최악의 상황에서의 시간복잡도를 측정하고, 비교합니다.

 

Summary of 담딘바자르:

As Algorithms is one of the fundamental concepts of Computer Science, we, Software Engineer students or related fields students are fairly familiar with the concept. Algorithms we use in Discrete Mathematics is used the same way; however, it's usually used like Pseudocode. Sorting is the crucial part of algorithms due to its space and time complexity. As for as I know, quick sorting is the most efficient sorting in most cases, in case someone wonders. On the other hand, bubble sort is the worst in case of time complexity. I haven't taken the Algorithm course, but Algorithm concepts in Discrete Mathematics make me itching for its applications in both CS and DM.​

Furthermore, it's recommend to review Big O notation, Omega notation, and Theta notation for thorough understanding of time complexity of Algorithms.

 

Summary of 김찬호:

4.1, 4.2를 배우며 직접적으로 나의 전공인 컴퓨터 공학의 프로그래밍에 직접적인 연관이 있는 알고리즘에 대해 배우게 되었다. 우선 기본적인 linear search, binary search에 대해 복습 하게 되었고, 기본적인 sorting알고리즘에 대해 다시 한번 공부하게 되었다. 이부분에서 매우 흥미를 느끼고, 프로그래밍에 흥미가 많은 나로서는 이 단원에 대해 공부하는게 재밌었다.

binary search : 간단히 소개하자면 배열의 첫번째 index 와 마지막 index의 중간값을 검사를 진행하며 바꿔나가며 검사해야할 배열을 줄여나가 결국 target을 찾게되는 search방법이다.

bubble sort: 배열의 첫번째 값부터 마지막값까지 하나씩 계속 비교를 하면서 가장 큰 값을 혹은 가장 작은 값을 마지막 인덱스에 넣는다. 다시 검사를 진행하면서 결과적으로 모든 배열이 오름차순 혹은 내림차순으로 정렬이 된다.

 

또 프로그래밍의 중요한 부분인 time complexity를 구하는 방법을 배우게 되었고, 그 중에는 빅오 표기법, 오메가, 세타표기법이 있지만 흔히 우리는 일반적으로 worst case를 기준으로 time complexity를 적기 때문에 빅오 표기법을 가장 많이 사용하게 된다.


Comment: In chpater 4.1 4.2, we learned algorithm. Linear Search, Binary search, Sorting.. we should know this algorithm because we use these with coding. So we must study this part.



------------------------------------------------

Finalize) summary of 5.1

-----------------------------------------------

Summary by 김찬호 최세현 Date 19.04.08

Finalize by 박재형 Date 19.04.08

5.1 Divisors

 

 

 

Definition  1.1

 

 , .

,        divides .

   d is divisor or factor,  is the quotient.

 

if d divides n d is divisor or factor of n

   divides       is divisor or factor of .

    divides        .

    does not divide        .

 

For example, Since 21 = 3 * 7,

3 divides 21 => 3 | 21

The divisor is 3

The quotient is 7

 

 

Definition  1.4

 

 is prime      if then either and or and .

 is composite    is not a prime

                  ( such that and and . )

if n is prime number then we can express n with rs

(r =1 s=n , or r=n,s=1)

if n is composite then n is not prime.

 

For example of checking prime number

Since We can represent all the integers by multiple of prime numbers

(2,3, 2*2, 5, 2*3, 7, 2*2*2 ...)

If we want to check the number which is prime or not,

then we only have to check the number can be divided by all the prime numbers less than √n.

 


Theorem  1.12

 

   There are infinitely many prime numbers.

 

Proof

 

 

 

 

 COROLLARY

 

 If , and are integers, where , such that and , then whenever and are integers.

 

 

 

 Transitivity of Divisibility

 

Prove that for all integers , and , if and then .

 

Proof

Show that      

        for some integer .

        for some integer .

      .   

 

We can divides integer a

 

Definition  1.14

 

 

 

Definition  1.19

 


​we also learn about gcd,lcm

gcd is the largest common divisor of m,n

lcm is the smallest positive common multiple of m,n.

 

5.2 chapter we use algorithm about integer representation.

Here is an algorithm about converting integer from base b to decimal.

 

 

 

Algorithm  2.3

 Converting an Integer from Base to Decimal

This algorithm returns the decimal value of the base integer .

      Input:  , ,

    Output:  dec_val

    base_b_to_dec (, , )

       dec_val

       power

       for to

          dec_val dec_val *power

          power power *

   

    return dec_val

Algorithm runs is time .

 

 

 Example  2.4

 

We show how Algorithm converts the binary number to decimal.


Solution

Here , and

,   ,   ,   .

First, is set to , and power is set to .

We then enter the for loop.

Since and ,

 * *.

Thus becomes . Executing

 *

sets to . We return to the top of the for loop.

Since and ,

 * *.

Thus becomes . Executing

 *

sets to .

We return to the top of the for loop.

Since and ,

 * *.

Thus becomes . Executing

 *

sets to .

We return to the top of the for loop.

Since and ,

 * *.

Thus becomes . Executing

 *

sets to .

The for loop terminates and the algorithm returns , the decimal value of the binary number .                                               

 

It is important algorithm that we use this with any integer number such that,

 

The binary Number System consists of  symbols(bit).

The octal Number System consists of symbols.

The decimal Number System consists of symbols.

The hexadecimal Number System consists of symbols.

--------------

김찬호's Review:

today we learn about number theory and chapter 1. the divisor and composition and gcd and lcm.

it is very interesting that we study the common number that we normally see in our life more analystic way.

 

최세현's Review:

We have learned about divisors, gcd, lcd and prime numbers.

I have known new information that for checking prime numbers, we only have to check all the prime numbers can divide the number, not all the integers. because all the integers can be shown as multiple of prime numbers. It was very interesting

 

박재형's Review:

I studied about integer representation and number theory. I think it's important concepts that we must know. I have known new knowledge about number theory. for example, I know that prime number is consisted of any integer. it was very exciting experience.




----------------------------------------------

​Finalize) summary of 5.2

​---------------------------------------------

Summary by 최세현 김은민 박재형 Date 19.04.10

Finalize by 김찬호 Date 19.04.10

We cited infos from :

Ch-5-Lab   http://matrix.skku.ac.kr/2018-DM/DM-Ch-5-Lab.html

Solutions http://matrix.skku.ac.kr/2018-DM-Sol/Ch5/

[Ch 4 &5 (Solution) Student Presentation] by Chingis, https://youtu.be/qVCvZc2s6eA

 

5.2 Representations of Integers and Integer Algorithms

 

 

A bit is a binary digit. A bit has a and a .

 

The binary Number System consists of  symbols(bit).

The octal Number System consists of symbols.

The decimal Number System consists of symbols.

The hexadecimal Number System consists of symbols.

 

 

The system is based the base of the number system.

 

today we learn about Number System.

 

and each Number System consist of 2,8,10,16 symbols.

 

and we learned how to convert one system to other system.

 

 

 

Example  2.2

Binary to Decimal

 

this example show how we convert binary system to decimal

 

 

Algorithm  2.3

 Converting an Integer from Base to Decimal

This algorithm returns the decimal value of the base integer .

      Input:  , ,

    Output:  dec_val

    base_b_to_dec (, , )

       dec_val

       power

       for to

          dec_val dec_val *power

          power power *

   

    return dec_val


And this algorithm converts the number "c" based on "b" number system to decimal number.

The input "n" is the (length-1) of the input number "c".

 

For example, we input n = 3, c = 1101, b = 2

Then the algorithm will convert 1101(2) to decimal number.

1101(2) = 13(10). So the output will be 13.

 

We can also add binary numbers like this:

 

Example  2.10

 Binary Addition

 Add the binary numbers and .

 

Solution

                                        

                                       

                                        

We begin from the right, adding and . This sum is .

We write and carry . At this point the computation is

                                          

                                        

                                       

                                           

Next, we add and and . This sum is .

We write and carry . At this point the computation is

                                         

                                        

                                       

                                                                                      

Continuing in this way, we obtain

                                        

                                       

                                                 

 

 

and today we learned some modular arithmatic

 

 

Theorem  2.17

 

 

 

There is some example about this concepts.

 

Solution of second example :

since 2015 mod 7 is 6, So it doesn't matter to be (6 mod 7). ​

So the equation will be

(6 mod 7)​10​ mod 7

=> 36 * (6 mod 7)​8​ mod 7

And, since ab mod 7 = (a mod 7)(b mod 7) mod 7,

We take a = 36, b = (6 mod 7)​8​ then the equation will be

=> (36 mod 7){(6 mod 7)​8​ mod 7} mod 7

=> 1 * (6​8​ mod 7) mod 7

 

So, Repeating above part can change all the (6 mod 7)​2to 1.

So the answer will be 1​5​ = 1


Example  2.18

 

 

In this example, we must know the Theorem 2.17 and use it for solving this problem.

 

today we learned about Number System and some arithmatic approach about large number modular arithmatic.

at first the octal system is hard to see in our life so it's little be strange and modular arithmatic technique is very useful and professor emphasize that this arithmatic is very important. so I have to be friendly with this arithmatic.   

 

박재형's comment : I learned binary representation of integer and this algorithm. In this chapter, we must know various number system about binary representation. So, I should study this chapter in detail.

 

최세현's comment : We could learn the various system of representation of integers, to calculate them such as add, and to convert them to another number system. The algorithm to convert the number system was very interesting because it uses the mod in math. And we also learned about theorem of mod of multiple. The example of this theorem was a little hard to understand but I solved through Q&A, and finally understood. It was very fresh that using theorem of mod of multiple to find mod of very large numbers.


----------------------------------

Finalize) Exercise (37-57) Page 59

---------------------------------

Solved by 박재형 Date 19.03.13

Finalized by 박재형 Date 19.04.14

Let P(x,y) be the propositional function x ≥​ y. The domain of discourse is Z+X Z+. Tell whether each proposition in Exercises 37-40 is  true or false

 

37. xyP(x,y)


40. xyP(x,y)

 

 

Determine the truth value of each statement in Exercises 42-59. The domain of discourse is R X R. Justify your answers.

42. xy(x2< y + 1)​​

 

45. xy(x2< y + 1)​​

 

48. xy(x2+ y2= 9)

 

51. xy(x2 + y2 = 9)

 

54. xy(x2+ y2 0)

 

57.∀x∃y((x<y) ->(x​2​<y​2​))


********

Solution

37. xyP(x,y)

This proposition is false. The counter-example is x=1, y=2.​

 

40. xyP(x,y)
This proposition is true. There is at least one x and y. For example, x= 2, y=1.​

 

42. xy(x2 < y + 1)

This statement is false. Because there is counter-example that is x=2, y=1

45. xy(x2 < y + 1)

This statement is true. There is at least one x and y. For example, x=1, y=2.

 

48. xy(x2+ y2= 9)

This statement is false. Because of x=1,y,1 that is counter-example.

 

51. xy(x2 + y2 = 9)

This statement is true. At least one pair of x and y is exist. For example, x=3 and y=0

 

 

54. xy(x2+ y2 0)

 

x is in domain R so x​2​≥0

y is in domain R so y​2​≥0

​so x​2​+y​2​≥0 is true.


57.∀x∃y((x<y) ->(x​2​<y​2​))

 

for every positive real number x, there is x that take y=x.

but the x<y is false.

so the proposition is always true.


Comment : This exercise is in Chpater 1. We know that this exercise is nested quantifier.





----------------------------------

Finalize) Chapter 1 Page 64 problem 8

---------------------------------

Solved by 박재형 Date 19.03.13

Finalized by 박재형 Date 19.04.14


​​Problem 8

 

Assume that a, b , and  c  are real numbers. Represent the statement

 

a < b or ( b < c and a c )

 

symbolically, letting

 

p : a < b, q : b < c, r : a < c.

 

solution

1. ​~r : a ≥c

2. q : b < c

3. q ∧ ~r : (b < c and a ≥ c)

4. p ∨ ( q ∧ ~r) : ​a < b or ( b < c and a ≥ c ​). So, answer is ​ p ∨ ( q ∧ ~r)​




----------------------------------

Finalize) SKKU DM Chapter 2.2 Problem 22

---------------------------------

Solved by 한진수 19.04.14

Finalized by 박재형 19.04.14

Re-Finalized by 담딘바자르 19.04.15

Problem

 

A = s1 +s2 +···+sn / n

is the average of the real numbers s1, ..., sn.

 

22. Prove that there exists i such that si ≤ A.​

 

Solution​

if we suppose that contradiction of  si ≤ A.​​

Then, all i must be satisfied  si > A.

 

 

s1 > A

s2 > A

.

.

Sn > A.

 

s1 + s2 + .. + sn >nA.

 

s1 + s2 + .. + sn / n > A

 

Because A = s1 +s2 +···+sn / n, Conclusion is false.

 

Therefore, using proof of contradiction, there exists i such that si ≤ A.​​

 

Comment by 박재형​: This exercise is solved by proof of contradiction. Proof of contradiction is an indirect proof that if hypothesis is true and conclusion is false, then we can find the contradiction.

 

Comment by 담딘바자르: ​I re-finalized it to put it into the correct format and corrected a few errors.




----------------------------------

Finalize) SKKU DM Chapter 2.2 Problem 22

---------------------------------

Solved by 한진수 19.04.14

Finalized by 박재형 19.04.14

Re-Finalized by 담딘바자르 19.04.15

Problem


Prove or disprove: (X −Y) ∩(Y − X) = ∅ for all sets X and Y.

 

Solution

 

Answer is true.

if we use contradiction of  (X −Y) ∩(Y − X) = ∅​.

Contradiction of (X −Y) ∩(Y − X) = ∅​  is (X - Y) ∩​ (Y- X)  != ∅​.​

So, it means that this is nonempty.

 

Then, there exists any x where (X −Y) ∩(Y − X)​.

if x in X - Y, x is in X and x isn't in Y  ------ 1

if x in Y - X, x is in Y and x isn't in X  ------ 2

Since 1 and 2 , x in X and x not in X.

 

Therefore (X - Y) ∩​ (Y - X) = ∅​.

 

Comment by 박재형​: I added the solution easy to see. And the contradiction proof is mostly used to prove proposition.

 

Comment by 담딘바자르​: I re-finalized to make it into the appropriate format for clarification and corrected a few errors.


----------------------------------

Finalize) SKKU DM Chapter 3.4 Problem 1

---------------------------------

Solved by 한진수 19.04.14

Finalized by 박재형 19.04.15

Re-Finalized by 담딘바자르​ 19.04.15


Problem

Determine whether the given relation is an equivalence relation on {1, 2, 3, 4, 5}. If the relation is an equivalence relation, list the equivalence classes. (In Exercises 5–8, x,y∈{1, 2, 3, 4, 5}.)

1. {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (1, 3), (3, 1)}

Solution

Equivalence relation : [1] = [3] = {1,3}, [2] = {2}, [4] = {4}, [5] = {5}.

 

Comment by 담딘바자르:

​We know that an equivalence relation is a binary relation that is reflexive, symmetric and transitive. Since it meets all the 3 conditions, we can simply get result by as above.​

Comment by 박재형:

Equivalence relation is satisfying this 3 condition and we know that this relation of {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (1, 3), (3, 1)} is satisfying this 3 condition.​

This is the equivalence relation's condition.


A relation on is caled an equivalence relation if is reflexive, symmetric, and transitive.

      Three properties:

 (1) , .    (reflexive)

 (2)        . (symmetric)

 (3) and        . (transitive)

(http://matrix.skku.ac.kr/2018-DM/DM-Ch-3-Lab.html​)

----------------------------------

Finalize) Chapter 4.3 prob.33

---------------------------------

Solved by 한진수 19.04.14

Finalized by 박재형 19.04.15

 

33. Show that n!= O(n​n).

 

sol) 

 

n! = n * (n-1) * (n-2) * (n-3) *  ...  * 1<= n * n * n * n * ... = n​n.

 

So, n! = O(n​n).

 

comment : In this case , f(n) is n!, g(n) is n​n. So, |f(n)| ≤ C|g(n)| is satisfying. we can use Big-O notation for this problem.


 


----------------------------------

Finalize) Chapter 2.2 prob. 16

---------------------------------

Solved by 김진녕 19.04.14

Finalized by 박재형 19.04.14

16. Prove or disprove: (X −Y) ∩(Y − X) = ∅ for all sets X and Y.

 

solution )

 

Answer is true.

if we use contradiction of  (X −Y) ∩(Y − X) = ∅​.

Contradiction of (X −Y) ∩(Y − X) = ∅​  is (X - Y) ∩​ (Y- X)  != ∅​.​

So, it means that this is nonempty.

 

Then, there exists any x where (X −Y) ∩(Y − X)​.

if x in X - Y, x is in X and x isn't in Y  ------ 1

if x in Y - X, x is in Y and x isn't in X  ------ 2

Since 1 and 2 , x in X and x not in X.

 

Therefore (X - Y) ∩​ (Y - X) = ∅​.

 

comment : I added the solution easy to see. And the contradiction proof is mostly used to prove proposition.

---------------------------------

Finalize) Chapter 2.2 prob. 22

---------------------------------

Solved by 김진녕 19.04.14

Finalized by 박재형 19.04.14

In Exercises 22–26,

 

A = s1 +s2 +···+sn / n

is the average of the real numbers s1, ..., sn.

 

22. Prove that there exists i such that si ≤ A.​

 

sol) 

if we suppose that contradiction of  si ≤ A.​​

Then, all i must be satisfied  si > A.

 

s1 > A

s2 > A

.

.

Sn > A.

 

s1 + s2 + .. + sn >nA.

 

s1 + s2 + .. + sn / n > A

 

Because A = s1 +s2 +···+sn / n, Conclusion is false.

 

Therefore, using proof of contradiction, there exists i such that si ≤ A.​​

 

comment :  This exercise is solved by proof of contradiction. Proof of contradiction is an indirect proof that if hypothesis is true and conclusion is false, then we can find the contradiction.



----------------------------------

Finalize) Chpater 5 Exercise 5 page 384

---------------------------------

Solved by 김진녕 19.04.14

Finalized by 박재형 19.04.14



Page 384.

 

Problem : Caculate gcd(2 * 5​2 ​* 7​2 ​* 13​4 , 7​4 * 13​2 * 17).

 

Sol :

As the property of gcd function : gcd(ka,kb)=k*gcd(a,b),

gcd(2 * 5​2 ​* 7​2 ​* 13​4 , 7​4* 13​2* 17​)= 7​2*13​2 * gcd(2 * 5​2​ * 13​2 = 8450, 7​2​ * 17 = 833).

gcd(8450,833) = gcd(833,120) = gcd(120,113) = gdc(113,7) = gcd(7,1) = 1.

so, gcd(2 * 5​2 ​* 7​2 ​* 13​4 , 7​4* 13​2* 17​​).=  7​2*13​2 * 1 =8281

 

comment : I revise it easy to see. This exercise requires gcd's concept. gcd is greatest common divisor. So gcd (ka,kb) is equal to gcd(a,b).






----------------------------------

Finalize) Preview 6.1, 6.2

---------------------------------

Preview by 김찬호 19.04.29

Revise by 박재형,최세현, 김은민, 담딘바자르 19.04.29

Finalized by 김두원 19.04.29

Final OK by professor 19.04.29


(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html)

6   Counting Methods and the Pigeonhole Principle

  

In chapter 6, we will learn about Counting Methods and Pigeonhole Principle.

 

6.1   Basic Principles

 

Example of counting:

Menu for Quick Lunch:

There are two appetizer, three main courses and four beverages and .

 

 

HT, HM, HC, HR, CT, CM, CC, CR, FT, FM, FC, FR ()

And

    NHT, NHM, NHC, NHR, NCT, NCM, NCC, NCR, NFT, NFM, NFC, NFR,

                    12 with Nachos   (N),   +

                                        12 with Salad     (S)  = 24.

    SHT, SHM, SHC, SHR, SCT, SCM, SCC, SCR, SFT, SFM, SFC, SFR


We can solve this problem by using Multiplication Principle noted below.


Multiplication Principle

 (Product Rule)

 

Using product rule to solve above problem :

The problem of counting the number of dinners consisting of one appetizer, one main course and one beverage,

  First step is “select the appetizer.”

  Second step is “select the main course.”

  Third step is “select the beverage.”

 

By the Multiplication Principle,

, and , the total number of dinner is .

 

if any activity that consist of t times succesive steps,

step 1, n1 ways

step 2, n1 ways

..

step t, nt ways

than we can represent the total different possible activity n1*n2*...nt


Addition Principle

 

 

simmillary we can make addition principle.

we can pick the elements of each sets.

than the total union of sets's element is n1+n2+...+nt



There is a theorem about Inclusion exclusion principle for two sets

 

 

 Theorem  1.12

Inclusion-Exclusion Principle for Two Sets

If and are finite sets, then

.

 

 


6.2   Permutations and Combinations

 

 Definition  2.1

 

 A Permutation of distinct elements , , is an ordering of the elements ,    , .

 

 Definition  2.8

-permutation of (distinct) elements

 

 

permutation means the ordering of n elements

and r-permutation of n elements is an ordering of an r-element subset of

{x1,x2,,,xn}

The number of this is P(n,r)

and we can calculate in this form

 

 Theorem  2.10

 

The numbers of -permutation of a set of distinct objects is

,     .

 

simillary we can define combination with

 

 

Definition  2.15

 

 Given a set containing (distinct) elements,

 (a) An -combination of is an unordered selection of -elements of (i.e. an          -element subset of ).

 (b) The number of -combination of a set of distinct elements is or .

 

And this is detailed explanation about r- combination of a set of n distinct elements.

The numbers of -combinations of a set of distinct objects is

,     .

***

Comment by 최세현 : We will learn about counting methods, permutation and combinations.

I think that it will be very useful to check the cases to solve problems or calculate the number of all the cases.

 

Comment by 담딘바자르​:

In my opinion, counting methods are used to determine the complexity of algorithms ,and they can be used to solve other sorts of problems. I think counting is related to probabilities and statistics because it has some elements and techniques from the subjects such as finding all possible results to determine the best result. Moreover, these sections are even big part of our life, so they should be familiar with us.

 

Comment by 김두원:

Multiplication Rules and Addition Rule are the most important basic principle to solve counting problem. By counting, we can calculate the complexity of an algorithm and statics kind problems.





----------------------------------

Finalize) Summary of 6.1, 6.2

---------------------------------

Summary by 김은민 19.04.29

Revise by 최세현, 박재형 19.04.29

Finalized by 김찬호 19.04.29


quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html

Chapter 6 is about Counting methods and the pigeonhole Principle

in 6.1 we covered some Basic Principles

The first one is the multiplication Principle and is defined as:

 

 

Multiplication Principle

 (Product Rule)

First step is n1

second step is n2

third step is n3

using the principle then the total is n1*n2*n3

 

Example of multiplication principle:

There are two appetizer, three main courses and four beverages.

 

 

 

than, according to multiplication principle, the number of cases of choosing menu is

==> 2 * 3 * 4 = 24

 

 

 

Example  1.1

 

 How many dinners are available from Kay’s Quick Lunch consisting of one main  course and an optional (선택 안해도 되는) beverage?

Also, If we have one more choice that choose nothing,

We just have to add one more case that means nothing.

So the solution of example 1.1 will be

==> 1 * 3 * (4 + 1) = 3 * 5 = 15.

 

Next is the addition principle

it is defined by:

 

Addition Principle

 

Example of addition principle:

 

Example  1.10

 

 In how many ways can we select two books from different subjects among five(5)distinct computer science books, three(3) distinct mathematics books, and two(2) distinct art books?

In this example, we use additional principle to solve.

Find the number of cases that choose two from

science and mathematics

science and art

mathematics and art

, addition the number of these three cases which we found.

 

science and mathematics : 5 * 3 = 15

science and art = 5 * 2 = 10

mathematics and art = 3 * 2 = 6

 

So the answer will be 15 + 10 + 6 = 31

 

 

Next we learned about the Inclusion-Exclusion Principle for two sets

 

 Theorem  1.12

Inclusion-Exclusion Principle for Two Sets

If and are finite sets, then

.

 

 This shows that x and u is equal to (x +y) - (x or y)  

 

***

comment by 최세현 :

It was easy to understand because we have already learned this kind of counting method in high school,

There was a little difficulty to understand about example 1.6, but I understood well now.

 

-----------------------------------------------------------------------

final comment by 김찬호 :
기본적인 principle 들에 대하여 배웠고, 기존에 아는 내용이 많아 이해하기 많이 어렵지는 않았다.

아무리 기본적인 내용이라 하더라도 여러 예제를 통해 확실히 자기 것으로 만드는 것이 중요하다.

곱셈원리와 덧셈원리를 잘 이해하고 상황에 맞게 잘 사용하는 것이 6.1에서 가장 중요한 부분인 것 같다.




----------------------------------

Finalize) Chapter 6 page 314 Problem 20

---------------------------------

Solved by 감광적 19.04.30

Finalized by 박재형 19.04.30



In Exercises 20-27, two dice are rolled, one blue and one red. 

 

Problem 20: How many outcomes give the sum of 4?

 

Solution:

We assume that:

A1: Blue Dice

A2: Red Dice

B: Both dice A1 and A2 are rolled together.

Therefore, the set of all possible outcomes is: {(1,3),(3,1),(2,2)}

Hence, the answer is 3.

 

--------------------


The dices are rolling in same time. And outcome happens in different time.

So we can make (1,3) , (3,1), (2,2). Answer is 3.





----------------------------------

Finalize) Chapter 6 page 314 Problem 21

---------------------------------

Solved by 감광적 19.04.30

Finalized by 박재형 19.04.30


In Exercises 20-27, two dice are rolled, one blue and one red.

 

Problem 21: How many outcomes are doubles? (A double occurs when both dice show the same number.)

 

Solution:

The set of all possible outcomes is: {(1,1), (2,2), (3,3), (4,4), (5,5), (6,6)}

 

---------------------

The dices is rolling in same time. And outcome happens in different time.

 

So we can make (1,1) ,(2,2),(3,3),(4,4),(5,5),(6,6). There are 6 outcomes.



 


----------------------------------

Finalize) Chapter 6 page 314 Problem 22

---------------------------------

Solved by 감광적 19.04.30

Finalized by 박재형 19.04.30


In Exercises 20-27, two dice are rolled, one blue and one red.

Problem 22: How many outcomes give the sum of 7 or the sum of 11?

 

Solution:

The set of all possible outcomes that gives the sum of 7 is: {(1,6), (6,1), (2,5), (5,2), (4,3), (3,4)}

The set of all possible outcomes that gives the sum of 11 is: {(5,6), (6,5)}

Therefore, applying the “Addition Rule”, the answer is 8.

 

-------------------

 

The dices are rolling in same time. (1,6),(6,1),(2,5),(5,2),(4,3),(3,4) are outcomes of sum 7.

And (5,6),(6,5) are outcomes of sum 11.

So we can make (5,6),(6,5)​, (1,6),(6,1),(2,5),(5,2),(4,3),(3,4). The outcomes are 8.

There is no overlapping.​





----------------------------------

Finalize) Chapter 6 page 314 Problem 24

---------------------------------

Solved by 감광적 19.04.30

Finalized by 최세현 19.04.30

Added by 박재형 19.04.30



In Exercises 20-27, two dice are rolled, one blue and one red.​

Exercise 24: How many outcomes have exactly one dice showing 2?

 

Solution:

We will sum the number of cases that Either blue dice or red dice shows 2.​

blue dice shows 2 and red dice shows any number except 2 = 5

red dice shows 2 and blue dice shows any number except 2 = 5

 

Thus, the answer will be 5 + 5 = 10

 

-------------------

if there are same two dice, the outcome is just (2,1), (2,3), (2,4), (2,5), (2,6)​.

There are 5 outcome.





----------------------------------

Finalize) Chapter 6 page 314 Problem 25

---------------------------------

Solved by 감광적 19.04.30

Finalized by 박재형 19.04.30



Problem 25:
How many outcomes have at least one dice showing 2?

 

 

Solution:

The dices that are showing 2 from the blue die are, (2,1), (2,2), (2,3), (2,4), (2,5), (2,6), 6.

The dices that are showing 2 from the red die are, (1,1)(1,2), (2,2), (3,2), (4,2), (5,2), (6,2), 6.

However, the (2,2) shows twice.

Therefore, the possible number of outcomes is 6+6-1=11.

 

(fixed (1,1) to (1,2))​

----------------------

The outcomes of red dice showing 2 are  6. (because of (2,1), (2,2), (2,3), (2,4), (2,5), (2,6)​)

The outcomes of blue dice showing 2 are 6. (because of (1,2), (2,2), (3,2), (4,2), (5,2), (6,2))

There is (2,2) that are overlapping outcomes. The outcome should happen just one time. So​ possible outcomes should be 6+6-1 = 11.



----------------------------------

Finalize) Chapter 6 page 314 Problem 26

---------------------------------

Solved by 감광적 19.04.30

Finalized by 박재형 19.04.30


In Exercises 20-27, two dice are rolled, one blue and one red.

Problem 26: How many outcomes have neither dice showing 2?

 

Solution:

There are 6 faces in each dice,

So, blue die can show any one of five values.

And, red die can show any one of five values.

Therefore, applying the “Multiplication Principles”, the answer is 5*5=25.

 

----------------------------

We can solve this problem in two ways.

 

1. 

Red dice can be chosen 1,3,4,5,6 ---> 5 values.

Blue dice can be chosen 1,3,4,5,6 ---> 5 values.

So we can make ( 0 , 0 ) outcomes. 0 can be input 5 values.

The answer is 5*5 = 25. by Multiplication principles.


2. 

Also we can solve this problem by Subtraction.

All possible outcomes are 6*6 = 36.

And the outcomes showing 2 are 6+6-1 = 11 (solving by Problem 25)

So Answer is 36-11 = 25.


comment : this problem is quite easy to solve. But it must be used the principle of Multiplication. So we can remind this principle with problem.




----------------------------------

Finalize) Answer about ch 6.7 page 324, Exercise 7

---------------------------------

Quest by 김도훈 19.05.11

Finalized by 박재형 19.05.12


Exercise 3

Ch.6.7, Page 324, Exercise 7

 

Question)

Find the coefficient of the term when the expression is expanded.

a2x3; (a+x+c)2(a+x+d)5

 

I don't know how to solve this problem...

Does anyone who can help me?

I tried to solve it with binomial expansion.

 

----------------------------

제 생각에 문제에 주어진 식은 (a+x+c)2(a+x+d)5​가 아니라 (a+x+c)2(a+x+d)​3​인 것 같습니다.

 

지수를 잘못 보신 것 같습니다. 다음은 이 문제 풀이입니다.

a2x3​의 계수를 구하기 위해서는 a가 2번, x가 3번 골라져야 합니다.

(a+x+c)​2​ 에서 a가 1번 x가 1번, a가 2번 x가 0번, a가 0번 x가 2번 골라지는 경우가 있으므로

(a+x+d)​3 에서 a가 1번 x가 2번, a가 0번 x가 3번, a가 2번 x가 1번 골라지는 경우의 계수를 찾으면 됩니다.

 

C(2,1) * C(3,1) = 6

 

C(2,2) * C(3,0) * C(3,3) = 1


C(2,0) * C(2,2) * C(3,2) = 3


6 + 1 + 3 = 10 이 정답입니다.





----------------------------------

Finalize) Summary of 6.3

---------------------------------

Summary by 최세현 19.05.08

Revised by 김두원, 김찬호 19.05.08

Finalized by 박재형 19.05.08


(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html)​

6.3 Generalized Permutations and Combinations

​ 

 

 Theorem  3.2

 

Suppose that a sequence of item has

    identical objects of type ,

    identical objects of type , , and

    identical objects of type .

 Then the number of orderings of is

.

 

This Theorem shows how to count the cases that there are same objects of distinct types.

We count the number of cases of n elements by using factorial ==> n!

But there are same objects, Duplicated cases exist.

So we have to divide it by the number of objects

 

Example of above Theorem :

 

Example  3.1

 

How many strings can be formed using the following letters?

                             

 

There are 11 elements and one M, four i, four S, two P.

So, If we apply above theorem to this example,

the answer will be (11!)/ (4! 4! 2! 1!).

 

****

 

 

 Theorem  3.5

 

 If is a set containing elements, the number of unordered, -element selections  from , repetitions allowed, is

.

 

This Theorem shows how to count the number of cases that Dividing same k elements to t groups.

 

It's same as Combination principle ​8​C​2 = ​8​C​6

 

Example of it :

 

Example 3.4

 

Consider three books; a computer science book, a physics book and a history book. Suppose that the library has at least six copies (should have six copies) of each of these books. In how many ways can we select six books?

In this example, by using above theorem, we have to divide 6 same copies to 3 groups (computer science, physics, and history)

Then, the answer will be ​8​C​2​.

The principle of it is, put two bar that divide 6 same copies to three groups.

If there are 6 copies,

(X X X X X X),

and we put two bars between them,

(XX|XXX|X)

We need 8 positions, and we choose 2 positions of the two bars.

The cases of it is ​8​C​2​.

 

.

 

In this, we can choose t(책의 종류) = 3  k(분류하는 선택지) = 6.

 

 

Theorem  3.5

 

 If is a set containing elements, the number of unordered, -element selections  from , repetitions allowed, is

.

 

this is exciting theorem. and we can apply this at next example.

 

 

Example 3.6

 

 Suppose that there are piles of red, blue and green balls (=3) and that each pile contains at least eight (8=) balls.

 (a) In how many ways can select eight balls?

 (b) In how many ways can select eight balls if we must have at least one ball of each color?


solution)

By Theorem 3.5, the number of ways of selecting eight balls is (공을 3개 상자에 8개 담는 방법) (=3, 8=)

.

We can also use Theorem 3.5 to solve part (b) if we first select one ball of each color. To complete the selection, we must choose five additional balls (5=). This can be done in

 

 

 

The following table summarizes the various formulas:

 

 

No Repetitions

Repetitions Allowed

Ordered Selections

Unordered Selections

 

 

 

//comment by 김찬호

최세현 군의 summary에서 중요한 theorem 과 example을 덧붙였습니다.

6.3장은 저희가 앞에서 배운 순열과 조합의 연장선이고 응용입니다. 내용이 어렵지만 공부하면 다루기 쉬운 부분이라고 생각합니다

 

//comment by 김두원

6.3장의 내용을 훌륭하게 정리한 요약이라고 생각합니다. 마지막에 문제마다 적용할 수 있는 공식을 쉽게 알 수 있는 테이블을 lab에서 참조하여 가져왔습니다. 이 공식들은 까다로운 문제를 쉽게 해결할 수 있는 공식이므로 꼭 숙지해야합니다.

 

// comment by 박재형

조합의 theorem에서 비슷한 이론을 덧붙였습니다. 그리고 예제에 이론이 어떻게 쓰였는지 붙였습니다.

6.3장의 내용은 생각보다 어렵지만 문제를 많이 풀다보면 식을 자유자재로 쓸 수 있을만큼 실력이 향상될 것을 믿습니다. 적용할 수 있는 공식을 이해하고 외운다면 문제를 쉽게 풀 수 있을 것임을 깨달았습니다.



----------------------------------

Finalize) Preview of Ch 7.1, 7.2

---------------------------------

Preview by 채상은 19.05.13

Revised by 김찬호 최세현 19.05.13

Finalized by 박재형 19.05.13


(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html)​

7.1 Introduction


A recurrence relation defines a sequence by giving the th value in terms of its predecessors.

 

Definition  1.1

 

 

The th value is given in terms of the immediately preceding value. In order for a recurrence relation to define a sequence, a “start up” value or values must be given.

These start up values are initial conditions.

A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation.

A recurrence relation for the sequence a0, a1...is an equation that relates a(n) to certian of its predecessors a(0),a(1),.,a(n-1)

Initial conditions for the sequence a(0),a(1).... are explicitly given values for a finite number of the terms of the sequence

 

For example, If we make fibonachi sequence through recurrence relation.

,   .

 Initial conditions are

,    .

 

another example,

 

Let S​n​ denote the number of subsets of an n-element set.

Then recurrence relation is S​n​ = 2 * S​n-1​ (initial condition is S​0​=1)

 

 

7.2 solving recurrence relation.

 

A linear homogeneous recurrence relation of order k with constant codfficients is a rescurrence relation of the form
a(n) = c(1)a(n-1) + c(2)a(n-2)+...+c(k)a(n-k), c(k)!=0

 

 

The recurrence relation in the definition is linear because the righ-hand side is sum of previous terms of the sequence each multiplied by a function of n. The recurrence relation is homogenous because no terms offur that are not multiples of the aj is A linear homogenous recurrence relation of order k with constant coefficient with k initial condition

 

Following are the examples of linear and not linear recurrence relations.

1. is not a linear homogeneous recurrence relation with constant coefficients.

Coefficient is not constant.

 

2. is a linear but nonhomogeneous recurrence relation with constant coefficients.

The right side of the equation is not zero.

 

3. is a ​linear homogeneous recurrence relation with constant coefficients.​

 

comment by 김찬호 :

오늘 재귀적인 알고리즘에 대해 공부한다.

어느 프로그램에서 재귀함수의 사용은 굉장히 유용하고 중요한부분이다.

이 chapter를 잘 공부해서 잘 구현할 수 있는 능력을 길러야겠다.

 

comment by 최세현 :

We will learn about recurrence relations and the methods to solve the problems using reccurence.

We already learned the recursive algorithms in chapter 4 Algorithm, and this chapter is seems to be similar with recursive algorithms in chapter 4. So it was easy to understand.

But still, there are new things to learn, I will prepare for it.

 

comment by 박재형:

7단원에서는 재귀적 알고리즘을 가지는 점화식을 배울 수 있다. 이것은 프로그래밍에서 재귀함수 같은것을 쓸 때 필요한 단원이라 잘 공부해야 겠다.




----------------------------------

Finalize) Tower of Hanoi by team 1

---------------------------------

Solving by 최세현 19.05.15

Revised by 박재형, 김찬호 19.05.15

Finalized by 담딘 바자르 19.05.15


(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html)



                     

 

                    

 

If there are N circles,

1. move the N-1 circles without the biggest circle to the second position. = a​n-1

2. move the biggest circle to third position = 1

3. move the N-1 circles from second position to third position = a​n-1

 

Additional Explanation:

the thing we need to focus is

the largest disc cannot make influence to n-1 disc

so first we ignore the largest disc

and n-1 disc go to 2 place -> a​n-1

and largest disc go to 3 place -> 1

and n-1 disc go to 3 place -> a​n-1

so the equation becomes the following:

2a​n-1​ + 1 =  a​n ​             //​

 

So, the number of movement to move n circles to third position

a​n​ = a​n-1​ + a​n-1​ + 1 = 2a​n-1​ + 1​

The takeaway is we have to know the value of each movement. On top of that, the largest disk can be moved onto the other 2 plates since the outcome would be the same. I think it will be easier to understand if you visualize or see the example of the movements




----------------------------------

Finalize) Team 1 Chpater 7.1 Page 363 Problem 26

---------------------------------

Solving by 김찬호 19.05.19

Revised by 최세현 담딘바자르 19.05.19

Finalized by 박재형 19.05.19

Problem

Show that the Catalan numbers are given by the recurrence relation

 

(n+2)Cn+1 = (4n+2)Cn     n≥0​

 

and initial condition C0 = 1.

 

Solution

We know that the catalan number is

 

Cn = (1/(n+1)) * 2nCn

 

and we can get recurrence relation, divide Cn+1 by Cn

 

C​n+1​ = (1/(n+2)) * ​2n+2C​n+1

Cn = (1/(n+1)) * 2nCn

 

Cn+1/Cn = (4n+2)/(n+2)

 

so we can get

(n+2)Cn+1 = (4n+2)Cn

 

Additional Explanation:

우리는 n번째 Catalan number를 구하는 식을 알고 있으므로,

Cn+1 을 구하는 식과 Cn 을 구하는 식을 연립하면, 문제에서 요구하는

Recurrence 식을 만들 수 있습니다.

 

​As long as we know the term Catalan number and its concept we can easily apply the recurrence here.

Catalan numbers are defined by the formula

  

for and .

 

Catalan numbers are

 

 

Comment by 박재형:

I added calculation about this problem

To solve this problem, we need to know catalan numbers Cn = (1/(n+1)) * 2nCn



----------------------------------

Finalize) Team 1 Chpater 7.1 Page 363 Problem 40

---------------------------------

Solving by 김찬호 19.05.18

Revised by 최세현 담딘바자르 19.05.18

Finalized by 박재형 19.05.18


Question

Use Ackermann function to compute A(2,2) , A(2,3)

 

Solution:

Ackermann function is defined by the recurrence relation.

 

Example  1.10

Ackerman’s Function

 Ackerman’s function is the recurrence relations

 (1.11)               ,                    

 (1.12)               ,         

                                                               .

 The initial conditions

 (1.13)                    ,         

 Ackerman’s function is rapid rate of growth.

http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html

 

A(m,n) = n+1 ( if m=0)

           A(m-1,1)   (if m>0 , n=0)

           A(m-1,A(m,n-1))    (if m>0 , n>0)

 

So we have to follow the recurrence relation in order to find A(2,2) and A(2,3)

 

compute A(2,2)

A(2,2) = A(1, A(2,1))

A(2,1) = A(1, A(2,0))

A(2,0) = A(1,1)

A(1,1) = A(0, A(1,0))

A(1,0) = A(0,1) = 2.

A(1,1) = A(0, A(1,0)) = A(0, 2)= 3

A(2,0) = 3

A(2,1) = A(1,3) = A(0, A(1,2))

A(1,2) = A(0, A(1,1) ) = A (0, 3) = 4

A(2,1) = A(0,4) = 5

A(2,2) = A( 1, 5) = A(0, A(1,4))

A(1,4) = A(0, A(1,3))

A(1,3) = A(0, A(1,2))

A(1,2) = A(0, A(1,1)) = 4

A(1,3) = 5

A(1,4) = 6

A(2,2) = 7.

 

compute A(2,3)

A(1,A(2,2))

A(2,2) = 7 (previous compute)

A(2,3) = A(1,7)

A(1,7) = A(0,A(1,6))

=A(0,8)

=9

 

Answer:

A(2,2) = 7

A(2,3) = 9

Comment by 박재형:

This problem can be solved by Ackerman’s Function

This is course of solving this problem.

 

A(2,2) = A(1,A(2,1)) = A(1,A(1,A(2,0))) = A(1,A(1,A(1,1))) = A(1,A(1,A(0,A(1,0)))) = A(1,A(1,A(0,2))) = A(1,A(1,3))

 

A(1,A(1,3)) = A(1,A(0,A(1,2))) = A(1,A(0,A(0,A(1,1)))) = A(1,A(0,A(0,A(0,A(1,0)))))) = A(1,A(0,A(0,A(0,2))))) = A(1,A(0,A(0,3)))) = A(1,A(0,4))) = A(1,5)

 

--> We can know A(1,3) = 5

 

A(1,5) = A(0,A(1,4)) = A(0,A(0,A(1,3))) = A(0,A(0,5)) = A(0,6) = 7

 

A(2,3) = A(1,A(2,2)) = A(1,7) = A(0,A(1,6)) = A(0,A(0,A(1,5))) = A(0,A(0,7)) = A(0,8) = 9





----------------------------------

Finalize) Team 1 Chpater 7.1 Page 363 Problem 41

---------------------------------

Solving by 김찬호 19.05.18

Revised by 최세현 담딘바자르 19.05.18

Finalized by 박재형 19.05.18


Problem


Use induction to show that

A(2,n) = 3 + 2n (n=0,1,2, ,,, )

 

Solution


A(m,n) is the Ackerman's Function.

It is defined by the recurrence relations.

 A(m,n) = A(m-1, A(m,n-1))

 A(m,0) = A(m-1,1)

 A(0,n) = n+1 (n=0,1,...)

The computation example:

            by

                                         by

                                               by

                                                     by
when n = 0

A(2,0) = A(1,1)

A(1,1) = A(0, A(1,0))

A(1,0) = A(0,1) = 2

A(1,1) = A(0,2) = 3

A(2,0) = 3.

 

Let's assume that n=k.

then A(2,k) = 3+2k

and compute

A(2,k+1)

= A (1, A (2,k))    ->(A(2,k) = 3+2k)

= A (2,k+1) = A (1,3+2k)   

= A (1,3+2k) = A(0,A(1,2+2k)) = 3 + 2k + 2

= 3 + 2 (k+1)

 

Therefore, the given recurrence relation is true.

 

comment by 박재형:

this problem can be solved by Ackerman's Function and Mathematical Induction.

suppose that n=k is true, if n=k+1 is true​, n=k is true -> induction





----------------------------------

Finalize) Team 1 Chpater 7.2 Page 377 Problem 36

---------------------------------

Solving by 김찬호 19.05.18

Revised by 최세현 담딘바자르 19.05.18

Finalized by 박재형 19.05.18


Problem


Solve the recurrence relation for the initial conditions given:

 

an = -2nan-1 + 3n(n-1)an-2

 

Solution


Let's make the equation like

 

an-nan-1 = -3nan-1+3n(n-1)an-2

 

and make an-nan-1 = bn

 

then 

bn = -3n * bn-1

 

so we can make

bn = 3*(-1)n-1 * n! * b1

and the given initial condition is

a1 = 2 , a0 = 1.

so b1 = 1.

 

an-nan-1 = 3*(-1)n-1 * n!

 

So we can make a​n


an = n!(-(3 + (-3)n)/4 + 2)

 

this is the way making a​n

***

Revised and Answered by 최세현:

We have made this

an - nan-1 = 3*(-1)n-1 * n!

then, we know an

an = nan-1 + (-3)n-1 * n!

If we follow and calculate the recurrence relation of above equation, to an-2,n-3,n-4,...

we get following equation:

an = (-3)n-1 * n! + (-3)n-2 * n! + (-3)n-3 * n! + (-3)n-4 * n! + ... + (-3)1 * n! + n!*a1

Since initial state a1 = 2

an = n!((-3)n-1 + (-3)n-2 + ... + (-3)1 + 2)

and, (-3)n-1 + ... + (-3)1 is the sum of the geometric sequence.

So we use it to find the sum of the geometric sequence,

a is -3, r is -3, n is n-1

-3(1 - (-3)n-1)/(1+3) = -(3 + (-3)n)/4


Thus, the answer is:

an = n!(-(3 + (-3)n)/4 + 2) 

 

comment by 박재형:

we should know about sum of geometric sequence's expression to solve this problem.

a(1-r​n​)/​(1-r) is sum of a+ar​1​+ar​2​+...+ar​n-1​.





----------------------------------

Finalize) Team 1 Chpater 7.1 Ackerman’s Function

---------------------------------

Explained by 김찬호 19.05.18

Revised by 최세현 담딘바자르 19.05.18

Finalized by 박재형 19.05.18


Explanation


Example  1.10

Ackerman’s Function

 Ackerman’s function is the recurrence relations

 (1.11)               ,                    

 (1.12)               ,         

                                                               .

 The initial conditions

 (1.13)                    ,         

 Ackerman’s function is rapid rate of growth.

 

Ackerman's function is the function that represent the recurrence relation.

but the rate of growth is very rapid.

(for example, If we find A(1.2), the result is 4, it is very small number we can easily find

But, If we find the result by using a little bigger number, 4or3 ==> A(4,3)


There will be a lot of calculation, and the result is very big number.)

we can get more information from here : https://ko.wikipedia.org/wiki/아커만_함수

 

So if you put big number. it cannot work well. even in computer.

So to solve problem efficiently, make a general term in each case. and solve it.

However, Ackerman's function is often used to analyze the complexity of algorithms.

 

for example, in Chapter 7.1 Page 363 Problem 40 we have to compute A(2,2)

 

A(2,2) = A(1, A(2,1))

A(2,1) = A(1, A(2,0))

A(2,0) = A(1,1)

A(1,1) = A(0, A(1,0))

A(1,0) = A(0,1) = 2.

A(1,1) = A(0, A(1,0)) = A(0, 2)= 3

A(2,0) = 3

A(2,1) = A(1,3) = A(0, A(1,2))

A(1,2) = A(0, A(1,1) ) = A (0, 3) = 4

A(2,1) = A(0,4) = 5

A(2,2) = A( 1, 5) = A(0, A(1,4))

A(1,4) = A(0, A(1,3))

A(1,3) = A(0, A(1,2))

A(1,2) = A(0, A(1,1)) = 4

A(1,3) = 5

A(1,4) = 6

A(2,2) = 7.

http://icampus.ac.kr/front/study/QnaAction.do?method=view&lmsBdotSeq=2929466&lmsBlbdId=394928&isRply=Y


In this problem, we use general terms to solve this problem.




----------------------------------

Finalize) Team 1 Chpater 7.2 Page 377 Problem 15

---------------------------------

Solved by 김찬호 19.05.18

Revised by 최세현 담딘바자르 19.05.18

Finalized by 박재형 19.05.18


Question

Solve the given recurrence relation for the initial condition given:

an = 6an-1 - 8an-2

a0 = 1, a1 = 0

 

(Combined both 최세현 and 박재형​'s revisions.​)

Solution with 최세현​'s Revision:

let's make the characteristic equation.

(using theorem 7.2.11)

t2 -6t +8 = 0.

t = 2, 4.

 

so we can make

an = A2n + B4n

 

and substitute the initial condition and we get

(we have a0 = 1 , a1 = 0 So,

a0 = 1 = A + B

a1 = 0 = 2A + 4B

2A+2B -2 = 2A + 4B

2B = -2

B = -1, A = +2)

 

an = 2n+1 - 4n

 

Answer:

an = 2n+1 - 4n

Solution with 박재형​​'s Revision:

Theorem  2.11

 

                        

http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html

 

We can use theorem 2.11 in chapter 7

 

t​2​ -6t +8 = 0.

t = 2, 4.

so we can make a​n​ = A2​n​ + B​4​n

and a​0​ = 1, a​1​ = 0​

 

a​0​​ = A+B = 1

a​1​= 2A +4B = 0

 

A = 1-B

2B + 2  = 0

B = -1

A = 2

Answer: a​n​ = 2​n+1​ - 4​n ​​



----------------------------------

Finalize) Team 1 Chpater 7.2 Page 377 Problem 18

---------------------------------

Solved by 김찬호 19.05.18

Revised by 최세현 담딘바자르 19.05.18

Finalized by 박재형 19.05.18

Problem

Solve the given recurrence relation for the initial conditions given:

2an = 7an-1 - 3an-2      a0 = a1 = 1.

 

Solution

make the characteristic equation

2t2 - 7t +3 = 0

t=3, 1/2

 

so we can make

an = A3n + B(1/2)n

 

and put initial condition, and we can get

 

a​0​ = A + B =1

a​1​ = A*3 +B *(1/2) = 1

 

A = 1-B

3 - 5/2 *B = 1

B = 4/5

A = 1/5

 

So, a​n ​= 1/5*3​n​ + ​4/5 * (1/2)​n

= ( 2​2-n​ + 3​n​ ) /5

 

an = (22-n + 3n)/5

***

(using theorem 7.2.11, we can easily solve the equation which is represented by an,n-1,n-2,...

In this case, using the coefficients of the an,n-1,n-2, we make the quadratic equation

2an ,7an-1, -3an-2 ==> 2t2 - 7t + 3 = 0

and by using the solution "t" from above equation, (t = 3, 1/2)

we make the form like this : an = p3n + q(1/2)n

Since we know the a0 and a1, we can easily find the value of p and q)


 

Answer:

an = (22-n + 3n)/5

 

 

 Theorem  2.11

 

http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html

 

Comment by 박재형:

I added the way of calculating recurrence relation by initial condition.

We know about this equation to solve this problem.


---------------------------------

Finalize) Team 1 Chpater 7.2 Page 377 Problem 21

---------------------------------

Solved by 김찬호 19.05.18

Revised by 최세현 담딘바자르 19.05.18

Finalized by 박재형 19.05.18


Problem

Solve the given recurrence relation for the initial conditions given:

an = -8an-1 -16an-2     a0 = 2, a1 = -20

 

Solution

make the characteristic equation

t2 +8t +16=0.

t=-4

In this case, the equation has both roots that are equal to -4. (same two root)

We use theorem 7.2.14

 

 Theorem  2.14

 

http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html

 


Since there are the same two root from the quadratic equation,

Multiplying by 'n' to the one of the elements of the an = brn + drn is necessary

 

and we can make

an = A(-4)n + Bn(-4)n

 

and put the initial condition.

 

a​0​= A = 2

A = 2


a​1​ = A(-4) + B(-4) = -20

-4*B + -8 = -20

B = 3

 

So we know A=2, B=3

 

we can get

an =2(-4)n +3n(-4)n

 

Answer:

an =2(-4)n +3n(-4)n  

 

Comment by 박재형:

I added the calculation of equation by initial condition.

we can know that the second order linear homogeneous recurrence relation with constant coefficients can be express by equation like a​n​ = b​r​n​ + dnr​n​.





----------------------------------

Finalize) Team 1 Chpater 7 Recurrence Relation of Derangement

---------------------------------

Explained by 김찬호 19.05.18

Revised by 최세현 담딘바자르 19.05.18

Finalized by 박재형 19.05.18


In the last QnA. We explain the concept of derangement.

(The meaning of derangement is,

Ordering the numbers(1,2,3,4...,n) while satisfying the condition

that the number k must not be in the kth position.

Dn is the number of the above cases)

 

So this time I want to make the recurrence relation of derangement.

 

So 

Dn = nth number of derangement.

 

and 

Dn = (n-1)(Dn-1+Dn-2)


(Explanation about the equation :

we must not assign the number k to the kth position,

So we first assign arbitrary kthposition with the numbers which are not k.

the number of this cases is n-1. (all the numbers without k)


After we assign the number 'p' to the kth position, There are two different cases.

one is that assigning the number 'k' to the pth position.

(Since we complete assigning two positions (kth, pth), we have to assign n-2 positions = Dn-2)

and the other one is not to assign the number 'k' to the pth position.

(we completed assigning one position, we have to assign n-1 positions = Dn-1)


two cases are Dn-1 and Dn-2, So we add two different cases and multiply by (n-1)

Thus, the number of the derangement Dn = (n-1)(Dn-1 + Dn-2)

 

Dn - nDn-1 = Dn-1 - (n-1)Dn-2

 

Dn - nDn-1 = (-1)n-2(D2-2D1)

 

the initial condition : D1 = 0, D2 = 1.

 

then we can make

 

Dn - nDn-1 = (-1)n-2

Dn = nDn-1 + (-1)n-2

 

and we divide this equation by n!

Dn / n! = Dn-1 / (n-1)! + (-1)n-2 / n!

 

so we can add this sequence

 

(-1)​n-2​/n!

+

(-1)​n-3​/(n-1)!

+

.

.

.

+

D​1​/0! + (-1)​0​/0!       (D​1​/1! = 0 by initial condition)

 

so we can make this equation

 

Dn / n! = (from k=0) ∑k=n(-1)k/k!

 

and finally we can make

Dn  =n! * (from k=0) ∑k=n(-1)k/k!

 

​A simple real life example would be:


Kid(n) has Apple(n)

Kid1 has Apple1, therefore, there is no other option than choosing Apple1. The answer is 0.

If there are 2 kids and 2 apples. Then, Kid1 can have Apple2 and Kid2 can have Apple 1. Therefore, each kid has the other option of choosing the other apple whose possibility is 1. So, the answer is 1. Basically, it's all about counting all the possibilities of (n) choosing other options than its correct option, or matching its correct position.

 

comment by 박재형:

i added the way of obtain equation.

This recurrence relation of derangement is some difficult equation but we can see and understand know about this equation's principle by thinking about example.


----------------------------------

Finalize) Team 1 Review of Chapter 7

---------------------------------

Explained by 김찬호 19.05.20

Revised by 최세현 담딘바자르 19.05.20

Finalized by 박재형 19.05.20

(​quoted from http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html)​

Chapter 7   Recurrence Relations

 

 7.1   Introduction

 7.2   Solving Recurrence Relations

 7.3   Applications

 

 

Definition  1.1

 

 

so we learned about the definition of recurrence relation.

and next we make recurrence relation about Fibonacci sequence what we learned before.

 

 

Example  1.2

 

 The Fibonacci sequence is the recurrence relation

,   .

 Initial conditions are

,    .

 

 

and we learned about tower of Hanoi.

 

If there are n disks,

we first move the n-1 disks without the biggest disk to the second position.

and then, move the biggest disk to the third position.

and lastly, move the n-1 disks from the second position to the third position.

 

we move n-1 disks twice, and move the biggest disk one time.

So the number of the movement of n disks will be

A​n​ = 2​A​n-1​ + 1

 

 

and next we learned about How to solving recurrence relation.

 

here is one example.

 

Example  2.1

 

 By iteration, solve the recurrence relation

.

 The initial condition is

.

 

Solution

Replacing by in , we obtain

                                  .

                                            

                                   

(2.2)                               

Replacing by in , we obtain

                                  .

                                            

                                   

                                   

In general,

.

Setting in this last expression, we have

.

Taking , we obtain

for the sequence .

 

and we learned about homogeneous recurrence relation

 

 

Definition  2.6

 

 

How to solve it?

We can make characteristic equation and make the solution!

 

When the given value is distinct:

 

Theorem  2.11

 

 

We can solve it like this!.

(of course this is linear and constant coefficient)

 

What if we have double root?

then we can solve it like

 

Theorem  2.14

 

 

 

Comment by 김찬호:

우선 이번 chapter 7에서 recurrence relation에 대해 배웠다.

항이 linear하게 여러개로 이어져도 주어진 방법과 initial condition을 잘 대입하면 다 구할 수 있다는 확신이 든다.

그리고 그동안 어렵게 다가왔단 재귀적인 관계를 잘 이해하게 되었다. 하노이 타워같은 고전적인 재귀과정을 갖는 문제도 이제는 완벽하게 풀 수 있을 것 같다.

 

Comment by 최세현:​​​

이번 챕터에서 많은 새로운 것들을 알게되었다.

7.1단원에서는 피보나치 수열이나, 하노이 타워 같은 익숙한 문제들을 다뤘지만,

7.2단원부터 linear homogeneous recurrence, derangement, n차 방정식으로의 표현과 같은 흥미로운 개념들을 배워 좋았다. 7.2.11 이나 7.2.14같은 어려운 theorem들의 증명방식을 보며, 어려웠지만 이해할 수 있었고, recurrence relation이 무엇인지, 관련문제는 어떻게 푸는 것인지 확실하게 알게되었다.

 

Comment by 담딘바자르​:

Recurrence Relation might sound very pragmatic and overwhelming at first, but basically it's an equation that defines a recursion (repeat) of a sequence. Additionally, Constant Coefficients are fixed real numbers.​

 

Comment by 박재형:

7단원에서 하노이 타워에 대해서 공부하면서 재귀적 관계를 가지는 점화식에 대해 좀더 깊은 이해를 할 수있었고, 다른 문제들을 보면서 Derangement나 다른 recurrence relation에 대해 많은 공부를 할 수 있었다.

----------------------------------

Finalize) Team 1 Chpater 7 Page 342 Problem 19

---------------------------------

Solved by 박재형 19.05.22

Revised by 최세현 담딘바자르 19.05.22

Finalized by 김찬호 19.05.23


Problem

Refer to the sequence S where S​n​ denotes the number of n-bit strings that do not contain the pattern 00.

 

Find a recurrence relation and initial conditions for the sequence {S​n​}

 

Solution

 // I think the best way to see the sequence is to see it in binary. For example: 1 bit binary has 2 values, 2 binary has 4 values etc. On top of that, once we see the first 2 sequences and we can apply the Addition Principle.

 

 

S​1​ = 0, 1  -> 2

S2 = 00, 01, 10, 11 -> 3

S3 = 000, 001, 010, 011, 100, 101, 110, 111 -> 5

​ S3 = 01(S1's bits) + 1(S2's bits)

 

We have made the sequence that does not have the pattern 00, (S​n-1,n-2,n-3...​)

So we can make S​n​ by using previous sequences.

If S​n​ starts with 1, we can make S​n​ by just adding the S​n-1​ after first one bit(1).

If S​n​ starts with 0, there is possibility that the pattern 00 appears. (start with 00)

So we have to make sure that S​n​ starts with 01, and just add S​n-1​ after first two bits(01)

 

Initial condition S1 = {0,1}= 2 , S2 ={01,10,11} = 3​

​ Sn = Sn-1 + Sn-2 (n>2) ■

 

 

 (quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html​)


[ Example  1.6 ] denote the number of -bit strings that do not contain the pattern .

 Develop a recurrence relation for , , and initial conditions that define the sequence .

 We will count the number of -bit strings that do not contain the pattern .

 (a) that begin with

 (b) that begin with

 (c) that begin with


Comment by 김찬호:


case를 나눠서 처음부터 하나씩 해보며 진행해나가면 일반항을 추론 할 수 있는 문제이다.

처음 보면 잘 해결되지 않을 수 있기 때문에 천천히 solution을 잘 따라가며 해석하면 충분히 좋은 문제라고 생각한다.





----------------------------------

Finalize) Team 1 Chpater 7 Page 342 Problem 20

---------------------------------

Solved by 박재형 19.05.22 Revised by 최세현 담딘바자르 19.05.22

Finalized by 김찬호 19.05.23

Problem 

Refer to the sequence S where S​n​ denotes the number of n-bit strings that do not contain the pattern 00

Show that S​n​ = f​n+2​, n=1,2,..., where f denotes the Fibonacci sequence.

 

Solution

 (quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html)

 The Fibonacci sequence is the recurrence relation

,   .

 Initial conditions are

,    .

Let   S​n​=S​n-1​+S​n-2​ (n>2)

 // In Fibonacci, the next number is calculated by adding the 2 numbers before it.

Fibonacci sequence : F​n​ = F​n​-1​+F​n-2​ (Initial condition F​1​=1,F​2​=1)

S​1​ = 2

S​2​ = 3

S​3​ = S​1​ + S​2

= 2 + 3 = F​3​ + F​4​ = F​5

...


​S​n​ = F​n​ + F​n+1​ = F​n+2​ ■

Answer

S​n​ = f​n+2

It can be connected. 

Comment by 김찬호:

주어진 식을 전개하여 fibonacci와 연계시키는 문제입니다.

주어진 조건을 잘 활용하여 전개하다보면 쉽게 연결 가능합니다.


Finalize) Team 1 Chpater 7 Page 356 Problem 11

---------------------------------

Solved by 박재형 19.05.22 Revised by 최세현 담딘바자르 19.05.22

Finalized by 김찬호 19.05.23

Problem
Solve the given recurrence relation for the initial condition given:

a​n​= -3a​n-1

Initial condition : a​0​ = 2

 

Solution

This relation is linear non homogeneous.

a​0​ = 2

a​1​ = 2 * -3

a​2​ = 2 * -3 * -3 ...

​ a​n​ = 2 * (-3)​n

Answer

a​n​ = 2 * (-3)​n​ ​■

 We can also use the theorem using n-th order equation, but this time with quadratic equation

 

t​2 +3t = t(t+3)

t= 0, -3

 

an = d(-3)^n

 initial condition : a0 =2

                       ∴ d=2.

Answer

a​n​= 2(-3)​n

 //Comment by 김찬호

주어진 recurrence relation을 두가지 방법으로 해결하였다.

두가지 방법 모두 어렵지 않고 중요한 부분이므로 확실하게 알고 넘어가는 것이 좋다


----------------------------------

Finalize) Team 1 Chpater 7 Page 356 Problem 12

---------------------------------

Solved by 박재형 19.05.22

Revised by 최세현 담딘바자르 19.05.22

Finalized by 김찬호 19.05.23


Problem


Solve the given recurrence relation for the initial condition given:

a​n​=2n*a​n​-1

 

Initial condition: a​0​=1

 

Solution


a​n​=2n*a​n​-1​ is not linear homogeneous recurrence relation

because the coefficient 2n is not constant.

 

a​1​=2*1*1 (​ a​0​=1)

a​2​ = (2*2)*(2*1*1)

a​3​ = (2*3)*(2*2)*(2*1)

a​4​ = (2*4)*(2*3)*(2*2)*(2*1)

...

​ a​n​ = 2​n​*n! (n≥0) ■

 

We can easily find out that 2 is being multiplied by n times, and there is n factorial.

Simply, substituting in this problem solves it. We can see the relation easily by substituting in each sequence.

 

//comment by 김찬호:

처음 초기값을 사용해 식을 전개해서 일반화하는 문제이다.

a​0​를 이용해서 다음 항들을 구하다 보면 쉽게 일반항을 추론할 수 있다.

----------------------------------

Finalize) Team 1 Chpater 7 Page 356 Problem 3

---------------------------------

Solved by 박재형 19.05.22

Revised by 최세현 담딘바자르 19.05.22

Finalized by 김찬호 19.05.23

Problem


Tell whether or not each recurrence relation in Exercise 1-10 is a linear homogeneous recurrence relation with constant coefficients. Give the order of each linear homogeneous recurrence relation with constant coefficients

 

a​n​ = 2na​n-2​ - a​n-1

 

Solution


This is not linear homogeneous recurrence relation.

Because a​n-2​'s coefficient 2n is not constant.

And, there is a​n-1​ and a​n-2​, the relation is the second order ■

 

 quoted from: http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html

 

 The recurrence relations  is not a linear homogeneous recurrence relation with constant coefficients.

 Coefficient is not constant.  is a linear homogeneous recurrence relation with nonconstant  coefficients.

  

Comment by 김찬호:

​주어진 식이 상수 계수를 가지지 않으므로 linear homogeneous recurrence relation이라고 할 수 없다.

강의 자료를 참고하여 확인하면 확실하게 알 수 있다.

----------------------------------

Finalize) Team 1 Chpater 7 Page 356 Problem 4

---------------------------------

Solved by 박재형 19.05.22 Revised by 최세현 담딘바자르 19.05.22

Finalized by 김찬호 19.05.23


Problem


Tell whether or not each recurrence relation is a linear homogeneous recurrence relation with constant coefficients. Give the order of each linear homogeneous recurrence relation with constant coefficients​.

And Solve the given recurrence relation for the initial condition given.

 

a​n​ = a​n-1​ +n (linear non homogeneous)

initial condition : a​0​ = 0

 

Solution

This is not homogeneous recurrence relation.

Because the expression on the right side of the equation is not zero. ( a​n​ - a​n-1​ = n)

 

This can be said to be linear ​non ​homogeneous recurrence relation.

 

​a​n​ = 1+2+3+...+n (n>=0) (​ a​0​ = 0) ■

 

Answer

a​n​ = n(n-1)/2

  

quoted from: http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html


Comment by 김찬호:

주어진 식에 characteristic equation을 사용한 풀이를 적용할 수 없으므로

일반항으로 전개하면서 규칙성을 발견하여 해결한다.


----------------------------------

Finalize) Team 1 Chpater 8.2 Page 396 Problem 1,2,3,4

---------------------------------

Solved by 박재형 19.05.22

Revised by 김찬호 담딘바자르 19.05.23

Finalized by 최세현 19.05.25


Problem

 

Tell whether the given path in the graph is

(a) A simple path

(b) A cycle

(c) A simple cycle

 


 

 

1.(b,b)

2.(e,d,c,b)

3.(a,d,c,d,e)

4.(d,c,b,e,d)

 

Solution


(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-Ch-8-Lab.html​)

 

 Definition  2.14

 


 

1. The path (b,b) have repeated vertex. so (b,b) is not simple path. It is a cycle and simple cycle.

2. (e,d,c,b) is a simple path. It's not cycle, and is not simple cycle.

3. (a,d,c,d,e) is not simple path ,is not cycle, and is not simple cycle.

4. (d,c,b,e,d) is not simple path but it is cycle and simple cycle because no repeated vertex.

 

With the definition above, we can easily define the vertex.

 

//comment by 김찬호

우리는 simple path, cycle, simple cycle 에 대해 정의하고 쓸 수 있다. 문제에 주어진 1,2,3,4 경로를 주어진 정의를 적용하여 해결할 수 있다.

//comment by 최세현

2번에 simple cycle도 아니라는 설명을 추가했습니다.

simple path, cycle, simple cycle의 정의를 이용해 직관적으로 문제를 해결할 수 있었습니다.





----------------------------------

Finalize) Team 1 Chpater 8.2 Page 396 Problem 10

---------------------------------

Solved by 박재형 19.05.22

Revised by 김찬호 담딘바자르 19.05.23

Finalized by 최세현 19.05.25


Problem

Draw a graph having the given properties or explain why no such graph exists.

10. Six vertices each of degree 3

 

Solution

we can draw six vertices

 


 

And these vertices have degree 3

 

 

 Theorem  2.18

 

 

 

​This graph has Euler cycle by the theorem above.


----------------------------------

Finalize) Team 1 Chapter 8 Page 407 Problem 8

----------------------------------

Solved by 김찬호, Date : 2019. 05. 28

Revised by 장용식, Date : 2019. 05. 28

Revised by 최세현, Date : 2019. 05. 28

Revised by 담딘바자르, Date : 2019. 05. 29

Finalized by 박재형, Date : 2019. 05. 29​

Problem

Show that this graph has a path from a to a  that passes through each edge exactly one time by finding such a path by inspection

 


Solution 1

we can find (a , c , e , b , c , d , e , f , d , b, a)


Solution 2

There is such theorem.


We can see that in graph, degree of each vertex is even.

So given graph has 'Euler cycle'

Euler cycle : the cycle that visits every edge just one time.

 

​Comment by 최세현:

​We can easily find out if the graph has Euler cycle by counting the degree of the every vertex.

And if the graph is simple, we can find out by just drawing some paths.

 

Comment by 담딘바자르​:

As thoroughly explained by 최세현​, we can easily solve the problem by drawing keeping in mind that the graph has Euler cycle.

 

Comment by 박재형:

we can find the path by starting a, and we can end this with vertex a. This can be called Euler cycle because this graph is connected and even degree in vertex.




----------------------------------

Finalize) Team 1 Chapter 8 Page 407 Problem 8

----------------------------------

Solved by 김찬호, Date : 2019. 05. 28

Revised by 장용식, Date : 2019. 05. 28

Revised by 최세현, Date : 2019. 05. 28

Finalized by 박재형, Date : 2019. 05. 29​


Problem

​For each graph G = (V, E) in Exercises 11–13, find V , E, all

parallel edges, all loops, all isolated vertices, and tell whether G

is a simple graph. Also, tell on which vertices edge e1 is incident.

 

 

Solution


V = {v1, v2, v3, v4} , E = {e1,e2,e3,e4,e5,e6}

 //In graph theory, parallel edge (also called multiple edges or a multi-edge), are two or more edges that are incident to the same two vertices.

 

in this graph, e1 and e6 are parallel edges.

e5 is a loop

there is no isolated vertices.

this graph is not a simple graph, and e1 is incident on v1 and v2​

 

Comment

parallel edges

Edges which are both associated with the vertex pair are called parallel edges.

 

 

loop

An edge incident on a single vertex is called a loop.

 

 

simple graph

A graph with neither loops nor parallel edges is called a simple graph.

 

incident

There is an edge in a graph that is associated with the pair of vertices v and w. Then a edge is said to be incident on v and w.

 

​Comment by 최세현 :

​This problem is asking the general terms and concept of the graph.

we can easily find out parallel edges, loops, isolated vertices, incident, and if the graph is simple graph.

 

Comment by 박재형 :

This graph's problem can be solved by parallel edge and simple graph's principle. I didn't know about this principle but I have knowledge about this by solving this problem.



----------------------------------

Finalize) SKKU DM Team 1 Chapter 8.2 Page 417 Problem 19

----------------------------------

Solved by 김찬호, Date : 2019. 05. 28

Revised by 박재형, Date : 2019. 05. 29

Revised by 최세현, Date : 2019. 05. 29

Finalized by 담딘바자르, Date : 2019. 05. 29

 

 

 

Problem

Find all the simple cycle in this graph

 

Solution

In graph theory, a cycle means, start from one node and we can come back to start_node.

Simple cycle means, in the path there is no repeated node.

thus:

 

1. (a, a)

2. (b, c, g, b)

3. (b, c, d, f, g, b)

4. (b, c, d, e, f, g, b)

5. (c, g, f, d, c)

6. (d, f, g, b, c, d)

7. (d, f, e, d)

are simple cycles.​

 

Comment by 박재형: There are 7 simply cycles. We can find this by starting from a, b,c,d.

Comment by 최세현: I added 2 more cycles it can be simple cycle.

Comment by 담딘바자르​: ​In total, there are 7 unique simple cycles in the graph.



----------------------------------

Finalize) SKKU DM Team 1 Chapter 8 Page 396 Problem 22​

----------------------------------

Solved by 박재형, Date : 2019. 05. 28

Revised by 김찬호, Date : 2019. 05. 28

Revised by 최세현, Date : 2019. 05. 28

 Finalized by 담딘바자르, Date : 2019. 05. 29​​

Problem

 

Find the degree of each vertex for the following graph​

 


 

Solution

 

The degree of each vertex is the number of adjacent vertices.

 

so, v1 = 4

v2 = 4

v3 = 4

v4 = 4

v5 =4

 

Answer

Each vertex has 4 edges.

 

//comment by 김찬호

Degree of vertex는 vertex의 연결된 edge의 개수이므로 쉽게 구할 수 있다.

//comment by 최세현

Vven if the figure of the graph is complex, we can easily find out the number of edges connected to the vertices.

//comment by 담딘바자르​

To count the number of degrees, we only need vertex endpoints on a single node connected to the vertex.


----------------------------------

Finalize) SKKU DM Team 1 Chapter 8.3 Page 406 Problem 1

----------------------------------

Solved by 박재형, Date : 2019. 05. 28

Revised by 김찬호, Date : 2019. 05. 28

Revised by 최세현, Date : 2019. 05. 28
Finalized by 담딘바자르, Date : 2019. 05. 29​​

Problem

Find a hamiltonian cycle in the graph:

 

 

 

 

Solution

Hamiltonian cycle is

 

(d, a, e, b, c, h, g, f, j, i, d)

 

it must be once vertex.

 

 

Comment by 김찬호:

Hamilton cycle은 모든 정점을 한번씩만 지나가는 경로이므로,

(d, a, e, b, c, h, g, f, j, i, d)와 같이 그릴 수 있다.

Comment by 최세현:

Hamilton cycle is the path that visiting a vertex exactly one time and returning to the initial vertex.

Hamilton cycle decision problem is NP-Complete. So it is very hard to solve.

Comment by 담딘바자르​:

Hamilton cycle is similar to maze puzzle, in which there are many different paths, but there is only path that would lead to the goal. Likewise, hamilton cycle has different nodes, but every node doesn't have to be covered, only vertexes have to be met to make a cycle (repeating without any duplicated vertex).




----------------------------------

Finalize) SKKU DM Team 1 Chapter 8.3 Page 406 Problem 3

----------------------------------

Solved by 박재형, Date : 2019. 05. 28

Revised by 김찬호, Date : 2019. 05. 28

Revised by 최세현, Date : 2019. 05. 28

Finalized by 담딘바자르, Date : 2019. 05. 29​​

 

​​Problem 

Show that none of the graph contains a hamiltonian cycle.

 

Solution

this graph can't have path with once vertex.

 

Rectangle in rectangle can be hamiltonian cycle but if there are vertices like this picture, we can't make simple cycle with once vertex.

 

 

Comment by 김찬호 :

hamilton cycle은 모든 vertex를 한 번만 지나는 경로이다.

주어진 그래프에서는 hamilton cycle을 찾을 수 없다.

 

Comment by 최세현 :

​It is very hard to determine if there is a hamilton cycle.
But with the above graph,

because the graph is symmetry, we can find out by trying every path that can be done.

there are no such path. So there is no hamilton cycle.

 

Comment by 담딘바자르:​

​As explained by 최세현, ​since the graph is symmetrical on from every 4 endpoints (a, e, l, h)​, we can solve more easily because there is no hamiltonian cycle. Basically, we could've solved the problem by cutting the graph in half.



 



----------------------------------

Finalize) SKKU DM Team 1 Chapter 8.1 Page 382 Problem 2

----------------------------------

​​Solved by 최세현, Date : 2019.05.28

Revised by 담딘바자르, Date : 2019.05.29

Finalized by 박재형, Date: 2019.06.08​

Problem

In a tournament, the Snow beat the Pheasants once, the Skyscrapers beat the Tuna once, the Snow beat the Skyscrapers twice, the Pheasants beat the Tuna once, and the Pheasants beat the Snow once. In Exercises 1–4, use a graph to model the tournament. The teams are the vertices. Describe the kind of graph used (e.g., undirected graph, directed graph, simple graph).


Exercise 2 : There is an edge from team t​i​ to team t​j​ if t​i​ beat t​j​ at least one time.


Solution


Since we have to represent the winner which team has beat the other by directed edge.

Thus, we use the directed graph and the graph should be like above figure.

 

Comment by 담딘바자르:​

​The graph is directed to indicate which team beats which team.

Furthermore, the snow and the pheasants beat each other once, so there should be cycle.

Comment by 박재형:

This solution is to draw the graph that team beats which team.

It can be draw to cycle between snow and pheasants. This graph is direct graph because it has direction.

Definition about simple  path :
A  simple path is a path without duplicate vertices except for the first vertex and  the end vertex

Definition  about cycle​ :

Starting from the first node and then back to  the first node

Definition about simple cycle :

A simple cycle is a cycle without  dupulicate node except for the first node

 

In this question we can find subgraph  such as






Suppose each vertex has an edge. Select a vertex v​0, along the edge of v​0 to  reach the vertex v​1. Then along the edge of  v​i to reach the vertex v​i+1. Because there is a finite number of vertices, it will  eventually return to a certain vertex passing by. At this time, we get a loop,  which is a contradiction. So at least one vertex does not have an edge.

 

Comments

How to proof in mathematical  induction

Suppose that there are infinite vertex.  Then select a vertex v​0, along the edge of v​0 to  reach the vertex v​1.  Then along the edge of v​i to  reach the vertex v​i+1. If this process keep going, the graph  depth is infinte.

So there are finite number of  vertices and at because of contradiction at least one vertex does not have an  edge

Chapter 8. Graph Theory

(page 407. Number11)

Solved by 김찬호(2019.5.28)

Revised by 최세현(2019.5.28)

Finalized by 박재형(2019.5.29)

Reference: 1. Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition


Problem

For each graph G = (V, E) in Exercises 11–13, find V , E, all

parallel edges, all loops, all isolated vertices, and tell whether G

is a simple graph. Also, tell on which vertices edge e1 is incident.

 

 

Solution)

 

V = {v1, v2, v3, v4} , E = {e1,e2,e3,e4,e5,e6}

 //In graph theory, parallel edge (also called multiple edges or a multi-edge), are two or more edges that are incident to the same two vertices.

 

in this graph, e1 and e6 are parallel edges.     

 

e5 is a loop

 

there is no isolated vertices.

 

this graph is not a simple graph, and e1 is incident on v1 and v2

 

Comment

parallel edges

Edges which are both associated with the vertex pair are called parallel edges.

 

loop

An edge incident on a single vertex is called a loop.

 

      simple graph

A graph with neither loops nor parallel edges is called a simple graph.

 

incident

There is an edge in a graph that is associated with the pair of vertices v and w. Then a edge is said to be incident on v and w.

 

Comment by 최세현 :

This problem is asking the general terms and concept of the graph.

we can easily find out parallel edges, loops, isolated vertices, incident, and if the graph is simple graph.

 

Comment by 박재형 :

This graph's problem can be solved by parallel edge and simple graph's principle. I didn't know about this principle but I have knowledge about this by solving this problem.


 



Chapter 8. Graph Theory

(page 417. Number19)

Solved by 김찬호(2019.5.28)

Revised by 최세현(2019.5.28)

Finalized by 박재형(2019.5.29)

Reference: 1. Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition




 

Problem

Find all the simple cycle in this graph

 

Solution)

In graph theory, a cycle means, start from one node and we can come back to start_node.

Simple cycle means, in the path there is no repeated node.

thus:

1. (a, a)

2. (b, c, g, b)

3. (b, c, d, f, g, b)

4. (b, c, d, e, f, g, b)

5. (c, g, f, d, c)

6. (d, f, g, b, c, d)

7. (d, f, e, d)

are simple cycles.                      

 

Comment by 박재형: There are 7 simply cycles. We can find this by starting from a, b,c,d.

Comment by 최세현: I added 2 more cycles it can be simple cycle.

Comment by 담딘바자르: In total, there are 7 unique simple cycles in the graph.

Chapter 8. Graph Theory

(page 396. Number22)

Solved by 김찬호(2019.5.28)

Revised by 최세현(2019.5.28)

Finalized by 박재형(2019.5.29)

Reference: 1. Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition



Problem

 

Find the degree of each vertex for the following graph

 


 

Solution)

 

The degree of each vertex is the number of adjacent vertices.

so,






Answer

Each vertex has 4 edges.                   

 

//comment by 김찬호

Degree of vertex는 vertex의 연결된 edge의 개수이므로 쉽게 구할 수 있다.

//comment by 최세현

Vven if the figure of the graph is complex, we can easily find out the number of edges connected to the vertices.

//comment by 담딘바자르

To count the number of degrees, we only need vertex endpoints on a single node connected to the vertex.

 


Chapter 8. Graph Theory

(page 406. Number1)

Solved by 김찬호(2019.5.28)

Revised by 최세현(2019.5.28)

Finalized by 박재형(2019.5.29)


Reference: 1. Discrete Mathematics, Richard Johnsonbaugh, Seventh Edition


Problem

Find a hamiltonian cycle in the graph:

 

 

Solution)

Hamiltonian cycle is

(d, a, e, b, c, h, g, f, j, i, d)

it must be once vertex.               

 

Comment by 김찬호:

Hamilton cycle은 모든 정점을 한번씩만 지나가는 경로이므로,

(d, a, e, b, c, h, g, f, j, i, d)와 같이 그릴 수 있다.


Comment by 최세현:

Hamilton cycle is the path that visiting a vertex exactly one time and returning to the initial vertex.

Hamilton cycle decision problem is NP-Complete. So it is very hard to solve.

Comment by 담딘바자르:


Hamilton cycle is similar to maze puzzle, in which there are many different paths, but there is only path that would lead to the goal. Likewise, hamilton cycle has different nodes, but every node doesn't have to be covered, only vertexes have to be met to make a cycle (repeating without any duplicated vertex).

 

 


Prim’s  Algorithm furnishes an example greedy  algorithm.

A greedy  algorithm is an algorithm that optimizes the choice at each  iteration.

The  principle can be summarized as “doing the best locally.” In Prim’s Algorithm,  since we want a minimal spanning tree, at each iteration we simply abb an  available edge with minimum weight.   "

 

 

Good question! Prim's Algorithm is a Greedy algorithm, so it just optimizes  locally at every iteration. However, in an undirected weighted graph with  positive weights, it always produces a Minimum Spanning Tree, as proved  here:

https://proofwiki.org/wiki/Prim%27s_Algorithm_produces_Minimum_Spanning_Tree

 

I guess local optimization is enough to produce the MST, i.e. local minimum =  global minimum.

 

Summary & Comments

Prim's Algorithm : 프림 알고리즘(Prim's  algorithm)은 가중치가 있는 연결무향 그래프의  모든 꼭짓점을 포함하면서 각 변의 비용의 합이 최소가 되는 부분 그래프인 트리,  즉 최소 비용 생성나무를  찾는 알고리즘이다.  변의 개수를 E, 꼭짓점의 개수를 V라고 하면 이 알고리즘은 이진 힙을  이용하여 자료를 처리하였을 때를 기준으로의  시간복잡도를 가진다. 그래프가 충분히 빽빽한 경우에는 피보나치 힙을  이용하여 훨씬 빠르게 할 수 있다. 이 방법은 복잡도까지  떨어진다.

Minimum Spanning Tree : Spanning Tree =  신장 트리 = 스패닝 트리
Spanning Tree는 그래프의 최소 연결 부분 그래프 이다.
최소 연결 = 간선의 수가 가장  적다.
n개의 정점을 가지는 그래프의 최소 간선의 수는 (n-1)개이고, (n-1)개의 간선으로 연결되어 있으면 필연적으로 트리 형태가  되고 이것이 바로 Spanning Tree가 된다.
즉, 그래프에서 일부 간선을 선택해서 만든 트리
https://gmlwjd9405.github.io/2018/08/28/algorithm-mst.html

MST를 Prim's Algorithm으로 나타낸 C코드


 참조 : https://mattlee.tistory.com/46

Comments : Prim's Algorithm의 원리와 MST의 정의를 생각해보면  MST를  Prim's Algorithm으로 구현할 수 있다는것을 이해할 수 있다.





[Final Team Project  Report]

 

Final Team Project  Report

Flipped/PBL Action Learning

 


Course: Discrete Mathmetics

 

Prof : Sang-Gu LEE


 Due day :  19.06.11

I-campus HW box (과제함)

 

A+를 원하고 그를 위하여 ... 차별화된 심화 학습 해 보고 싶은 내용/아이디어


1) 한 문제를 가지고 여러명이 모여서 서로 다른 방법을 가지고 문제를 해결하는 시간을 가졌으면 좋겠습니다.


EX) 어떤 수학적 근거를 증명한다

--> 여러명이서 서로 다른 증명 방법을 가지고 증명해본다.


2) Team Mate 가 만들어 졌으니, 앞으로는 1)번에서 말했던 것처럼 한 문제를 Team Mate 상에서 서로 다른 방벙을 가지고 문제를 해결하는 시간을 가져, 해결된 방식을 한번에 모아 정리하여 Finalize시켜 QnA에 올려 팀별 발표시간을 가졌으면 좋겠습니다!


3) Algorithm 같은 단원이나 Tree의 단원에서 C코드를 컴파일 해서 예시를 보여주면 더욱더 심화학습이 될 것 같습니다.




Team Number and Team Leader + Members : Team 1/ 김찬호(leader),박재형,최세현,담딘바자르


Team Project 1: Derangement


Team Leader/Co-Leader e-mail (이-메일): 김찬호



Project

 

Subject – Derangement

Team 1

Team member : 김찬호, 최세현, 박재형, 담딘바자르


1. What is derangement?

the definition of derangement is

In combinatorial mathematics, a derangement is a permutation of the elements of a set, such that no element appears in its original position. In other words, a derangement is a permutation that has no fixed points.


In the previous case, we deal with recurrence relation with Constant Coefficient.

 

Theorem  2.11

 

 

Theorem  2.14

 

 

So, the recurrence relation of derangement is


Suppose n people sit in a circle and they play a variation of Musical Chairs. When the music starts they all start walking round the circle of chairs but when it stops they all take a seat as quickly as they can. In this variation, no one is left without a seat!
In how many ways can everybody be sitting in a new seat?

There are n! ways to seat n people in n seats since the first person has a choice on n seats, the second a choice of the remaining n1, the third has n2 choices and so on until the last person has just 1 choice. So in total there are

This is called n factorial and often written as n!
There is obviously only 11 way that everybody can be sitting in the
same seat as when they started.
There are n! ways of seating n people in n seats, so then why is answer to this puzzle
not n!1

Such a permutation of the n numbers (people) where no number (person) is in his original position is called

·         a derangement or

·         a complete permutation or

·         a permutation without a fixed point

·         the subfactorial written using the upside-down exclamation mark ? after the number or else using       the ordinary exclamation mark (as for factorial) but before the number: or .

For instance, label the seats 1 to n and give each person a label which was the original seat he or she was sitting in. When the music stops, we go round the seat in order from 1 to n and note the label of the person sitting there. Thus we might have 3 people starting as and ending up as but in this case, the second item, the person sitting in the second seat, is person 2 -- so he is sitting in his original seat and this is not a derangement.
However, the final seating order of
is a derangement as it means that

1.       the first seat is occupied by person 2 (who was originally sitting in seat 2)

2.       the second seat has the person originally in seat 3

3.       the third seat has the person originally in seat 1

For 3 people there are only two derangements: and 
How many are there for 4 people? 5 people?

We can count the number of derangements on n people as follows:
Take the person labelled 1. He can end up in any of
seats. Suppose he ends up in seat i. Then consider the person labelled i. For each of the possibilities for i, the person labelled ii now cannot sit in her original seat (number 1 is sitting there) and so can either end up in seat 1 or one of the other seats.

·         If she sits in seat 1,

·         then two people have been seated, 1 is in seat i and i in seat 1, neither in their original seat. We are left with n2 people in n2 seats -- the same problem but with 2 less people

·         On the other hand, if she does not sit in seat 1

·      then we relabel seat 1 as "i" (she is not going to sit there) and there are people to sit in seats, each with 1 seat forbidden to them - the same problem but with people and seats.

·        

If D(n) counts the number of derangements of n people we have the formula:


So, since with 1 person there are no derangements, and with 2 people there is just 1 derangement. By the recurrence formula above we have

that shows that we have found all the solutions in the above example with 33 people.
We have the counts of the number of derangements of n people as the following series:

 

Seats(people)

1

2

3

4

5

6

Derangements

0

1

2

9

44

265

There is a direct formula for D(n) too:


Note that the recursion formula is usually not unique.

Here we can also express D(n) as

--------------------------------------------------------------------------------------------------------------

A derangement is a permutation with no fixed points. That is, a derangement of a set leaves no element in its original place. For example, the derangements of are and , but is not a derangement of because 2 is a fixed point.

Notation and formula

The number of derangements of an n-element set is called the derangement number or rencontres number, or the subfactorial of n and is sometimes denoted or .

(Note that using this notation may require some care, as can potentially mean both and )


This number satisfies the recurrences

and


and is given by the formula


For example, the number derangements of 3-element set is

 which we know to be correct.

The first few derangements, starting from , are

Proof of Formula

This can be proven using PIE.

First, you take  ,  which represents all arrangements of the whole sequence. Then, you must subtract all arrangements in which each element appears in its original location, and now you have

.

Then, you must add back in permutations in which each set of two elements stay in their original positions, as we subtracted them twice.

Now, we have

PIE continues to give us this pattern. We have to alternate between subtracting and adding.

Now, we can change the form of

.

This is written as

.

We can now write our relation as

.

We can factor out and get

.    

Limit as n approaches

From the recurrence

,

 we can find that

Also,



Code for Derangement

1.    Sage

 There are the implemented modules for derangement in Sage.

AUTHORS :

Alasdair McAndrew (2010-05): Initial version

Travis Scrimshaw (2013-03-30): Put derangements into category framework

  class sage.combinat.derangements.Derangement(parent, *args, **kwds)

Bases: sage.combinat.combinat.CombinatorialElement

 To use it, we just need to call the function Derangements(parent, *args, **kwds)

 For example, Calling the function Derangement with the argument [2,3,4,5]

 will get the derangements(lists) of the set [2,3,4,5].

--------------------------------------------------------------------------------------

sage: D = Derangements([2,3,4,5])

sage: D.list()

 [[3, 4, 5, 2],

 [5, 4, 2, 3],

 [3, 5, 2, 4],

 [4, 5, 3, 2],

 [4, 2, 5, 3],

 [5, 2, 3, 4],

 [5, 4, 3, 2],

 [4, 5, 2, 3],

 [3, 2, 5, 4]]

--------------------------------------------------------------------------------------

 And also, we can approach to the derangements with the index number

--------------------------------------------------------------------------------------

sage: D = Derangements([2,3,4,5])

sage: D[1]

[5, 4, 2, 3]

We can use the argument with another types

Such as integer 4 (This will represent the set [1,2,3,4]) or string ‘1234’

sage: D1 = Derangements(4)

sage: D1

Derangements of the set [1, 2, 3, 4]

sage: D2 = Derangements(‘1234’)

sage: D2

Derangements of the set [1, 2, 3, 4]

-------------------------------------------------------------------------------------

There is the function ‘cardinality()’ which shows the size of the list.

 Using this, we can easily see how many derangements there are

EXAMPLES:

--------------------------------------------------------------------------------------------

sage: D = Derangements(5)

sage: D.cardinality()

44

sage: D = Derangements([1,44,918,67,254])

sage: D.cardinality()

44

sage: D = Derangements('UNCOPYRIGHTABLE')

sage: D.cardinality()

481066515734

sage: D = Derangements([1,1,2,2,3,3])

sage: D.cardinality()

10

sage: D = Derangements('SATTAS')

sage: D.cardinality()

10

sage: D = Derangements([1,1,2,2,2])

sage: D.cardinality()

0

---------------------------------------------------------------------------------------------



2.    Python

 We know the recurrence relation of the derangement,


(1) function to count nth derangements

We can easily code the D(n) like following function

------------------------------------------------------

def countDerangement(n):

            if(n==0): return 1

            if(n==1): return 0

            if(n==2): return 1

            

            return (n-1)*(countDerangement(n-1) + countDerangement(n-2))

---------------------------------------------------------------------------------------------------


(2) function to get all the derangements lists (with the argument ‘n’)

There is the ‘itertools’ from Python Standrad Library which makes us to easily get the permutations

We import the ‘permutations’ from itertools and use it in order to get all the permutations and check if it is derangement or not.

The code following will return the Derangements(list) from n.

Since the function permutations(argument) will automatically operate with various type of argument,

We can put n as the integer like 4 or 5 or etc… or the list like [1,2,3,4]

from itertools import permutations


def derangements(n):

    return [ perm for perm in permutations(n)

             if all(indx+1 != p for indx, p in enumerate(perm)) ]

    //simplified code

    //using if all() and enumerate() to check if it is derangement or not

    //return the variable perm from permutations(n) which satisfies the condition

that all the elements in perm are not same with the number of order(index)


(3) Printing the derangements using above functions (countDerangement and derangements)

-------------------------------------------------------

print("Derangements of [1,2,3,4]")

for indx, d in enumerate(derangements([1,2,3,4])):

            print(indx+1,"  %s" % (d,))

print("There are ",countDerangement(4),"derangements")

---------------------------------------------------------------------------------------------------


Output:

Derangements of [1,2,3,4]

1   (2, 1, 4, 3)

2   (2, 3, 4, 1)

3   (2, 4, 1, 3)

4   (3, 1, 4, 2)

5   (3, 4, 1, 2)

6   (3, 4, 2, 1)

7   (4, 1, 2, 3)

8   (4, 3, 1, 2)

9   (4, 3, 2, 1)

There are  9 derangements




Example of Derangement


Problem

Lets rearrange the number that no even digit is in its original position


Solution


Where


We count the permutations in which no even number ends up in its original position (good permutations) by dividing into cases.


There are 5 odd numbers. Perhaps 0 end up their original positions, or perhaps exactly 1, or perhaps exactly 2, and so on up to 5.


There are good permutations in which odds end up in their original position.

For good permutations with exactly 1 odd in its original position, the odd can be chosen in ways.

Everybody else must move, giving a total of .

For exactly 2 odd in their original positions, the odds can be chosen in ways. Everybody else must move, giving a total of And so on (three more cases). The total count is

 

Reference

[1] Johnsonbaugh, Richard. Discrete Mathematics, Pearson, 2014

[2] Recurrence Relations & Generating Functions

http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/LRGF.html#section1.1.1

[3] Derangements

http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/derangements.html

[4] Derangement

https://artofproblemsolving.com/wiki/index.php/Derangement

[5] Permutations/Derangements

https://rosettacode.org/wiki/Permutations/Derangements#Python

[6] Lecture Note

http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html

[7] Derangement

https://en.wikipedia.org/wiki/Derangement 

[8] Derangement Problem. Stack Overflow

https://math.stackexchange.com/questions/334755/derangement-problem

Project idea: Recursive and non-recursive programs in python to compute the greatest common divisor. Compare the times required by the programs.


Reasons for doing this project:

Finding the GCD of two or more numbers are the most important thing we learned about in this chapter. Sections 5.1 and 5.3 cover this subject in detail and it is vital to understand. We also wanted to do something relevant to other chapters as well, this involves algorithms, so it pertains to chapter 4. We will use the python programming language because it is the most widely used language in today’s digital age. This also includes recursion, as we learned twice before in this class.

How we will approach the problem:

First, we will discuss what the steps are to get the GCD like this:

1.    Find all possible positive divisors of each number

2.   Compare the highest divisor of each number

3.   Keep comparing until we have a common divisor of each number that is the highest

4.   Give out that final divisor



Non-recursion way:

Since it will be non-recursion, we must use iteration to compute the GCD

We will assume that we will be given two values to find the GCD

We will use a for/while loop to find the GCD

First we need to find the smaller value of the two numbers.

Then we will loop from 1 until the smallest number + 1

Then if both values % of the loop value both == 0, then we can set the gcd to the loop value. Then it keeps going until the end.

Then we return the most recent gcd value.

Then we can come up with a code like this

 For example we can have a = 100 and b= 55 and run the code like this:

Then the result will be



Recursion way:

Since we will not use iteration, we must use recursion->when the function calls itself to find the solution.

We will also assume that we will receive two values.

In this case we give that if the first value is equal to zero, return the second value

And if it is not equal to zero, then call the function itself again but with the value (y, x%y)

This is because we check the second value is equal to 0 or not, if not then keep on going if correct then return the first value as the highest value

Then we can come up with a code like this:


And if we assign the values like similar to above:


Again we will get the results of:



Time complexity:

The time complexity of the non-recursion way is O(n)

The time complexity of recursion is O(logn)

The recursion has a much better time complexity than the non-recursion way. This is because the non-recursion way iterates every value from the smallest number. While the recursion only does it until it finds a number, in the case of logn.


Final Thoughts:

Overall, we think this project was fun and good because it taught us two different ways to write the same kind of program. We learned how to use recursion effectively and in a nicely timed manner. It was useful to learn about many things at once and use what we learned in class into one final project.




2.  Talk about your Team Final Project 1 (& Project2)


Team Project

 

Subject – Sorting Algorithms   Team 3

 

Member : 김두원(Leader), 장용식(A), 이승원, 백우

 


팀프로젝트는 정렬 알고리즘에 대한 내용입니다.

대표적인 정렬알고리즘 5개를 정리해보았고, 이를 시각적으로 볼 수있는 좋은 동영상 자료를 포함하였습니다. 그리고 각각의 정렬 알고리즘을 C언어로 코딩도 해보았으며 그 특징에 대한 요약과 한줄 정리를 해 보았습니다.

끝에는 각 알고리즘을 실행하여 어떤 알고리즘이 가장 효율적인지 실험을 해보기도 하였습니다.

팀원들의 참여가 부실하였기 때문에 이 프로젝트 자체는 90%이상 저 혼자 진행 할 수밖에 없었습니다. 유일하게 장용식군만이 정렬 알고리즘 몇개를 직접 코딩하여 보내주었습니다.





1.Why we have to study different sorting algorithms?

Daniel R. Page, Ph.D. Computer Science, University of Western Ontario (2019) Answered Sep 28, 2015

(https://www.quora.com/Why-do-we-need-so-many-sorting-algorithms)


1) Basic preprocess method to solve a problem.


Sorting has been commonly used as the pre-processed method for searching and matching. Sorting is also used as the basic solution for many other complex problem. In most organization, more than 25% of computing time is spent on sorting.


2) To understand concepts of sorting algorithms in lower bound.


Not all the sorting algorithms we know were developed at the same time. Sometimes we learn different sorting algorithms to understand concepts surrounding sorting algorithms and different types of techniques to sort.


3) No best algorithm for any situation: initial ordering and size of list.


There are different sorting algorithms to consider because some have advantages and disadvantages. For instance, merge sort has the theoretic best running time for comparison-based sorting. but sometimes you'll find that quicksort on average does on par with it. Sometimes some sorting algorithms make more sense to use over others depending on the structure of instances or the architecture.


   

2. What is Sorting?

(quoted from : http://matrix.skku.ac.kr/2018-DM/DM-ch-4-Lab.html/)


Sorting is putting these elements into a list in which the elements are in increasing order.

For instance, sorting the list 7, 2, 1, 4, 5, 9 produces the list 1, 2, 4, 5, 7, 9. Sorting the list d, h, c, a, f (using alphabetical order)

produces the list a, c, d, f, h. An amazingly large percentage of computing resources is devoted to sorting one thing or another.

Hence, much effort has been devoted to the development of sorting algorithms.




3. Sorting algorithms


1)Bubble Sort

(quoted from : https://en.wikipedia.org/wiki/Bubble_sort)

(example : https://visualgo.net/en/sorting)


Elements being sorted is seemed like bubbles rise above the surface of the water.

Simple sorting algorithm.

Repeatedly steps through the list, compares adjacent pairs and swaps them.

Too slow and impractical for most problems.

Stable. It does not change the relative order of elements with equal keys.

 

//BubbleSort

#include <stdio.h>

void BubbSort(int a[], int n)

{

        int i, j;

        int temp;

        for (i = 0; i <= n - 2; i++)

        {

                for (j = 0; j <= n - 2 - i; j++)

                {

                        if (a[j] > a[j + 1])

                        {

                                temp = a[j];

                                a[j] = a[j + 1];

                                a[j + 1] = temp;

                        }

                }

        }

}


Time Complexity

Best Case :

Worst Case :


Bubble Sort Example :

https://www.youtube.com/watch?v=kPRA0W1kECg&t=240s


One-Line-Summary : Do not use Bubble sort!

2)Insertion Sort

(quoted from : https://en.wikipedia.org/wiki/Insertion_sort)

Simple implementation: Jon Bentley shows a three-line C version, and a five-line optimized version.

Efficient for small data sets, much like other quadratic sorting algorithms.

More efficient in practice than most other simple quadratic algorithms such as selection sort or bubble sort.

Adaptive. It is efficient for data sets that are already substantially sorted.

Stable.


 

//InsertionSort

#include <stdio.h>

void InsertionSort(int a[], int n)

{

        int i, j;

        int id;

        for (i = 1; i <= n - 1; i++)

        {

                id = a[i];

                for (j = i - 1; j >= 0; j--)

                {

                        if (a[j] > id) a[j + 1] = a[j];

                        else break;

                }

                a[j + 1] = id;

        }

}


Insertion Sort Example :

https://www.youtube.com/watch?v=kPRA0W1kECg&t=10s

Time Complexity

Best Case :

Worst Case :


One-Line-Summary : Efficient for data sets that are already substantially sorted.


3) Shell Sort

(quoted from : https://en.wikipedia.org/wiki/Shellsort)

Donald Shell published the first version of this sort in 1959.

Can be seen as a generalization of sorting by insertion sort

The method starts by sorting pairs of elements far apart from each other, then progressively reducing the gap between elements to be compared.

The running time of Shell sort is heavily dependent on the gap sequence it uses.


Shell Sort Example :

https://www.cs.usfca.edu/~galles/visualization/ComparisonSort.html

https://www.youtube.com/watch?v=kPRA0W1kECg&t=217s


quoted from :

https://gmlwjd9405.github.io/2018/05/08/algorithm-shell-sort.html


//ShellSort

# include <stdio.h>

# define MAX_SIZE 10

void inc_insertion_sort(int list[], int first, int last, int gap) {

        int i, j, key;

        for (i = first + gap; i <= last; i = i + gap) {

                key = list[i];

                for (j = i - gap; j >= first && list[j]>key; j = j - gap) {

                        list[j + gap] = list[j];

                }

                list[j + gap] = key;

        }

}

void shell_sort(int list[], int n) {

        int i, gap;

        for (gap = n / 2; gap>0; gap = gap / 2) {

                if ((gap % 2) == 0)(

                        gap++;

                )

                        for (i = 0; i<gap; i++) {

                                inc_insertion_sort(list, i, n - 1, gap);

                        }

        }

}

void main() {

        int i;

        int n = MAX_SIZE;

        int list[n] = { 10, 8, 6, 20, 4, 3, 22, 1, 0, 15, 16 };

        shell_sort(list, n);

        for (i = 0; i<n; i++) {

                printf("%d\n", list[i]);

        }

}

Time Complexity

Best Case :

Average Case : << It’s better than insertion sort!

Worst Case :


One-Line-Summary : Advanced insertion algorithm.

4) Merge Sort

(quoted from : https://en.wikipedia.org/wiki/Merge_sort)

(https://gmlwjd9405.github.io/2018/05/08/algorithm-merge-sort.html)

Merge sort is an efficient, general-purpose, comparison-based sorting algorithm.

Merge sort is a divide and conquer algorithm that was invented by John von Neumann

It needs double space.

Time complexity is always



Merge Sort Example :

https://visualgo.net/ko/sorting

https://www.youtube.com/watch?v=kPRA0W1kECg&t=65s



# include <stdio.h>

# define MAX_SIZE 8

int sorted[MAX_SIZE] // 추가적인 공간이 필요

// i: 정렬된 왼쪽 리스트에 대한 인덱스

// j: 정렬된 오른쪽 리스트에 대한 인덱스

// k: 정렬될 리스트에 대한 인덱스

/* 2개의 인접한 배열 list[left...mid]와 list[mid+1...right]의 합병 과정 */

/* (실제로 숫자들이 정렬되는 과정) */

void merge(int list[], int left, int mid, int right){

  int i, j, k, l;

  i = left;

  j = mid+1;

  k = left;

  /* 분할 정렬된 list의 합병 */

  while(i<=mid && j<=right){

    if(list[i]<=list[j])

      sorted[k++] = list[i++];

    else

      sorted[k++] = list[j++];

  }

  // 남아 있는 값들을 일괄 복사

  if(i>mid){

    for(l=j; l<=right; l++)

      sorted[k++] = list[l];

  }

  // 남아 있는 값들을 일괄 복사

  else{

    for(l=i; l<=mid; l++)

      sorted[k++] = list[l];

  }

  // 배열 sorted[](임시 배열)의 리스트를 배열 list[]로 재복사

  for(l=left; l<=right; l++){

    list[l] = sorted[l];

  }

}// 합병 정렬

void merge_sort(int list[], int left, int right){

  int mid;

  if(left<right){

    mid = (left+right)/2 // 중간 위치를 계산하여 리스트를 균등 분할 -분할(Divide)

    merge_sort(list, left, mid); // 앞쪽 부분 리스트 정렬 -정복(Conquer)

    merge_sort(list, mid+1, right); // 뒤쪽 부분 리스트 정렬 -정복(Conquer)

    merge(list, left, mid, right); // 정렬된 2개의 부분 배열을 합병하는 과정 -결합(Combine)

  }

}



void main(){

  int i;

  int n = MAX_SIZE;

  int list[n] = {21, 10, 12, 20, 25, 13, 15, 22};

  merge_sort(list, 0, n-1);

  for(i=0; i<n; i++){

    printf("%d\n", list[i]);

  }


Time Complexity

Best Case :

Worst Case :


One-Line-Summary : Merge sort is good for sorting large data. But it needs double space.

5) Quick Sort

· Invented by Tony Hoare in 1959

· Based on the divide and conquer (D&C) paradigm.

· Consisted with two part

- Pivot selection

· Pick an element, called a pivot, from the list.

- Partitioning

· reorder the list with the pivot.

· The elements less than the pivot come before the pivot.

· The element greater than the pivot come after the pivot.

· Recursively apply the above steps to the sublists.

· Generally used algorithm for sorting

- C library sort function is quick sort!

Quick Sort Example :

https://visualgo.net/ko/sorting

Original quick sort : https://www.youtube.com/watch?v=kPRA0W1kECg&t=39s

Stdlib(C) sort : https://www.youtube.com/watch?v=kPRA0W1kECg&t=153s

Why basic quick sort is different from stdlib quick sort?

-> stdlib quick sort is an advanced quick sort which rarely makes worst case.


#include<stdio.h>

void QuickSort(int arr[], int left, int right) {

        int L = left, R = right;

        int temp;

        int pivot = arr[(left + right) / 2];

        while (L <= R) {

                while (arr[L] < pivot)

                        L++;

                while (arr[R] > pivot)

                        R--;

                if (L <= R) {

                        if (L != R) {

                                temp = arr[L];

                                arr[L] = arr[R];

                                arr[R] = temp;

                        

                        L++; R--;

                }

        }

        if (left < R)

                QuickSort(arr, left, R);

        if (L < right)

                QuickSort(arr, L, right);

}

int main(void) {

        int data[10] = { 2, 9, 4, 18, 5, 1, 7, 8, 15, 12 };

        printf("input : ");

        for (int i = 0; i < 10; i++) {

                printf("%d ", data[i]);

        }

        printf("\n");

        QuickSort(data, 0, 9);

        printf("output : ");

        for (int i = 0; i < 10; i++) {

                printf("%d ", data[i]);

        }

        printf("\n");

        return 0;

}

Time Complexity

Best Case :

Worst Case :


One-Line-Summary : Quick sort useful. But it’s worst case time complexity is O(n2)


4. What is the best sorting algorithm?


 

Name

Best

Average

Worst

Run-time (sec)

Bubble sort

22.893

Insertion sort

7.438

Shell sort

0.056

Merge sort

0.026

Quick sort

0.014


Quick sort is the fastest sorting algorithm!

-> Although the quick sort has O(n2) time complexity when it is the worst case, it is the fastest algorithm in most cases. Because the quick sort is more cache friendly than the merge sort in computer system, it can be more faster than the merge sort.


5. Summary


In this project, our team summarized 5 major sorting algorithm which is generally used for studying sorting. By searching and coding the algorithms we can learned the algorithms dynamically and efficiently. Sorting algorithms are very important for studying further algorithm. We hope our project can help the other students who learned DM class.

 

 

Topic: Binary Trees

 

Author: Simen Sverdrup-Thygeson


Binary trees are tree data structures, where each node has a maximum of two children, referred to as the right and left child. The data structure is used in two different ways;


Firstly, as a way to access nodes based on the value in each node. Such binary trees are used to implement sinary search trees, binary heaps and also for efficient sorting and searching.


Secondly, binary trees as a representation of data where the arrangement of the nodes is of the essence. In these trees, the value associated with a given node is less important than its placement in the tree. An example of this application is Huffman code, where the placement of the nodes is essential to compute the code for each letter.


There are several types of binary trees, and as the terminology isn’t particularly standardized it can vary between various literatures. These generally agreed upon types of binary trees include:


Rooted binary trees, which simply is a binary tree with a root node which the child nodes spring out of.


Full binary trees, which are binary trees where every node has either 0 or 2 children, but not 1. A recursive definition of full binary trees can be explained as either a single node, or a tree whose root has exactly two sub-trees as children, which both are full binary trees as well.


Complete binary trees, where every level, except possibly the last, is completely filled (i.e. every node has two children in every level except the second last and last). In addition, all the terminal nodes should be as far left as possible.


Perfect binary trees, which are binary trees where every node, except the terminal nodes, has two children and every terminal node has the same depth. This means that a perfect tree always will be a complete tree, but not the other way around.


Lastly, a balanced binary tree is a binary tree in which the depth of the right and left subtrees of every node only differs with a maximum of one level. Balanced binary trees makes for optimal search efficiency of values.


Binary search trees are, as previously mentioned, one of the most common applications of binary trees. In binary search tree structures, values are stored in such a way that every right child of a given node will be bigger (according to some specification) and the left child will be smaller than the parent node. Whenever a given value is looked up, the value will be compared with the root node, if it’s bigger, the subsequent search will continue with the right child as root. If it’s smaller, the subsequent search will continue from the left child. This will continue iteratively until the value is found or the algorithm reaches a terminal node.


This makes for extremely efficient search of values, with an average-case time complexity of  for searching, inserting and deleting a node. The worst-case time complexity for these operations will be , however this will only be the case if the tree isn’t balanced (as explained above). This can be visualized as following:


This tree is a binary search tree (as it fulfills the rules of a binary search tree), but it isn’t balanced. In fact, this is the worst-case scenario and it’s easy to understand why the searching time complexity will be , as the binary tree search simply will be a linear search.





◆ Final comment  PBL보고서를 마치고


1st Month: In the first month's study, I met problems and I found the drawbacks of myself. But everything is getting better because I can always ask for help on Q&A. The midterm exam is coming soon and I hope my PBL report can make some contributions to help others preparing their exams and I am also willing to read and learn more from others’ reports to improve my own report and get more inspirations.


Mid Term: I think I could get a better grade than what I got because I was overwhelmed with facing seven exams in one time and finally lost the balance in preparing for them. Therefore, I hope that I can make progress in the final exam.


3rd Month: In this month, I solved more problems and started to work more with my teammates and other students. I also appreciated to learn and to communicate with you guys via Q&A. After midterm, we began the flipped class, which always pushes and encourages me to keep forward. All in all, the studies in May is busy but is full of fun as well.


Last Month (Final):

In June we studied the remaining topics of our course. From these chapters, I learned a lot of useful skills and knowledge for my major. Chapter 8 and Chapter 9 are pretty essential since both of them are highly involved in data structure and algorithm, which are the major courses that I have to take in the future.


3월 : action learning이라는 것에 대해서 아직은 생소하고 어리버리한 것 같습니다. 아직 질문을 올리는 것이 어색하고 조심스럽습니다만, 다른 학생들과 문제를 같이 해결하고 그 방법을 공유하는 것은 긍정적으로 생각하고 있습니다. 앞으로 좀 더 용기를 내서 꾸준히 QnA에 질문을 올리고 토론하면서 적극적으로 참여할 생각입니다.


4월 : 중간고사가 코앞으로 다가오고 있습니다. 이제껏 배운 내용들을 문제 풀이를 서로 공유하고 마무리하는 방식으로 공부하고 있습니다. 또한 다른 학생들의 요약 내용을 읽어보고 고쳐서 더 좋게 만드는 식으로 능동적으로 공부하기도 합니다. PBL 리포트가 단순히 부담스러운 과제가 아니라 좀 더 능동적으로 수학을 공부할 수 있게 해주는 계기가 된 것 같습니다. 앞으로 있을 PBL리포트 발표도 기대가 됩니다.


5월 : 어느덧 기말고사가 가까워지고 있습니다. 확실히 Flipped class에 익숙해졌는지, QnA 참여가 이제 그리 어색하지 않고 자연스럽게 문제를 풀고 공유할 수 있게 되었습니다. 다만 다른 적극적인 학우들처럼 일주일에 수십 개 씩 참여하지는 못하고 있어 상대적으로 적은 참여율을 보이고 있는 자신을 반성하게 됩니다. 현재 3장,4장에 대한 정리와 문제풀이, 심화 문제 해결 팀 프로젝트를 진행하고 있는데 잘 마무리 되었으면 좋겠습니다.


6월 : 이번 이산수학 강의 이전에는 PBL REPORT, QnA 활동을 해본적도 없고 경험한 적이 없었습니다. 타 학생들과 배운 내용을 서로 교류하고 해결 방안을 찾고 계속해서 개선시켜서 전세계 누구나 보아도 이해할 수 있는 솔루션을 만드는 것은 정말 색다르고 신선한 경험이었습니다. 이번에 교수님과 자주 이야기할 수 있는 기회가 많이 있었는데, 그저 여러 정보들을 묶어 놓고, 스스로 이미 있는 정보를 되풀이해서 나열하기만 하는 비생산적인 행동에서 그치지 않고, 모든 사람들과 협력하여 의미 있고 발전적인 해결책을 만들어 모두를 성장시키는 과정을 경험할 수 있게끔 하시는 철학을 가지고 계신다는 것을 알게 되었습니다. 모든 사람들과 공유하며 문제를 해결하는 것은 더 효과적일 뿐만이 아니라 모두를 한 단계 발전시킬 수 있는데도 불구하고, 단순히 암기하고 되새김질할 뿐인 비생산적인 공부만을 하지 않았나 스스로에게 반성하는 계기가 되었습니다.

이번 Team Project에서는 그러한 맥락에서 저에게 또 다른 의미 있는 시간이 되었던 것 같습니다. 사실 교수님의 철학은 백번 옳음에도 불구하고 실제로 QnA에 있어서 열심히 참여하는 학생들도 있었지만 그렇지 않은 학생들도 있었습니다. 분명히 기회가 마련되어 있음에도 불구하고 소극적으로 참여하는 이유는 여러가지가 있겠지만, 가장 중요한 원인은 배우고자 하는 열망이 부족하지 않았나 생각합니다. 이런 상황에서도 모든 학생들을 계속해서 QnA에서 열심히 활동하도록 독려하시던 교수님이 대단하고 멋지다고 생각합니다. 이번 팀프로젝트를 진행하는데 아쉬움이 많지만, 경험한 것을 바탕으로 다른 강의를 공부할 때나 다른 팀프로젝트를 잘 진행하고 싶습니다.


3월 :  3월동안 flipped방식인 이산수학을 들으면서 정말 스스로가 공부를 하고 있다는 느낌을 받았고, 꾸준하게 강의자료들을 보면서 수준도 높아지고 있다는 것을 알았습니다. 그리고 남들과 함께 공부한다는 것에서 좋은 기분을 느꼈고, 앞으로도 이런 방식으로 수업을 한다면 거리낌없이 할 수 있다는 자신감도 받았습니다. PBL보고서를 마치고난 뒤 생각은 4월, 5월 그리고 6월에도 열심히 QnA를 참여해서 더욱 리포트의 수준을 올리자는 생각이 먼저 들었고, 이를 위해서 꾸준히 학습하는 자세를 가지도록 노력하겠다고 다짐했습니다.


4월 : 3월동안 이산수학을 듣고 4월로 넘어가면서 이제 이산수학을 본격적으로 배울 수 있을까 생각했지만, 예상보다 어려운 문제들로인해 따라가기 벅찼던 부분도 약간은 있었으나 QnA에 올라온 여러 학생들의 질문과 요약들을 보면서 공부를 수월하게 할 수 있었습니다. 앞으로도 이산수학을 공부하면서 많은 도움이 될 것이라 기대하고있습니다. 많은 QnA와 강의자료를 보면서 공부하다보면 이산수학이라는 과목을 완전히 정복할 수 있을거라고 생각합니다.


5월: 중간고사를 보고 조금 풀어진 감이 있었지만 이산수학의 QnA는 마음을 다잡는데 도움을 주었다. 팀을 만들어서 프로젝트를하고 같이 문제를 풀고 공유하는 방법이 마음에 들었고, 아무래도 혼자 할때보다 더 열심히 하게되는 경향이 있는 것 같다. 앞으로도 많은 도움을 주고 받으면서 이산수학을 공부하는데 서로 도움이 되면 좋겠다.


6월 (Final_PBL) : 첫 Flipped Class를 이산수학으로 시작해서 다행이라고 생각한다. Flipped class는 수업전 미리 공부를해서 수업시간에 예습한 내용을 가지고 진행하는 수업이다. 이상구 교수님은 이 수업방식을 정말 잘 활용하셨다. 활발한 QnA활동을 통해서 학생들과 많은 교류를 할 수 있었고, 학습 동기를 유발하게하여 더 열심히 학업에 참여한 것 같다. 팀프로젝트를 통해서 Derangement같은 어려운 개념이나 정의도 많은 도움을 받으면서 해결할 수 있었다. PBL을 적으면서 내가 배운 내용들, 질문하고 답변한 내용들, 풀었던 문제들을 다시 한번 확인해볼 수 있어서 좋았고 이런 경험을 토대로 앞으로 Flipped Class를 자신감있게 할 수 있을 것이라 생각한다.

I think that I have grown throughout this class. The course Discrete mathematics itself has taught me a lot of things that can be helpful for me in the future and in real life situations. Moreover, I think that the Professor, the TA, as well as other students have helped me to do better in this course.


I have to say that this class is different compared to other classes I was taking, in a good way. At first, I was not sure that I can do good in this class, but I tried to adapt and follow along. I think I have improved in some ways, and I have learned so much from other colleauges. I think that PBL class is a very helpful experience. PBL system did not only help me in terms of understanding the lesson and the course better, but helps in terms of communication. I think opening the QnA portal and letting everyone pour out their ideas in the posts is a very good idea for a class discussion, although I do not think that students should be fully graded based on how many posts they have.


Overall, I think that this class, discrete mathematics and its PBL system is beneficial in a lot of ways. I would like to thank the Professor, the TA, and other students for helping me get through this course until the end. I hope that this wonderful experience can be helpful for me and for other students as well in the near future.


1st Month: 처음에는 꽤 어렵고 낯선 수업환경이라 긴장했었다. 서로 의견을 공유하고 게시판에 글을 남기는 수업이라니. 어디서부터 시작해야할지, 어디서부터 공부해야하는지 막막했다. 하지만 교수님께 질문하고, 답변 받으면서 점점 갈피를 잡아 나갈 수 있었다. 또, Q&A 게시판을 통해서 내가 해야 할 일에 대해 점점 확실해졌다. 같이 수업 듣는 학우들도 많이 낯설었을 것 같지만, 곧 다들 적응을 잘하는 것 같아서 나도 더 열심히 노력하고자 했다. 이러한 수업환경에 잘 적응하고 있는 것 같아서 내 자신이 대견스럽다. 조금만 더 열심히 해서 Q&A 게시판에 더 꾸준히 좋은 글을 올리고 싶다!


Mid Term: 점점 질문과 답변의 퀄리티가 높아지는 것 같아 뿌듯했다. 여전히 Q&A 게시판에는 좋은 글과 친절한 답변을 올리고 있지만, 여러 사람들이 열심히 참여하기 때문에 나도 더 열심히 해야겠다는 다짐을 할 수 있었다. 다른 수업시간에 배웠던 내용들을 적용시켜서 공부하니 훨씬 수월하게 생각하고, 또 공부할 수 있었다. 특히, 자료구조개론과 내용이 조금 유사한 부분이 있어서 내용이해가 조금 수월했다. 앞으로 중간고사가 얼마남지 않은만큼 질문을 더 열심히 하고, 내용을 더 확실히 이해했으면 한다!


3rd Month: 이번에는 저번과 달리 Finalize한 문제가 많아져서 개인적으로 뿌듯하였다. 하지만, 나보다 더 많이 한 학우들이 많으므로, 끝까지 긴장감을 늦추면 안될 것으로 예상된다. 배우는 내용이 고등학교 때 한 번씩 다뤘었던 부분이라 쉽게 이해가 되어 좋았다. 하지만, 그래프 부분은 조금 낯설었고, 저번학기 다른 수업에서 배운 내용을 상기시켜보기도 하였다. 기말고사가 얼마 남지 않았기 때문에 더욱 열심히 학업에 임하고, 또, 팀 프로젝트도 성공적으로 다뤄보았으면 좋겠다!



Last Month (Final): 드디어 Final 보고서이다. 처음에는 잘 할 수 있을까라는 불안한 감정이 컸는데, 지금 와서 돌이켜보니 매우 뿌듯하다! 점점 참여도를 높였고, 덩달아 Q&A 게시판에 올라가는 내 게시물 수가 늘어가는 모습을 보니 한 학기 동안 열심히 한 내 자신이 매우 대견하였다. 자기주도학습의 새로운 방식을 알 수 있었고, 그와 더불어 내 자신의 달라진 공부법에 대해서 놀랐다! 수업 시간에 더 집중할 수 있었고, 교수님이 학습을 잘 할 수 있도록 많이 도와주셔서 감사했다. 앞으로 배울 여러 다른 수업들에도 큰 도움이 될 것으로 기대된다!

처음에 이 강좌를 접하고 수업 방식을 접했을 때는 정말 의아하고 이러한 방식이 생소해 어떻게 공부를 진행해야 하는지 감이 오지 않았습니다. 1단원터 3단원 까지는 평소 고등학교때 공부했던 내용과 크게 다를 것이 없어 Q&A를 통해 토론에 참여 하지 않았을 뿐만 아니라 수업 자료 복습도 제대로 하지 않았습니다. 그러다 4단원에 들어가고 나서 제가 흥미롭게 여기는 Algorithm 단원에 접하게 되었습니다. 그러다 보니 서서히 저도 모르게 Q&A에 답변을 달고 있었고, 또 제가 모르는 부분을 질문하여 답변이 온 것을 바탕으로 공부를 하고 있었습니다. 시간이 흘러 흘러 벌써 마무리 하는 단계가 오고 지나고 보니 이러한 공부법은 저에게 있어 이산 수학에 재미를 느끼게 해주었을 뿐만 아니라 확실한 공부가 되고 있다는 사실을 인지 하게 해주었습니다.



st Month: 난생처음으로 Flipped Class 수업에 참여하게 되었습니다. 처음 해보는 수업 방식이라 어색하고 불편한 점도 많았지만, 잘 적응하기 위해 노력했습니다. 처음 써보는 PBL 리포트는 내가 지금까지 배웠던 부분과 QnA게시판에 남겼던 글, 질문들을 정리 할 수 있는 좋은 시간이었습니다. 또한, 다른 학우분들의 PBL 리포트 발표를 들으며 좀 더 열심히 해야겠다는 생각도 들었습니다. 100쪽이 넘어가는 PBL 리포트를 볼 때, 나도 종강 때쯤 되면 저 정도의 리포트를 쓸 수 있는 정도의 사람이 돼야겠다는 다짐을 하며 공부했습니다.


Mid Term: 수업에 점점 적응되어가는 시기였지만, 아직 미숙한 부분이 많았습니다. 처음엔 매일매일 써야 하는 QnA부분이 단지 숙제같이 느껴져 스트레스를 받을 때가 많았지만, 시간이 지나며 점차 적응되기 시작했습니다. 처음에 강제로 썼던 QnA도 이제는 공부하기 위해 게시판에 들어가게 되었습니다. 하지만 아직 QnA 양이 다른 학우들보다 적은 편이라 지금보다 더 노력해야겠다는 생각을 하게 되었습니다.


3rd Month: 이경록, 웅요빈 선배님과 프로젝트 수업을 같이하게 되었습니다. 저는 고등학교 때 프로젝트와는 거리가 멀어 이런 식의 조별과제를 거의 해본 적이 없었는데, 이 이산 수학을 기회로 좋은 선배들과 같이 공부할 기회가 생겨 기쁘게 생각했습니다. 하지만 처음부터 Leader의 자리를 맡아 내가 선배들 사이에서 잘 해낼 수 있을지 걱정이 앞섰습니다. 하지만 선배님들이 잘 이끌어 주셔서 프로젝트를 무사히 마칠 수 있었습니다. 다른 과목보다 가장 할 게 많은 과목이었지만, 그만큼 가장 많이 배울 수 있었던 수업이라고 생각합니다.


Last Month (Final): 3월에 받은 Flipped Class의 첫인상은 할 게 많은 과목, 귀찮은 과목이었지만, 지금 과거를 돌아보며 생각해보면 정말 좋은 선택이었다고 생각됩니다. 교수님과의 교류, 학우들과의 교류가 가장 많은 과목이었고, 배울 것도 가장 많았습니다. 이렇게 한 학기를 마무리하며 평소에 게을렀던 나 자신에게 아쉽다고 느껴지기도 하지만 한편으로는 이 수업을 잘 마무리하게 되어 대견하다는 생각이 듭니다.

여기까지 올 수 있게 많은 도움을 주신 이상구 교수님, 여러 학우 분들께 감사하다는 말씀드리고 싶습니다.


Extra - My Feeling (소감)

  대학에 들어온 지 얼마 되지도 않은 거 같은데 벌써 종강이 코앞에 다가왔습니다. 이 ‘이산 수학’ 과목은 다른 수업과 차별화된 Flipped class로, 처음엔 매일 QnA를 작성하고 예습하는 게 많이 힘들었습니다. 해야 할 것도 많고, 신경 써야 할 부분도 많은 과목의 특성상 게으른 저하고는 맞지 않는다고 생각했습니다. 하지만 힘들다고 그만둔다면 앞으로의 다른 일도 해내지 못한다는 생각이 들어 열심히 참여했습니다. 처음엔 게시물을 쓰고 답변하는 횟수가 적었지만, 시간이 지나며 점차 횟수와 질이 향상해가는 걸 느꼈습니다. 매일 게시판을 확인하며 모르는 부분을 확실히 알 수 있었고, 명확하게 질문하는 법을 배우게 되었습니다. 또한, 수업 시작 전과 수업 후 하는 Preview와 Review 덕분에 공부하는 내용이 단기적인 지식으로만 그치지 않고 오랫동안 유지될 수 있었습니다. 이 과목만의 장점이라면, 모르는 것은 게시판에 올려 바로 찾아볼 수 있다는 점과 다른 학우들과 토론하며 깊이 있는 지식을 쌓아 갈 수 있다는 점인 것 같습니다. 이 수업에 늦게 적응해 이 장점들을 제대로 살리지 못한 것이 아쉽지만, 한 학기 동안 정말 의미 있는 시간을 가졌다고 생각합니다.


At first, I was not confident that I could contribute to the class well because I feel like I am still lacking on my skills. However, as I went through the classes, I realize that it is alright to be lacking. This is because the classes will help me learn how to develop my skills and knowledge. I was also worried about not being able to communicate with anyone but I am finally happy to make friends especially do great teamworks with my groupmates now. I also am very grateful for the professor for teaching us all the materials from Ch. 1 up to Ch. 9 and I hope to be able to improve even further from the knowledge that I have acquired. Hopefully, everyone will do well in their finals, meet at the top and be successful together!


3월 : action learning이라는 것에 대해서 아직은 생소하고 어리버리한 것 같습니다. 아직 질문을 올리는 것이 어색하고 조심스럽습니다만, 다른 학생들과 문제를 같이 해결하고 그 방법을 공유하는 것은 긍정적으로 생각하고 있습니다. 앞으로 좀 더 용기를 내서 꾸준히 QnA에 질문을 올리고 토론하면서 적극적으로 참여할 생각입니다.


4월 : 중간고사가 코앞으로 다가오고 있습니다. 이제껏 배운 내용들을 문제 풀이를 서로 공유하고 마무리하는 방식으로 공부하고 있습니다. 또한 다른 학생들의 요약 내용을 읽어보고 고쳐서 더 좋게 만드는 식으로 능동적으로 공부하기도 합니다. PBL 리포트가 단순히 부담스러운 과제가 아니라 좀 더 능동적으로 수학을 공부할 수 있게 해주는 계기가 된 것 같습니다. 앞으로 있을 PBL리포트 발표도 기대가 됩니다.


5월 : 어느덧 기말고사가 가까워지고 있습니다. 확실히 Flipped class에 익숙해졌는지, QnA 참여가 이제 그리 어색하지 않고 자연스럽게 문제를 풀고 공유할 수 있게 되었습니다. 다만 다른 적극적인 학우들처럼 일주일에 수십 개 씩 참여하지는 못하고 있어 상대적으로 적은 참여율을 보이고 있는 자신을 반성하게 됩니다. 현재 3장,4장에 대한 정리와 문제풀이, 심화 문제 해결 팀 프로젝트를 진행하고 있는데 잘 마무리 되었으면 좋겠습니다.


6월 : 이번 이산수학 강의 이전에는 PBL REPORT, QnA 활동을 해본적도 없고 경험한 적이 없었습니다. 타 학생들과 배운 내용을 서로 교류하고 해결 방안을 찾고 계속해서 개선시켜서 전세계 누구나 보아도 이해할 수 있는 솔루션을 만드는 것은 정말 색다르고 신선한 경험이었습니다. 이번에 교수님과 자주 이야기할 수 있는 기회가 많이 있었는데, 그저 여러 정보들을 묶어 놓고, 스스로 이미 있는 정보를 되풀이해서 나열하기만 하는 비생산적인 행동에서 그치지 않고, 모든 사람들과 협력하여 의미 있고 발전적인 해결책을 만들어 모두를 성장시키는 과정을 경험할 수 있게끔 하시는 철학을 가지고 계신다는 것을 알게 되었습니다. 모든 사람들과 공유하며 문제를 해결하는 것은 더 효과적일 뿐만이 아니라 모두를 한 단계 발전시킬 수 있는데도 불구하고, 단순히 암기하고 되새김질할 뿐인 비생산적인 공부만을 하지 않았나 스스로에게 반성하는 계기가 되었습니다.

이번 Team Project에서는 그러한 맥락에서 저에게 또 다른 의미 있는 시간이 되었던 것 같습니다. 사실 교수님의 철학은 백번 옳음에도 불구하고 실제로 QnA에 있어서 열심히 참여하는 학생들도 있었지만 그렇지 않은 학생들도 있었습니다. 분명히 기회가 마련되어 있음에도 불구하고 소극적으로 참여하는 이유는 여러가지가 있겠지만, 가장 중요한 원인은 배우고자 하는 열망이 부족하지 않았나 생각합니다. 이런 상황에서도 모든 학생들을 계속해서 QnA에서 열심히 활동하도록 독려하시던 교수님이 대단하고 멋지다고 생각합니다. 이번 팀프로젝트를 진행하는데 아쉬움이 많지만, 경험한 것을 바탕으로 다른 강의를 공부할 때나 다른 팀프로젝트를 잘 진행하고 싶습니다.


Final 6월 : Final PBL Report를 쓰면서 3월달부터 차곡히 진행했던 자기 평가와 질문한 문제들 그리고 답변한 문제들을 보니 제가 처음 PBL 수업방식을 대했던 태도와 지금 현재 PBL 수업 방식을 대하는 태도가 많이 달라 졌음을 느낄 수 있었습니다. 처음 3월달에 들어 왔을 때 PBL 수업방식을 대했던 태도는 솔직하게 무척 생소하고 한번도 경험해보지 못했던 수업방식이라 거부감이 없지 않아 있었습니다. 하지만 4월달이 되고 저도 모르게 점차 Q&A 게시판을 통해 이산수학을 듣는 학우분들과 토론을 진행하고 있었고, 내가 모르는 부분을 질문하여 온 답변을 통해 저 스스로 배우고 있었습니다. 사실 QnA 토론을 참여하게 된 계기가 있습니다. 첫 1단원 2단원은 제가 고등학교 수학시간때 배웠던 내용이랑 많이 비슷해서 Q&A게시판을 많이 이용하고 있지 않았습니다. 하지만 제가 가장 흥미롭게 배웠던 Algorithm단원을 접하니 저도 모르게 Q&A 게시판을 통해 많은 학우들과 수업 내용에 대해 얘기를 나누고 있었습니다. 바로 작년에 전공수업때 Algorithm에 관한 내용을 배웠던 저는, 다른 학우들과 제가 배웠던 내용을 공유하여 서로 심화학습을 하고 싶었고, 또 학우분들과 제가 가진 지식을 공유하다가 수업시간에 배운 모르는 내용은 질문을 하고, 서로 상호 소통하며 진행하고 있었습니다. 그러다 중간중간 PBL Report를 쓰면서, 이렇게 공부하는 것이 PBL 수업방식에 부합한 공부 방식 이구나를 깨닫게 되고 조금더 열심히 참여하는 순간이 있었습니다. 다만 5월달에 학교 행사와 학과 행사가 많은 관계로 토론에 열심히 참여하지 못하는 순간도 있었지만, 저번 PBL Report를 쓰고나서 반성하고 다시 토론에 열심히 참여하여 많은 내용을 주고 받고 많은 내용을 배우는 계기가 되었습니다. 그래서 저는 저의 후배님들에게도 이러한 수업방식이 있다는 것을 가르쳐주고 싶고 또 이러한 교육방식이 효과 가 있다는 것을 알려드리고 싶습니다. 한 학기 동안 저희를 이끌어 주신 이상구 교수님게 감사하다는 말 올립니다.


This month has been a mix of dealing with the team project, solution set of chapter 9 and preparing for the final exam, revising all the chapters. Finally, I can say that I have improved myself in the sense of dealing with problems and solving them with a good strategy. I got a very good and valuable experience according to the flipped class, which was something new for me in the beginning of the semester. I can say that I possess now a big amount of knowledge in the Discrete Mathematics. As for the flipped class concept, I really appreciate that I had the chance to have such a class and I hope to experience it in the future now that I have handling capabilities on that kind of class.


1st Month:

우선 첫번째 PBL 리포트를 작성 하게 되었다. 처음에는 flipped class가 낯설어 걱정도 많고 어떻게 해야 효율적으로 이 강의를 수강할 수 있을까 라는 고민을 많이 하였지만,  생각보다 잘 적응하고 잘 해 나간 것 같다.  PBL리포트를 작성하며 지난 나의 qna와 여러 classmate들의 qna를 돌아보며 내가 공부하며 도움을 받은 qna와 나의 궁금증을 해결한 qna를 다시 보게 되었고, finalize ok된 자료들을 쭉 훑어보면 생각보다 양질의 contents가 final되어 학습에 도움이 많이 되었다.


        이렇게 PBL리포트를 작성하며 도움을 받은 부분에 대해서 되짚어 보니, 나 역시 다른 classmate분들에게 도움이 될 만한 양질의 qna와 finalize를 작성해야 함을 깨달았다. 적응기가 끝났기 때문에 앞으로는 더 효율적이고 실용적인 qna와 finalize를 작성하겠고, 이를 통해 나 역시 남은 단원들의 학업 효율을 높이고, 다같이 성장해 나가는 강의가 되었으면 좋겠다.


Mid Term:

본격적인 이산수학 내용 중 algorithm과 number에 대해 배우고 지금도 배우고 있다. 이제 곧 다가올 중간 고사가 복학 후 첫 시험이라 많이 긴장도 되고 어떻게 준비를 해야 할지 잘 감이 오지 않지만 그동안 잘 준비한 summary자료들과 finalize 문제들 그리고 교수님이 올려 주신 여러 solution과 강의자료들을 복습하며 마지막 준비를 해야 겠다. 이 mid_term PBL report는 내가 모르는 문제와 도움을 받은 문제들로 이루어져 있기 때문에 참 좋은 참고 자료가 될 수 있을 듯 하다. 이렇게 보니 개강 후 열심히 qna에 참여하고 활동한 것들이 너무 고마워진다.


3rd Month:

이산 수학 내용이 거의 끝나가는 것 같다!. 5월에는 6단원 Counting Method 에서 현재까지 우리가 대략적으로 알았던 순열과 조합, 그리고 비둘기 집의 원리에 대해 정확히 배우게 된다. 7단원 Recurrence relation에서는 점화식에 대한 내용을 심도 있게 배우게 되고, 8단원 Graph theory에서는 우리가 자료구조 시간에 배우는 graph에 대해서 수학적 이해와 여러 알고리즘들을 배우게 된다. 우선 지금까지 나의 활동들을 돌아 봤는데, 많은 Problem에 대한 solution을 제시한 것 같아 충분히 만족스럽다.


 현재까지 진행되는 수업에 참여도도 만족스럽고, 무엇보다 수업의 취지를 잘 따라가고 있다고 생각되어 이번 학기에 보람찬 강의를 하나 수료하고 있는 느낌이다.


마지막 유종의 미를 잘 거두어 이산 수학의 확실한 자료집과 실력을 만들어 다음 학기의 과정을 수료하고 싶다.               ★ ★


Last Month (Final):

우선 이번 학기 열심히 가르쳐 주신 교수님과 열심히 참여해준 여러 학우들에게 진심으로 감사합니다. 이 수업은 혼자 하는 수업이 아닌 다같이 만들어 가는 수업입니다. 저는 이번 학기 이산수학에 대한 정리되고 여러 문제의 Solution이 있는 이 PBL report를 만들기 위해 노력했습니다.

하지만 혼자 문제를 아무리 풀어도, 혼자 아무리 답변을 달아도, 먼저 풀어서 같이 올려주는 학우들과 저의 질문에 답해주는 학우들이 존재하지 않았다면, 이 방대한 PBL report도 만들어 지지 않았을 것입니다.

이번 학기 PBL report를 작성하며, 수학적인 기호와 수학적인 표현법에 더 다가가게 되었고, 문제를 정리하고, 진보된 Solution을 위해 노력했기 때문에 전반적인 실력 향상을 이룬 것 같습니다. 이러한 노력의 결과를 만들어내어 기쁘고, 자랑스럽습니다.


Extra - My Feeling (소감)


이번 학기에 저도 교수님이 말씀하신, 남들이 만들어 놓은 결과물에서 시작한 내가 더 좋은 결과물을 창출하라는 말씀을 잘 이해하고, 진행하려 노력했습니다. 항상 남들보다 열심히 QnA 에 참여하여, 더 많이 알아가고 싶었고, 더 많이 도움이 되어주고 싶었습니다. 이 과정에서 저의 실력은 자연스레 향상된 것 같습니다.

앞으로 저의 방향도 그럴 것 같습니다. 항상 남들보다 많이 움직이고, 더 열심히 찾고, 노력하면 자연스레 저의 실력이 향상되고, 저의 결과물 또한 남는 것을 깨달았기 때문에 확실한 앞으로의 공부 방향도 정할 수 있었습니다.

다시 한번 교수님과 정말 열심히 참여 해준 학우들, 그리고 저희 Team원들에게 감사하는 마음에서 PBL report를 마치겠습니다.


March:

“I look forward to learning more thoroughly in both class and online sites as a group to dramatically improve not only my academic principles, but do I also try to be a good example in the community so that my classmates be motivated to study harder and meet the expectation. I genuinely thank Professor Lee Sang-Gu and my classmates for the opportunities.”


April:

“I look forward to learning more thoroughly in both class and online sites as a group to dramatically improve not only my academic principles, but do I also try to be a good example in the community so that my classmates be motivated to study harder and meet the expectation. Professor Lee Sanggu’s class is not like any other class, it’s remarkable unique – connections. I genuinely thank Professor Lee Sanggu and my classmates for the opportunities I could get every day.”


May:

“As we students have going through a lot of fascinating concepts and finding the teams, we’ve learnt many things from not only the professor and class contents, but also from our teammates. My teammates (Team 1) 김찬호, 최세현, and 박재형 have been teaching me a lot and letting me know that there is so much to learn from them. I am extremely grateful for such hard work they put into the teamwork. As final exam is coming, I will do my best to help other students and improve contribution in class.”


Final:

“As final exams are coming soon, the last class moments have been bitter sweet – I learnt lots of fascinating concepts, which helped me get motivated my studies, and I managed to meet great students who I got a chance to work with. Professor Lee Sanggu is extremely enthusiastic and passionate in class, which helped the students develop greater interest in studying. I am extremely glad to have taken the course. I want to thank Professor Lee Sanggu for the opportunities he has given and the students who contributed many awesome improvements in class discussion – helping each other; not to mention my teammates (Team 1) – I want to thank my teammates김찬호, 최세현, and 박재형 helped and taught me tremendously in the class.”


I am extremely grateful for all the hard work all the students made contributing tremendously throughout the semester because they have been the core part of the class.


 Professor Lee Sang-Gu is a great enthusiastic director who motivated us, the students, to do more than just average and offered numerous opportunities to grow for us. He didn’t leave students who were struggling. He made the best students the best of the best.


 My teammates 김찬호, 최세현, and 박재형 have been the breathtaking brains who would always know how to solve problems and never hesitate to help.


It’s been an honor to study in the most intriguing class.


2019-06-11                                                       ■



Post -  Final Exam http://matrix.skku.ac.kr/2019-album/2019-S-DM-Final-Sol-Final-5.pdf    Comment by andrewchea  2019.06.23 21:39

Final exam review를 쓰기전에 한 학기동안 수고해주신 이상구 교수님과 TA분들께 감사인사 드립니다!

  시간을 거슬러 올라가 처음 이산수학에 대한 과목을 접했을때 부터 얘기하려고 합니다. 처음 이산수학이란 과목과 Action learning 에 대해서 들었을때 처음 듣는 수업방식이라 많이 당황하고 방황했던 1달이 기억이 납니다. 하지만 중간고사 시험 전후로 수업방식에 대한 이해도가 달라졌으며 팀 프로젝트를 진행할때는 저도 모르게 action learning을 통해 많은 점을 배우고 있다는 것을 느꼈습니다. 그리고 기말고사 기간이 되었을 때 저는 각 팀의 프로젝트 발표한 것을 바탕으로 공부를 했습니다.



기말고사 시험지를 받고 나서 느낀점은 학생들이 발표한 내용을 바탕으로 시험문제가 많이 나왔다는 것을 알수 있었고, 이러한 공부 방식이 교수님이 지향하는 공부 방식이라는 것을 기말고사 시험을 통해 알 수 있었습니다.

http://matrix.skku.ac.kr/2019-album/2019-S-DM-Final-Sol-Final-5.pdf

마지막으로 다시 한번 교수님과 TA분들께 감사인사를 드리면서 final exam review를 마치겠습니다.


 

Post-Final Exam Comment by panhuiling  2019.06.29 14:28

In this post, I would like to talk about my experience in Discrete Mathematics class. At first, I was very nervous for the course because the course is pretty new for me and I did not know how the lessons were going to be like. 

 As weeks go by, I finally understood the flow of the lesson and am very intrigued with the lessons.

I was also happy that I could communicate with my classmates and that we could work together to provide the best solutions for the problem exercises that we have. 

 What I think was very useful for me was making the PBL report. When making the PBL report, I could keep track of the progress that I have and it is basically a summary of the lessons that we have learned. 

 All things considered, I really liked the class.

 I am very grateful for the Professor, TAs and classmates who have helped me in my knowledge development.

 Thank you very much everyone and I wish all of you success! 

 

Post-Final Exam Comment  Final Review,  '성균'이라는 의미... by jinsu501   2019.06.24 14:49

 

이산수학 수업을 마지막으로 Final Review 써봅니다.

 사실 처음 이 수업이 pre-class를 듣고 오고 수업에서 내용을 토론하는 형식으로 진행된다고 하였을 때 당황했습니다. 수학이라는 학문을 이런 방향으로 접해본 적이 없어서 어떻게 앞으로 수업을 따라가지라는 걱정이 앞섰습니다. 그러나 일주일 지난 후 수업을 먼저 듣고 활발하게 qna를 통해 소통하는 저를 볼 수 있었습니다. 가장 인상깊었던 부분은 qna에 질문을 하면 빠른 속도로 다른 학우분들이 답변을 해주시고 교수님도 빠르게 confirm 해주시는 부분이었습니다. 이를 통해 궁금증을 바로바로 해결할 수 있었고 수업을 따라가는데에 큰 도움이 되었습니다. 이렇게 얻은 지식들을 바탕으로 다음 수업에서 저도 다른 학우분들의 궁금증을 해결해 준 적이 있고 큰 뿌듯함을 느꼇습니다.

분반 전체가 공부를 함께하는 기분이었습니다. 

 성균논어에서 '성균'이라는 의미가 '재능있는 사람들이 아직 완성하지 못한 부분을 완성하고, 다른 사람들과 함께 그 지식을 나누어라'라는 의미가 있다고 배웠습니다. 특히 이번에 수강한 이산수학같은 경우 '성균'의 의미를 가장 잘 실천하고 있는 과목이라는 생각이 들었습니다. 이 수업을 경험삼아 앞으로도 다른 수업을 들으면서 리더십있고 지식을 공유하는 방법으로 제가 노력한다면, 저 뿐 아니라 다른 모두에게도 긍정적인 영향을 미칠 수 있다고 생각합니다. 

 그동안 제 특별한 경험을 하게 해주시면서 수고해주신 같은 분반 학우분들과 교수님, 조교님꼐 감사드리며 학기를 마무리하도록 하겠습니다. 남은 학교생활 즐겁게 보내셨으면 좋겠습니다.


Post-Final Exam Comment by wlssud0701 019.06.23 14:14

한학기 모두들 수고 많으셨습니다.

여러가지 우여곡절이 많았지만 무사히 한학기 수업이 끝나서 기쁩니다.

이산수학이라는 과목을 총체적으로 공부하는데 많은 어려움이 있었으나,

이를 학우들과의 교류에 기반한 수업방식 덕분에 극복될 수 있었습니다.

시험은 이산수학 과목에서 중요한 부분들을 다시금 깨닫게 해주는 좋은 리마인더가 되어주었습니다. 이 기회를 살려 그간 학습한 내용을 바탕으로 소프트웨어 전공생은 이후 알고리즘을 비롯한 여러 전공공부에 큰 도움이 될것으로 기대합니다.

                       여러분 모두 수고하셨습니다.


Post-Final Exam Comment by chanho0912  2019.06.21 17:24


이번 학기 이산수학을 같이 수강한 학우분들, 그리고 고생해주신 교수님 모두 너무 고생하셨습니다.

 PBL report 준비한 것에서 많은 문제가 나와 재밌게 풀수 있는 기말고사였습니다!.

   http://matrix.skku.ac.kr/2019-album/2019-S-DM-Final-Sol-Final-5.pdf

열심히 준비하신 분들은 모두 좋은 결과를 받으셨을 것 같습니다.

 이번학기 자기주도 학습을 통해 좋은 결과를 얻게 되어 기쁩니다. 앞으로 모두 더 성숙해서 높은 곳에서 만났으면 좋겠습니다!.

 감사합니다!


Post-Final Exam Comment by sy3136  2019.06.21 10:24

이번 기말시험을 생각보다 잘 마무리해서 기분이 좋았습니다.

   http://matrix.skku.ac.kr/2019-album/2019-S-DM-Final-Sol-Final-5.pdf

기말시험은 QnA와 PBL활동을 하면서 봐왔던 문제들을 중심으로 나온다는 것을 알았습니다. 그래서 다른 학생들의 PBL 리포트를 보며 공부했었고 이로 인해 문제를 쉽게 풀 수 있었던 것 같습니다.


 이번 기말시험을 끝내면서 후련하기도 했으나 한편으로는 아쉽기도 합니다. 그래도 이번 이산수학의 수업을 들으면서 학업에 대한 열정과 자신감이 많이 올라간 느낌이 들어서 좋았습니다.

      이 경험으로 앞으로 남은 어려운 수업도 열심히 참여할 수 있을거라는 생각이 듭니다.  같이 이산수학을 들으신 학우분들 전부 고생하셨습니다!

                          Thank you for studying together!


Post-Final Exam Comment by dow0109  2019.06.21 20:00


기말고사를 마지막으로 2019년 1학기 이상구 교수님의 이산수학 강의가 끝났습니다.

이번 기말고사를 보고 여러가지를 느낄 수 있었습니다.


첫번째로 이번 기말고사에서는​다른 학생들과 토론하고 발전시킨 문제풀이들을 변형한 문제들이 출제 되었습니다.

   다른 강의에서는 단순히 교과서에 있는 문제 몇가지들을 임의로 선정하고 수정하여 출제했는데 이번 이산수학 강의에서는 학생들이 주도적으로 풀어보고 발전시킨 문제들이 주로 출제되었습니다.

 

두번째로는 스스로 배운 것을 써보는 문제가 있었습니다. 이제껏 배웠던 이산수학 9장의 용어, 개념 등을 적는 내용이었습니다. 문제를 맞추는 것이 중요한게 아니라 실제로 이 강의를 배우고 얼마나 많이 알고 있는지 물어보는 것 같았습니다.

 

세번째는 스스로 참여율을 적어보는 부분이 있었습니다. 보통 다른 강의들에서는 시험과 출석 등 참여 점수는 별개로 구분합니다.

  하지만 이번 이산수학에서는 강의를 마무리하는 차원에서 자신이 얼마나 이 과목에서 열심히 활동했는지 스스로 평가 해보는 공간이 있었습니다.    

         http://matrix.skku.ac.kr/2019-album/2019-S-DM-Final-Sol-Final-5.pdf

 

요약하자면 학생들이 얼마나 스스로 이산수학을 학습하고 참여했는지 시험하는 것 같았습니다. 강의 방법도 다른 강의와 달랐던 이산수학은 시험마저도 완전히 다르다는 것을 다시 한번 느낄 수 있었습니다.


단순한 지식의 축적을 테스트하는 것이 아니라 스스로 주도하고 협의하는 공부를 평가하는 이번 이산수학 기말고사가 평생토록 기억에 오래 남을 것 같습니다.


짧은 시간이었지만 많은 것을 깨닫게 해주시고 학생들을 독려해주시던 이상구 교수님 정말 감사드립니다. 또한 다른 학생분들 모두 시험보느라 수고하셨습니다. 여름방학 잘 보내시기 바랍니다.


Post-Final Exam Comment by damdin0430


First of all, I would like to say that all the students worked extremely hard, and I hope it will pay off.

 

  I am sure this Discrete Mathematics class has been very different and unique from other courses in a great way.

 

  I would like to thank Professor Sang-Gu LEE for helping and sharing his wisdom, and helping students who were struggling, not to mention that he tries to make the best students the best of the best.

   I want to thank everyone in the class whose contribution has been absolutely incredible.

  Especially, for my teammates (Team 1) 김찬호, 최세형, and 박재형, who are astonishingly smart and welcoming. I am extremely thankful that I got to study with them.

 

  Lastly, I hope everyone has success in the future on what you do.

                                Thank you.

                    

                   

 

       It was a good class because of you. 

 

               Thanks a lot ~~  2019-06-24    ■


2019 Spring SKKU Discrete Math  (Record of our class)
 

      - DM Lecture note &Lab and

      - Lectures of Prof.,  Prob &Solutions,

      - Student Presentations

 

            <Table of Contents> 

Ch. 1, Sets and Logic, Lecture Note
           
http://matrix.skku.ac.kr/2018-DM/Ch-1/   

    Ch-1-Lab   (Use Chrome browser, not IE)
 
  http://matrix.skku.ac.kr/2018-DM/DM-Ch-1-Lab.html   
  (DM Ch. 1, 동영상강의) Discrete Math 이산수학 Ch 0 Introduction 
https://youtu.be/9ahFnOFTWNQ 
Discrete Math 이산수학 Ch 1, 
https://youtu.be/J75uuYR-NTs (new)   
Ch 1 Solutions  
http://matrix.skku.ac.kr/2018-DM-Sol/Ch1/ 
2019 S DM PBL Ch1 and 2 이산수학 1장2장 문제풀이 양세중  
https://youtu.be/0aUOzf2FgZ0

 
Ch. 2, Proofs, Lecture Note
            
http://matrix.skku.ac.kr/2018-DM/Ch-2/   Ch-2-Lab   
  
http://matrix.skku.ac.kr/2018-DM/DM-Ch-2-Lab.html     (DM Ch. 2, 동영상강의) DM Ch 2 Proofs (1)    https://youtu.be/3LelrqADYUo   
DM Ch-2-Proofs (2)   
https://youtu.be/Xqa1eylod10  
Solutions  
http://matrix.skku.ac.kr/2018-DM-Sol/Ch1/  
[Ch 1 and Ch2 (Solution) Student Presentation] 
https://youtu.be/V3k4rcExSLc

 

​Ch. 3, Functions, Sequences, and Relations, Lecture Note
           
http://matrix.skku.ac.kr/2018-DM/Ch-3/  

  Ch-3-Lab http://matrix.skku.ac.kr/2018-DM/DM-Ch-3-Lab.html     

(DM Ch. 3, 동영상강의) DM Ch 3-1 Functions   https://youtu.be/Y_hAaUxEpq0  
DM Ch 3-2, 3-3, String, Relation  
https://youtu.be/c73e13Otzng 
DM Ch 3-4, 3-5, Equivalence Relations, Matrix of Relation, 
https://youtu.be/hwXAleCV4lA  
Solutions http://matrix.skku.ac.kr/2018-DM-Sol/Ch3/   
[Ch 3 (Solution) Student Presentation] 
https://youtu.be/PPgvlkCUbNY  
2019 S DM PBL Ch3 Ch4 Kim Team 3 : 김두원  
https://youtu.be/dlMluqSdT98

 

Ch 4, Algorithms, Lecture Note
                 
http://matrix.skku.ac.kr/2018-DM/Ch-4/ 
Ch-4-Lab 
http://matrix.skku.ac.kr/2018-DM/DM-Ch-4-Lab.html     (DM Ch. 4, 동영상강의) https://youtu.be/Dtv-9ykjFFA
Solutions http://matrix.skku.ac.kr/2018-DM-Sol/Ch4/    
2019 S DM PBL Ch3 Ch4 Kim Team 3 : 김두원  
https://youtu.be/dlMluqSdT98

 
Ch 5, Number Theory, http://matrix.skku.ac.kr/2018-DM/Ch-5/ 
Ch-5-Lab  
http://matrix.skku.ac.kr/2018-DM/DM-Ch-5-Lab.html     (DM Ch. 5, 동영상강의) DM 이산수학 Sec 5 1, 정수론 1, divisor https://youtu.be/yJL6lP4k0Bg
 DM 이산수학 Sec 5.2, 5.3 정수론 2, Number Theory 2, 진법, 유클리드알고리즘
  
https://youtu.be/-3BeY2_CBDk 
Solutions 
http://matrix.skku.ac.kr/2018-DM-Sol/Ch5/  
[Ch 4 &5 (Solution) Student Presentation] 
https://youtu.be/qVCvZc2s6eA  
2019 S DM PBL Ch5 이산수학 5장 문제풀이 김은민  
https://youtu.be/JXC0VujdGA4

 
Discrete Math 이산수학(Ch 1-5), Review, 
https://youtu.be/LMpAfgJ33Ts 
Midterm PBL Student Presentation 1 (Dan Din, 김찬호) 
https://youtu.be/I1eMRnYiGgE 
Midterm PBL Student Talk 2 (Simen, Gam, Choi세현, ... Aingel, Kim은민) 
https://youtu.be/fDIGzrbkYWg

 

[week 8] Midterm Exam  
    
http://matrix.skku.ac.kr/2019-Album/2019-S-DM-Midterm-Exam-F4-Sol.pdf 
    
http://matrix.skku.ac.kr/2018-album/2018-F-DM-Midterm-Exam-Sol-F2-marked.pdf   
    Midterm Exam  review  
https://youtu.be/AqO_SCVqTCA

 

Ch 6, Counting Methods and the Pigeonhole Principle Lecture Note & 

        Lab http://matrix.skku.ac.kr/2018-DM/DM-Ch-6-Lab.html  
    (DM Ch. 6) 이산수학 Ch 6 일반화된 순열조합과  비둘기집  
https://youtu.be/I6XW6DKLoCU
        
http://matrix.skku.ac.kr/2018-DM-Sol/Ch6/ 
2019 S DM PBL Ch6 Kim team 7 김세진  https://youtu.be/_lxv-cysbGQ


Ch 7, Recurrence Relations  (점화식),   - Lecture Note &Lab  
 
 http://matrix.skku.ac.kr/2018-DM/DM-Ch-7-Lab.html        http://discretetext.oscarlevin.com/dmoi/sec_recurrence.html 
    (DM 이산수학 Ch 7, 동영상강의) ,  
https://youtu.be/1n0dC_ICo4U
        
http://matrix.skku.ac.kr/2018-DM-Sol/Ch7/


Ch 8, Graph Theory - Lecture Note 
 http://matrix.skku.ac.kr/2018-DM/DM-Ch-8-Lab.html  
* Graph Terminology and Lab :
     
 http://matrix.skku.ac.kr/2014-Album/Graph-Project.html 

Sec 8.1 Graph Theory https://youtu.be/TSFIJBU2dX8
Sec 8.2 Path and Cycle 
https://youtu.be/iqUTT5C1TOs 
(DM Sec 8.3 동영상강의) Hamiltonian cycle  
https://youtu.be/at7Hx5wxnYk
(DM Sec 8.4, 8.5, 8.6. 8.7-동영상강의)  
https://youtu.be/MHDJ3rALtEU
이산수학 Ch 8 Graph 이론 part2 다익스트라알고리즘 (한국어강의) 
https://youtu.be/Pe13RXWiuQE


http://discretetext.oscarlevin.com/dmoi/sec_gt-intro.html

 
 8.1   Introduction
 8.2   Paths and Cycles (Graphs)
 8.3   Hamiltonian Cycles and the Traveling Salesperson Problem
 8.4   A Shortest-Path Algorithm
 8.5   Representations of Graphs
 8.6   Isomorphisms of Graphs
 8.7   Planar Graphs

Solution http://matrix.skku.ac.kr/2018-DM-Sol/Ch8/ 
Ch-8-PBL-Solution-모하메드 
https://youtu.be/f7_WFw6AtAE

 

Ch 9, Trees   - Lecture Note 
  
http://matrix.skku.ac.kr/2018-DM/DM-Ch-9-Lab.html 
    9.1   Introduction
    9.2   Terminology and Characterizations of Trees
    9.3   Spanning Trees
    9.4   Minimal Spanning Trees
    9.5   Binary Trees
    9.6   Tree Traversals
    9.7   Decision Trees and the Minimum Time for Sorting
    9.8   Isomorphisms of Trees
 (DM Ch 9, Part 1)   
https://youtu.be/v6wQeWmMBq8  
 (DM Ch 9, Part 2)   
https://youtu.be/gl1cD6-0prs

 Ch-9-PBL-Problems-Solution by 오동찬
     
http://matrix.skku.ac.kr/2018-DM-Sol/Ch9/  
Ch-9-PBL-Solution-오동찬.mp4  
https://youtu.be/nvwYSFwCoFo 
2019 S DM PBL Ch9 Team 6 Simen https://youtu.be/DzMo4cfDLFY


[week 15] Final PBL Presentation 
2019 S DM PBL 이산수학 PBL발표 김찬호 최세현 담딘  
https://youtu.be/i9FPdZdrFJw

 

[week 16]  Final Exam  

  http://matrix.skku.ac.kr/2019-album/2019-S-DM-Final-Sol-Final-5.pdf

 

CH 10, Network Models (if time permits)  
           
https://www.scribd.com/document/7084685/Network-Models-05 
Ch 11 Boolean Algebras and Combinatorial Circuits (if time permits)
    
http://ocw.nctu.edu.tw/course/digital%20design/Logic%20DesignCh02.pdf Ch 12 Automata, Grammars, and Languages (if time permits)
      
http://www.utu.fi/en/units/sci/units/math/staff/Documents/karhumaki/automata05.pdf CH 13 Computational Geometry (if time permits) http://cs.au.dk/~gerth/cg08/index.html 
       
http://people.inf.elte.hu/fekete/algoritmusok_msc/terinfo_geom/konyvek/Computational%20Geometry%20-%20Algorithms%20and%20Applications,%203rd%20Ed.pdf 
Appendix

https://www.uwrf.edu/MATH/DiscreteMathematicsAppendixC.cfm
 
http://math.aalto.fi/opetus/dmp/lect-12/appendix-12-2-2on1.pdf


      http://matrix.skku.ac.kr/2019-album/