달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

'전자공학이론/이산수학'에 해당되는 글 13

  1. 2015.12.10 Binary Tree
  2. 2015.12.10 Spanning Tree
  3. 2015.12.10 Tree
  4. 2015.12.09 Isomorphic Graphs / Homeomorphic graphs/ Planar graph
  5. 2015.12.09 A shortest-path algoritnm
  6. 2015.12.09 Euler cycle & Hamiltonian cycle
  7. 2015.12.09 Graph
  8. 2015.10.17 6. Proofs
  9. 2015.10.17 5. Proposition
  10. 2015.10.17 4. function
2015. 12. 10. 02:37

Binary Tree 전자공학이론/이산수학2015. 12. 10. 02:37

Binary Tree

A binary tree is a rooted tree where each vertex has zero, one or two children.

Isomorphic binary trees

Let T1 be a binary tree with root r1 and let T2 be a binary tree with root r2. 

The binary trees T1 and T2 are isomorphic if there is one-to-one, onto function f from the vertex set of T1 to the vertex set of T2 satistying the following:

(a) T1 and T2 are isomorphic as rooted trees through an isomorphism f.

(b) v is a left (right) child of w in T1 if and only if f(v) is a left (right) child of f(w) in T2.

Terminal vertices and Height

If a binary tree of height h has t terminal vertices, then

t<=2^h

Full binary tree

A full binary tree is a binary tree in which each vertex has two or no children.

If T is a full binary tree with i internal vertices, then T has i+1 terminal vertices and 2i+1 total vertices.





Binary Search Tree

A binary search tree is a binary tree T in which data are associated with the vertices. for each vertex v in T, each data item in the left subtree of v is less than the data item in v, and each data item in the right subtree of v is greater than the data item in v.




Decision Tree

Decision Tree is a rooted tree If we begin at the root, answer each question, and follow the appropriate edge, so that we eventually arrive at a  deciding terminal vertex

Theorem

when a problem has t number of all possible result , if the decision tree has n possible answering number per one vertex and h height, then   

t<=n^h








'전자공학이론 > 이산수학' 카테고리의 다른 글

Spanning Tree  (0) 2015.12.10
Tree  (0) 2015.12.10
Isomorphic Graphs / Homeomorphic graphs/ Planar graph  (0) 2015.12.09
A shortest-path algoritnm  (0) 2015.12.09
Euler cycle & Hamiltonian cycle  (0) 2015.12.09
:
Posted by youjin.A
2015. 12. 10. 01:32

Spanning Tree 전자공학이론/이산수학2015. 12. 10. 01:32

Spanning Tree

A tree T is a spannig tree of a graph G if T is a subgraph of G that contains all of the vertices of G.


method to find a spanning tree

Breadth-First search is a method to process all the vertices on a given level before moving to the next-higher level.

Depth-First search is a method to proceeds to successive levels in a tree at the earliest possible opportunity.

Breadth-First search       Depth-First search

      


Minimal spanning tree

Let G be a weighted graph. A minimal spanning tree of G is a spanning tree of G with minimum weight.


Algorithm to find a minimal spanning tree

Prim's Algorithm begins with a single vertex. Then at each iteration, it adds to the current tree a minimum-weight edge that does not complete a cycle.

Kruskal's algorithm find the edge in the graph with smallest weight that does not complete a cycle.

Prim's Algorithm

Kruskal's algorithm







'전자공학이론 > 이산수학' 카테고리의 다른 글

Binary Tree  (0) 2015.12.10
Tree  (0) 2015.12.10
Isomorphic Graphs / Homeomorphic graphs/ Planar graph  (0) 2015.12.09
A shortest-path algoritnm  (0) 2015.12.09
Euler cycle & Hamiltonian cycle  (0) 2015.12.09
:
Posted by youjin.A
2015. 12. 10. 01:21

Tree 전자공학이론/이산수학2015. 12. 10. 01:21

Tree

A (free) tree T is a simple graph such that for every pair of vertices v and w there is a unique path from v to w.

A rooted tree is a tree where one of its vertices is designated the root.


Isomorphic rooted trees

