본문 바로가기

전체 글

(64)
Relation Generalized Unions and Intersections union과 intersection은 commutative하고 associative하기 때문에, 임의대로 순서를 정하고 grouping해도 된다. big U, big ∩ notations Relation A와 B의 관계는 AxB의 부분 집합으로 표현 가능하다. Complementary Relations : 전체 AxB 집합에서 R 집합의 원소를 제외한 집합을 의미한다. Inverse Relation : 원래의 relation의 순서를 반대로 한 relation A 집합과 A 집합 그 자신과의 Relation을 구한 것을 a relation on the set A라고 한다. Identity relation = {(a,a) | a ∈ A} P..
Algorithm Analysis 1. Algorithm Efficiency - A, B 두가지 알고리즘이 있을 때 알고리즘을 선택하는 기준은? 컴퓨터 프로그램 디자인의 목표 1) 알고리즘을 이해하기 쉽게, 코딩하기 쉽게, 디버그하기 쉽게 디자인하는 것 2) 컴퓨터의 resources를 효율적으로 활용할 수 있게 하는 것 2)이 자료구조와 알고리즘 분석의 주요 관심사! 알고리즘 cost를 어떻게 측정할 것인가? 2. Measure Efficiency 2-1. Measuring Efficiency의 정의 : running time depends on "size" of the input(n) : T(n) - we count the number of basic operations T(n) : n! > 2^n > 2n^2 > 5nlogn > 2..
Working with combinational logic 1. Simplification 1-1. two-level simplication Implicant : subcube를 이루는 on-set이나 dc-set을 칭하는 말. Prime implicant : 더 큰 subcube로 묶을 수 없는 implicant Essential prime implicant : prime implicant 중에 다른 prime implicant로 포함되지 않는 on-set을 가진 것 목표 : implicant를 prime implicant로 만들기 on-set을 적은 수의 prime implicant로 커버하기 Algorithm : K-map으로 가장 적은 term의 SoP 만들기 1. On-set의 엘리먼트 선택 2. 해당 on-set의 가장 큰 그루핑하기 : prime i..
Mathematical Preliminaries 1. Set Concepts and Notation set notation => 중학교 때 배운 것..아재요.. powerset => 한 집합의 가능한 모든 부분 집합(subset)들의 집합 multiset => set 내부의 복제품을 가진 것 (ex. {a, a, b}, {a, a, b, b, b}) 2. Relation 2-1. 정의 relation R over a set S는 S로부터 만들어진 R의 규칙으로 정렬된 pair들. $R \times R \subseteq$ relation R over a set S ex) S = {1, 2, 3}
Predicate Logic & Set A formal proof of a conclusion C 알고 있는 premises들로 결론을 추론해내는 것 P1 -> P2 -> ... -> C Inference Rules for Quantifiers Universal instantiation => Universal Quantifier를 임의의 원소 c로 바꾸는 것 Universal Generalization => 임의의 원소 c를 Universal Quantifier로 바꾸는 것 Existential instantiation => Existential Quantifier를 특정한 원소 c로 바꾸는 것 Existential Generalization => 특정한 원소 c를 Existential Quantifier로 바꾸는 것 해당 기법들을 통해서 q..
JAVA for-Each Loop 수업 시간에 배운 신기한 것, JAVA for-Each Loop c++의 iteration 변수를 선언하는 것과 비슷한 듯한데, 보통 배열을 전체 순회하고자 한다면, 아래와 같이 선언할 수 있다. public class Practice { public static void main(String[] args){ char[] test = new char[]{'a', 'b', 'c'}; int[] test2 = new int[]{0, 1, 2, 3, 4}; for(int i = 0; i < test.length; i++){ System.out.print(test[i] + " "); } System.out.println(); for(int i = 0; i < test2.length; i++){ System.ou..
JAVA/C++ 반복문 탈출(break, label) 코딩을 할 때 2중으로 for문이 있거나 while문을 돌릴 때, 전체 반복문을 탈출하고 싶을 때가 있다. 그럴 때 break를 사용하게 되면, 현재 반복문만 통과하기 때문에 상위의 반복문은 여전히 돌아간다. 만약 전체 반복문을 탈출하고 싶다면 labeling을 사용해서 통과해줄 수 있다! 아래 코드를 보자 public class Practice { public static void main(String[] args){ char[] test = new char[]{'a', 'b', 'c'}; int[] test2 = new int[]{0, 1, 2}; int i = 0; loof1 : while(true){ System.out.println("i : " + i); for(int j : test2) { i..
JAVA 입력 받는 법(print, printf, println) print : 괄호 안 문자를 출력한다. 개행문자(\n)는 포함이 안됨. printf : 표현형을 사용해서 출력할 수 있게 한다. c/c++의 printf와 동일 println : 개행 문자를 포함해서 출력을 한다. public class Main{ public static void main(String[] args){ String name = "chavo"; int age = 26; System.out.print("Hi "); System.out.printf("I'm %s, %d years old. ", name, age); System.out.println("println"); System.out.println("println2"); } } 출력 Hi I'm chavo, 26 years old. pr..