본문 바로가기

Computer Science

11 Orthogonal complements 11. Orthogonal complementsOrthogonal complementsV perp is equal, to the set of all x's, all the vectors x that are a member of our $R^n$, such that x dot V is equal to zero for every vector V that is a member of our subspace.Then what does this imply?What is a fact that a and b are members of V prep?√ That means a dot V, where this V is any member of our original subspace is V, is equal to 0 for.. 더보기
10 Transpose of a matrix Transpose of a matrix Let's define a transpose matrix. Transpose of a transpose matrix A is same with the matrix A! Determinant of transpose Let's assume determinant of any nxn matrix B is equal to the determinant of B's transpose. Then will it be the same if the matrix is (n+1) x (n+1)? Transpose of sums and inverses ) This means that C transpose is equal to the transpose of (A+B)! Rank(a) = ra.. 더보기
09 function, pointer 09-01. 함수가 필요할 때 왜 함수가 필요한지, 어떤 경우에 함수가 필요한지부터 알아보자. 함수를 사용하지 않던 코드들을 함수를 사용하여 동작하도록 하는 것을 re-factoring이라고 한다. #define _CRT_NOSECURE_NO_WARNINGS #include #include // strlen() #include #define WIDTH 40 #define NAME "ChangHyun Oh" #define ADDRESS "CA, USA" void print_chars(char c, int n_stars, bool endl) { for (int i =0; i < n_stars; ++i) printf("%c",c); if (endl == true) printf("\n"); } void prin.. 더보기
08 Input Output 08-01. 입출력 버퍼 버퍼란 입력을 받거나 출력을 할때, 한꺼번에 모아서 입출력을 하여 효율성을 높게 해준다. 전반적으로 다양한 경우에서 사용된다. 보면, 우리는 hello를 입력했고 한 글자씩 입출력이 되는 것을 예상할 것이다. 하지만 실제 실행결과를 보면, hello 전체를 입력, 출력함을 알 수 있을 것이다. 08-02. End Of File(EOF) ASCII code는 양수밖에 없다. 하지만 왜 unsigned int가 아니라 int로 변수를 선언해 입력을 받을까? 이유는 EOF 때문이다! EOF는 -1로 define되어 있다! int main() { int c; while((c = getchar()) != EOF) //End Of File putchar(c); } 또 하나 중요한 개념이 있.. 더보기
07 If문 07-01. if #define _CRT_SECURE_NO_WARNINGS #include int main() { int number; printf("input a positive integer : "); scanf("%d", &number); // Todo: print even or odd if (number % 2 ==0) printf("Even"); else if (number % 2 != 0) printf("ODD"); return 0; } 07-02. getchar(), putchar() example char을 입력받아서 출력하기 int main() { /* 1. Introduc getchar(), putchar() 2. Use while loop to process char sequences.. 더보기
06 For 06-11. comma operator #define _CRT_SECURE_NO_WARNINGS #include int main() { for (int n=1, nsqr = n*n; n i++ is operated before comma printf("%d %d \n", i, j); } 제논의 역설 시뮬레이션 예제 절대 따라갈 수 없는 토끼와 거북이 이야기를 들어본 적이 있을 것이다. int main() { /* Simulatino of Moving object */ const double speed = 1.0; const unsigned repeat_max = 7; // 최대 반복 횟수는 보통 양의 정수이기때문에 함(걍 int써도 됨) double dt = 1.0; double time = 0.0; /.. 더보기
09 Linear transformation examples Linear transformation examples: Scaling and reflections Linear transformation examples: Rotations in R2 The rotation of some vector x is going to be equal to a counterclockwise theta degree rotation of x. Rotation in R3 around the x-axis You can generalize in R3. You can try this also in y, z axis. Unit vector unit vector is a vector that has length of 1. At any of dimension, it has length of 1. 더보기
08 Functions and linear transformations A more formal understanding of functions Range: subset of the codomain that the function actually maps to Vector transformation Linear transformations Let's see this Transformation is a lienar treanformation. We have to check the conditions. This conficts with the requirement for a linear tranformation. So this is not a linear transformation! Matrix vector products as linear transformations By m.. 더보기