Let T1 be a rooted tree with root r1 and let T2 be a rooted tree with root r2. 

The rooted trees T1 and T2 are isomorphic if there is a one-to-one, onto function f from the vertex set of T1 to the vertex set of T2 satisfying the following:

(a) (vi, vj) ∈ T1 if and only if (f(vi), f(vj)) ∈ T2.

(b) f(r1) = r2.


Level & height

The level of a vertex v is the length of the simple path from the root to v.

The height of a rooted tree is the maximum level number of its vertices.


Terminology

Let T be a tree with root v0. Suppose that x, y and z are vertices in T and that (v0, v1, ..., vn) is a simple path in T, then

(a) the parent of v(n) is v(n-1).

(c) a child of v(n-1) is vn.

(b) ancestors of v(n) are v0, ..., v(n-1).

(d) descendants of v(n-2) are v(n-1), vn.

(e) x and y are siblings if x and y are children of z.

(f) a terminal vertex (or a leaf) is a vertex that has no children.

(g) an internal (or branch) vertex is a vertex that has at least one child. 

(h) a subtree T' of a tree T is a graph where

V(T') = { v0 and the descendants of v0 }

E(T') = { e | e is an edge on a simple path from v0 to some vertex in V(T') }


Theorem

Let T be a graph with n vertices. The following are equivalent.

(a) T is a tree.

(b) T is connected and acyclic.

(c) T is connected and has n-1 edges. //vertex들을 연결할 수 있는 최소한의 구조

(d) T is acyclic and has n-1 edges.











'전자공학이론 > 이산수학' 카테고리의 다른 글

Binary Tree  (0) 2015.12.10
Spanning Tree  (0) 2015.12.10
Isomorphic Graphs / Homeomorphic graphs/ Planar graph  (0) 2015.12.09
A shortest-path algoritnm  (0) 2015.12.09
Euler cycle & Hamiltonian cycle  (0) 2015.12.09
:
Posted by youjin.A

Isomorphic Graphs

Graphs G1 and G2 are isomorphic if there is a one-to-one, onto function f from the vertices of G1 to vertices of G2 and a one-to-one, onto function g from the edges of G1 to the edges of G2, so that e=(v,w) in G1 if and only if g(e)=(f(v), f(w)) in G2.

Theorem

Graphs G1 and G2 are isomorphic if and only if for some ordering of their vertices, their adjacency matrices are equal.




Homeomorphic graphs

Graphs G1 and G2 are homeomorphic if G1 and G2 can be reduced to isomorphic graphs by performing a sequence of series reductions




Planar graph

A graph is planar if it can be drawn in the plane without its edges crossing,

Theorem 1

if G is a connected planar graph, then v-e+f=2 and 2e>=sf.

v=number of vertices

e=number of edges

f=number of faces, including the exterior face

s=minimum number of edges for making a face

Theorem 2

G is a planar graph if and only if G does not contain a subgraph homeomorphic to either K5 or K3,3.

following graph is not planar:








'전자공학이론 > 이산수학' 카테고리의 다른 글

Spanning Tree  (0) 2015.12.10
Tree  (0) 2015.12.10
A shortest-path algoritnm  (0) 2015.12.09
Euler cycle & Hamiltonian cycle  (0) 2015.12.09
Graph  (0) 2015.12.09
:
Posted by youjin.A
2015. 12. 9. 20:58

A shortest-path algoritnm 전자공학이론/이산수학2015. 12. 9. 20:58

Dijkstra's Algorithm

Input:    A connected, weighted graph in which all weights are positive;

vertices a and z

Output:    L(z), the length of a shortest path from a to z

1
2
3
4
5
6
7
8
9
10
11
12
13
dijkstra(w, a, z, L){
    L(a) = 0
    for all vertices x≠a
        L(x) = ∞
    T = set of all vertices
 
    while(z∈T){
        choose v∈T with minimum L(v)
        T = T-{v}
        for each x∈T adjacent to v
            L(x) = min{L(x), L(v) + w(v, x)}
    }
}
cs

2~5행:     vertex a의 길이를 0으로 설정하고 a를 제외한 나머지 vertex의 L은 ∞로 설정한다. T는 그래프              의 모든 vertex의 집합이다.

8~11행:     T안에있는 vertex 중에서 L이 최소인 vertex v를 선택하고 그 v를 집합 T에서 삭제한다. T에                 포함되어 있는 것중 v와 연결되어 있는 vertex에 대하여, L를 업데이트한다. 이것은 z가 T에                 포함되지 않을 때가지 반복한다.

 ***최소 path 찾기*** vertex에 label을 붙일 때, 최소 길이 뿐만아니라 이어지는 바로 전 vertex의 이름을 같이 적으면 두 vertex 사이의 최소 path를 찾을 수 있다.






'전자공학이론 > 이산수학' 카테고리의 다른 글

Tree  (0) 2015.12.10
Isomorphic Graphs / Homeomorphic graphs/ Planar graph  (0) 2015.12.09
Euler cycle & Hamiltonian cycle  (0) 2015.12.09
Graph  (0) 2015.12.09
6. Proofs  (0) 2015.10.17
:
Posted by youjin.A

Euler cycle

An Euler cycle in a graph G is a cycle that passes through every edge of G only once.

Theorems

A graph G has an Euler cycle if and only if G is a connected graph and every vertex has even degree.




Hamiltonian cycle 

Hamiltonian cycle in a graph G is a cycle that visit every vertex of G only once by a simple cycle.

n-Cube

The n-cube, denoted I^n (n>=1), has 2^n vertices labeled 0, 1, 2, ..., 2^(n-1) , and edges connecting two vertices if the binary representation of their labels differ in exactly one bit.

n-Cube can be made from (n-1)-Cube by the following rules:

1) Let H1 and H2 be two (n-1)-Cubes whose vertices are labeled in binary 0, ..., 2^(n-1)-1.

2) Place an edge between each pair of vertices, one from H1 and one from H2, provided that the vertices have identical labels.

3) Change the label L on each vertex in H1 to 0L and change the label L on each vertex in H2 to 1L.

Gray code and Hamiltonian cycle 

 The n-Cube has a Hamiltonian cycle(n>=2).

Let Gn a n-bit Gray code, then that is a Hamiltonian cycle in n-Cube.

Gn is made from G(n-1) by the following rules:

(a) Let G^R(n-1) denote the sequence G(n-1) written in reverse.

(b) Let G'(n-1) denote the sequence obtained by prefixing each member of G(n-1) with 0.

(c) Let G''(n-1) denote the sequence obtained by prefixing each member of G^R(n-1) with 1.

(d) Let Gn be the sequence consisting of G'(n-1) followed G^n(n-1).










'전자공학이론 > 이산수학' 카테고리의 다른 글

Isomorphic Graphs / Homeomorphic graphs/ Planar graph  (0) 2015.12.09
A shortest-path algoritnm  (0) 2015.12.09
Graph  (0) 2015.12.09
6. Proofs  (0) 2015.10.17
5. Proposition  (0) 2015.10.17
:
Posted by youjin.A
2015. 12. 9. 10:36

Graph 전자공학이론/이산수학2015. 12. 9. 10:36

Graph

A graph(or undirected graph) G consists of a set V of vertices(or nodes) and a set E of edges(or arcs) such that each edge e∈E is associated with an unordered pair of vertices.

G = (V , E)


A simple graph is a graph without loops or parallel edges.


Subgraph

Let G = (V, E) be a graph, we call (V', E') a subgraph of G if

(a) V'⊆V

(b) E'⊆E such that for every edge e'∈E', if e' is incident on v' and w', then v',w'∈V'.




Degree

The degree of a vertex v, denoted by δ(v), is the number of edges incident on v.

Theorems

if G is a graph with n vertices and m edges, then

sum(δ(vi))[i=1~n] = 2m


Path

A path from vo to vn of length n is an alternation sequence of n+1 vertices and n edges beginning with vertex vo and ending with vertex vn,

(vo, e1, v1, e2, v2, ..., vn-1, en, vn),

in which edge ei is incident on vertices vi-1 and vi for i = 1, ..., n


A simple path from v to w is a path from v to w with no repeated vertices.

Theorems

A graph has a path with no repeated edges from v to w(v≠w) containing all the edges and all vertices if and only if it is connected and v and w are the only vertices having odd degrees.


Cycle

A cycle(or circuit) is a path of nonzero length from v to v with no repeated edges.


A simple cycle is a cycle from v to v in which, except for the beginning and ending vertices that are both equal to v, there are no repeated vertices.

Theorems

If a graph G contains a cycle from v to v, G contains a simple cycle from v to v




connected

The connected graph is the graph in which for any vertices v and w in G, there is a path from v to w.


Complete 

The complete graph on n vertices, denoted Kn, is the simple graph with n vertices in which there is an edge between every pair of distinct vertices.


Bipartite

The bipartite graph is the graph whose vertex set V is partitioned into sets V1 and V2 such that V1V2 = Φ, V1V2 = V, and each edge in E is incident on one vertex in V1 and one vertex in V2.


The complete bipartite graph on m and n vertices, denoted Km,n, is the simple graph whose vertex set is partitioned into sets V1 with m vertices and V2 with n vertices, and the edge set consists of all edges of the form (v1, v2) with v1∈V1, and v2∈V2. 








'전자공학이론 > 이산수학' 카테고리의 다른 글

A shortest-path algoritnm  (0) 2015.12.09
Euler cycle & Hamiltonian cycle  (0) 2015.12.09
6. Proofs  (0) 2015.10.17
5. Proposition  (0) 2015.10.17
4. function  (0) 2015.10.17
:
Posted by youjin.A
2015. 10. 17. 06:16

6. Proofs 전자공학이론/이산수학2015. 10. 17. 06:16

    은 axiom이다


Direct proof

hypothesis를 true라 두고, conclusion을 유도.


-Mathematical Induction

N을 양의 자연수의 집합이라 하고, S(n)을 propositional function이라 하자.

(∀n)S(n)         D: N

를 증명하기 위해서는 이 proposition을 

∀n[ S(n) -> S(N+1) ]

로 바꾸어서 Direct proof를 보이면 된다.


Proof by contradiction

conclusion을 false라 두고, hypothesis와의 contradiction을 보임.





'전자공학이론 > 이산수학' 카테고리의 다른 글

Euler cycle & Hamiltonian cycle  (0) 2015.12.09
Graph  (0) 2015.12.09
5. Proposition  (0) 2015.10.17
4. function  (0) 2015.10.17
3. Relation  (0) 2015.10.17
:
Posted by youjin.A
2015. 10. 17. 05:55

5. Proposition 전자공학이론/이산수학2015. 10. 17. 05:55

    는 Definition을 나타내고,      는  Theorem을 나타낸다.


proposition

A sentence that can be determined to be either true or false.


hypothesis and conclusion

Hypothesis is the given proposition.

Conclusion is the proposition that follows from the hypothesis.

 

connectives

forming new compound proposition.

~p (NOT)

p ^ q (AND) 

p v q (OR) 

p -> q 

T

 F

 T

 T

 T

T

F

 F

 F

 T

 F

F

T

 T

 F

 T

 T

F

F

 T

 F

 F

 T

-conditional propositions: p->q

"If P, then q. " or "p only if q."

p: hypothesis , q: conclusion

-Biconditional proposition: p<->q

it equal (p->q) ^ (q->p)

"p if and only if q" of "p iff q"

- the order of evaluation is first ~, then ^, then v, last ->.


Logical equivalence

Two truth tables are identical, denoted P ≡ Q.

 p -> q  ~p v q

② contrapositive 

p -> q ~q -> ~p

 De Morgan's lows

~(p ^ q) ≡ ~p v ~q

~(p v q) ≡ ~p ^ ~q

 a v ( b ^ c) ≡ (a v b) ^ (a v c) 

    a ^ ( b v c) ≡ (a ^ b) v (a ^ c) 

- p -> q ≡ ~p v q

p 

 q

 p -> q

  ~p v q

 T

 T

 T

 T

 T

 F

 F

 F

 F

 T

 T

 T

 F

 F

 T

 T

-contrapositive

 q

 p -> q

  ~p ->~q

 T

 T

 T

 T

 T

 F

 F

 F

 F

 T

 T

 T

 F

 F

 T

 T

-converse

 q

 p -> q

  q -> p

 T

 T

 T

 T

 T

 F

 F

 T

 F

 T

 T

 F

 F

 F

 T

 T



Rules of inference

if all hypotheses is true, then the conclusion is true.

simplification

p^q


------

∴p

conjunction

p

q

-------

∴p^q

disjunction syllogism

p∨q

~p

-------

∴q

addition

p


------

∴p∨q

 modus ponens

p->q

p

------

∴q

modus tollens

p->q

~q

------

∴~p 

 hypothetical syllosism

p->q

q->r

-------

∴p->r

 


Propositional function

Let P(x) be a statement(not a proposition) involving the variable x and let D be a set. We call P a propositional function if for each x∈D, P(x) is a proposition.

P: n은 홀수이다. 여기서 P가 True이나 False이냐는 변수 n에 의해 결정되기 때문에 proposition이 아니다. n = 103이면 P는 true이고 n=8이면 P는 false이다.


quantifier

The symbol ∀ means "for all".

Let P be a propositional function with domain of discourse D. The statement

for all x, P(x)

may be written 

(∀x)P(x).

it is true if for all x in D, P(x) is true.


-∃

The symbol ∃ means "there exists".

there exist x, P(x)

may be written 

(∃x)P(x).

it is true if for at least one x in D, P(x) is true.

quantifier가 있는 변수가 두 개인 propositional function은 주어가 중요하다. 예를 들어 y, x∈people일 때,  ∀x∃y(x loves y)은 people내에 있는 모든 x에 대하여, 참이면 참이다. 그리고 ∃x∀y(x loves y)는 people내에 있는 적어도 하나의 x에 대하여, 주어진 명제가 참이면 참이다.  

 

Generalized De Morgan's laws for Logic

~(∀x P(x))  (∃x)~P(x)

~(∃x P(x)) ≡ (∀x)~P(x)

1) ∀x P(x) is false.

if for at least one x in D, P(x) is false.

2) ∀x∃y P(x) is false.

~(∀x∃y P(x)) ≡ (∃x)~(y P(x)) ≡ (∃x)(∀y)(~P(x)) 

if for at least one x in D and for all y in D, P(x) is false.




문제













'전자공학이론 > 이산수학' 카테고리의 다른 글

Graph  (0) 2015.12.09
6. Proofs  (0) 2015.10.17
4. function  (0) 2015.10.17
3. Relation  (0) 2015.10.17
2. Sequence  (0) 2015.10.16
:
Posted by youjin.A
2015. 10. 17. 05:54

4. function 전자공학이론/이산수학2015. 10. 17. 05:54

function

A function f from a set X to a set Y(f : X->Y) is a subset of XxY such that for all x∈X, there is exactly one y∈Y with (x, y)∈f.


floor and ceiling

The floor of x, denoted └x┘, is the greatest integer less than or equal to x.

The ceiling of x, denoted ┌x┐, is the least integer greater than or equal to x.


Properties of a function f 

one-to-one                          for all x1, x2∈X, if(x1) = f(x2), then x1 = x2.

onto                                   for all y∈Y, there exists x∈X such that y=f(x).

- bijection                              one-to-one, onto

- Binary operator on a set X       a function from X x X to X

- unary operator on X               a function from X to X


inverse of f

Let f be a bijection function from X to Y.

the inverse of f, denoted f^-1, is the funtion from Y to X defined by

f^-1 = { (y, x)| (x, y) ∈ f}


composition

Let g be a function from X to Y and f be a funtion from Y to Z.

the composition of f with g, denoted f ∘ g, is the funtion from X to Z defined by

f ∘g(x) = f( g(x) )




'전자공학이론 > 이산수학' 카테고리의 다른 글

6. Proofs  (0) 2015.10.17
5. Proposition  (0) 2015.10.17
3. Relation  (0) 2015.10.17
2. Sequence  (0) 2015.10.16
1. Set  (0) 2015.09.08
:
Posted by youjin.A