루트 정리: 분리 전 잔재(_archive·옛 logseq 설정·빈 폴더) 제거 — before-graph-split 태그로 복원 가능
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G8rNxLqi5rYjRamC8uwiJW
@ -12,7 +12,7 @@ disable-anki-sync:: true
|
||||
- `Major Study/` — 전공 (스트랭 선형대수학). Anki 프로파일 **Major Study**
|
||||
- 각 그래프는 자기 `pages/ assets/ logseq/ journals/`를 가진다. **그래프 간 `[[링크]]`·`((uuid))` 참조는 불가능**하다.
|
||||
- **Anki 동기화 규칙**: 그래프↔프로파일 1:1. 플러그인은 "그 순간 Anki에 열려 있는 프로파일"에 싱크하므로, **싱크 전에 반드시 짝이 맞는 프로파일이 열려 있는지 확인**한다 (Claude가 AnkiConnect `deckNames`로 확인 가능). 싱크 미리보기에서 **create/delete가 0이 아니면 진행 금지** (잘못된 프로파일 신호). 프로파일을 나눈 이유: 플러그인이 "현재 그래프에 없는 카드 = 삭제 대상"으로 취급해, 한 프로파일을 공유하면 서로의 카드를 지우려 들기 때문.
|
||||
- 루트의 `_archive/`(옛 Index Page), `logseq/`(옛 그래프 휴지통·백업 잔재), 빈 `pages/ assets/ journals/`는 분리 전 잔재다. 건드리지 않는다.
|
||||
- 저장소 루트에는 그래프 폴더 3개와 `CLAUDE.md`, `.gitignore`, `.claude/`만 둔다 (분리 전 잔재는 2026-08-06 정리 — 옛 Index Page·설정 등은 태그 `before-graph-split`에서 복원 가능).
|
||||
- ## 작업 흐름 (중요)
|
||||
id:: 6a5cd2bb-6915-4aec-bfb8-88d45154e0ef
|
||||
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
- [[🔤 영어공부]]
|
||||
- [[👩🏻💻코딩 지식_팁 정리]]
|
||||
- [[📚전공공부]]
|
||||
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 81 KiB |
@ -1,168 +0,0 @@
|
||||
deck:: Logseq/전공공부/선형대수학
|
||||
|
||||
- 
|
||||
-
|
||||
- ## 1.1 벡터와 선형결합
|
||||
- **선형대수학**은 벡터 $v$와 행렬 $A$에 관한 학문이다. 출발점은 두 벡터의 **선형결합(linear combination)** $cv + dw$ 이다.
|
||||
- 기본 연산은 단 2가지: **벡터 덧셈** $v+w$, **스칼라 곱** $cv$ → 이 둘을 합친 것이 선형결합 $cv+dw$.
|
||||
- 💡 미분적분학이 "수와 함수 $f(x)$"에서 시작한다면, 선형대수학은 "벡터와 선형결합"에서 시작한다. 이 장의 모든 내용($Ax$, 열공간, 행렬곱, $CR$)이 결국 전부 "선형결합"이라는 한 단어로 꿰어진다.
|
||||
- **두 가지 핵심 질문** — 이 책 전체를 관통하는 질문
|
||||
- ① 모든 선형결합 $cv + dw$ 는 무엇을 채우는가? (직선? 평면? 공간 전체?)
|
||||
- ② 특정 벡터 $b$ 를 만드는 수 $c, d$ 를 찾을 수 있는가? → 연립방정식 $cv + dw = b$ 풀기
|
||||
- 💡 ①은 나중에 "열공간"(1.3절), ②는 "$Ax=b$ 풀기"(2장 예고)로 이름이 바뀌어 계속 등장한다.
|
||||
- **2차원에서의 답** ($\mathbb{R}^2$)
|
||||
- $v, w$ 가 (영벡터가 아니고) 같은 직선 위에 있지 않으면 → **선형독립(linearly independent)**. 선형결합이 $xy$-평면 전체를 채우고, $cv+dw=b$ 의 해가 **정확히 하나** 존재한다. (이때 행렬 $A=[v\ w]$ 의 역행렬이 존재)
|
||||
- $v, w$ 가 원점을 지나는 같은 직선 위에 있으면 → **선형종속(linearly dependent)**. 선형결합은 그 직선만 채우고, $b$ 가 직선 밖이면 해가 없다.
|
||||
- ⚠️ 소거법이 "실패"하는 것은 계산 실수가 아니라 **해가 원래 없기 때문**이다. 미지수 하나를 소거하려다 둘 다 소거되어 $0 = (\text{0이 아닌 수})$ 꼴의 모순이 나오는 경우.
|
||||
- ⚠️ 첫 방정식의 계수가 0이어서 소거를 시작하기 어려워 보이면 → 방정식의 **순서를 바꾸면** 된다 (해가 없는 것이 아님).
|
||||
- **연립방정식을 보는 3가지 관점** (같은 문제, 다른 시각)
|
||||
- 행 방법: $c, d$ 에 대한 두 방정식 (각 행 = 방정식 하나)
|
||||
- 열 방법: 열벡터의 선형결합 $cv + dw = b$
|
||||
- 행렬 방법: $A\begin{bmatrix}c\\d\end{bmatrix} = b$
|
||||
- 💡 이 책은 일관되게 **열 방법(선형결합)의 관점**을 밀고 나간다. 행 방법은 계산용, 열 방법은 이해용.
|
||||
- **3차원** ($\mathbb{R}^3$)
|
||||
- 벡터 2개(선형독립)의 선형결합은 기껏해야 원점을 지나는 **평면**을 채운다. 공간 전체를 채우려면 **선형독립인 벡터 3개**가 필요하다.
|
||||
- ⚠️ 벡터 2개가 $\mathbb{R}^3$를 못 채우는 것은 종속이라서가 아니라 **개수가 부족**해서다. 독립/종속 문제와 개수 문제를 구분할 것.
|
||||
- 가장 간단한 예: 표준단위벡터 $i=(1,0,0),\ j=(0,1,0),\ k=(0,0,1)$ → $ci+dj+ek=(c,d,e)$
|
||||
- **항등행렬(identity matrix)** $I$: 주대각성분이 모두 1, 나머지는 0. 모든 벡터에 대해 $Iv = v$ (숫자 1의 역할).
|
||||
- 차원이 다른 벡터끼리는(2차원 $v$와 3차원 $w$) 선형결합을 만들 수 없다.
|
||||
- 두 독립 벡터의 선형결합 전체가 "평면"이 되는 근거: 그 위 임의의 두 점(두 선형결합)의 중점도 다시 선형결합이므로 같은 표면 위에 있다 → 평면의 기본 성질을 만족. (더 엄밀한 논증은 1.2절의 법선벡터로)
|
||||
- ### ❓ 스스로 점검 (1.1)
|
||||
- $v, w$가 선형독립일 때 $cv+dw=b$의 해가 "존재"할 뿐 아니라 "유일"하기까지 한 이유는?
|
||||
- 선형결합이 평면 전체를 채우므로 해가 존재하고, 만약 두 쌍 $(c,d) \neq (c',d')$이 같은 $b$를 만들면 그 차이가 $v, w$의 자명하지 않은 선형결합으로 영벡터를 만들게 되어 독립이라는 가정에 모순.
|
||||
- 세 벡터 $v, w, z$에서 $z = v + w$라면, 세 벡터의 선형결합이 채우는 영역은 $v, w$ 둘만의 선형결합이 채우는 영역과 비교해 어떻게 되는가?
|
||||
- 똑같다. $z$는 새로운 방향을 제시하지 못하므로 채우는 영역이 넓어지지 않는다 (여전히 같은 평면).
|
||||
- $cv + dw = b$를 소거법으로 풀 때 "해가 없음"은 계산 과정에서 어떤 형태로 나타나는가?
|
||||
- 한 미지수만 소거하려 했는데 두 미지수가 모두 소거되면서 $0 = (\text{0이 아닌 수})$ 라는 모순 방정식이 남는다.
|
||||
-
|
||||
- ## 1.2 내적으로부터의 길이와 각
|
||||
- **내적(dot product)**: $v \cdot w = v_1w_1 + v_2w_2 + \cdots + v_nw_n$ (순서 무관: $v\cdot w = w\cdot v$)
|
||||
- 💡 내적 하나에서 **길이**($v \cdot v$), **수직**($v \cdot w = 0$), **사잇각**(코사인 공식)이 전부 나온다. 이 절의 모든 내용은 내적의 응용이다.
|
||||
- **길이(length)**: $\|v\| = \sqrt{v \cdot v} = \sqrt{v_1^2 + \cdots + v_n^2}$
|
||||
- 피타고라스 정리의 $n$차원 확장. 예: $\|(1,2,3)\|^2 = 1+4+9 = 14$
|
||||
- 💡 차원을 하나씩 올릴 때마다 직각삼각형을 하나씩 더 세우는 그림: $(1,2,3)$의 길이 = 평면 벡터 $(1,2,0)$(길이 $\sqrt5$)과 $z$축 성분 $(0,0,3)$으로 만든 직각삼각형의 빗변.
|
||||
- $n$차원 단위 정육면체의 대각선 길이는 $\sqrt{n}$
|
||||
- **단위벡터(unit vector)**: 길이가 1인 벡터. $v \neq 0$ 이면 $u = \dfrac{v}{\|v\|}$ 는 단위벡터.
|
||||
- $x$축과 각 $\theta$를 이루는 단위벡터: $u = (\cos\theta, \sin\theta)$ (자동으로 길이 1: $\cos^2\theta + \sin^2\theta = 1$)
|
||||
- **수직(perpendicular)**: $v \cdot w = 0 \iff$ 사잇각 $90°$
|
||||
- 이때 $\|v+w\|^2 = \|v\|^2 + \|w\|^2$ (피타고라스). 전개: $\|v+w\|^2 = v\cdot v + 2\,v\cdot w + w\cdot w$ 에서 가운데 항이 0.
|
||||
- **사잇각 공식 (코사인 공식)**: 영벡터가 아닌 $v, w$ 에 대해 $\cos\theta = \dfrac{v \cdot w}{\|v\|\,\|w\|}$
|
||||
- 💡 유도의 흐름: 단위벡터끼리 먼저 증명($u = (\cos\theta, \sin\theta)$, $U = (\cos\beta, \sin\beta)$의 내적 = $\cos(\theta-\beta)$, 삼각법의 코사인 차 공식) → 일반 벡터는 각자 길이로 나눠 단위벡터로 만들면 된다.
|
||||
- **부호만 봐도 각을 안다**: $v \cdot w > 0$ → 예각, $= 0$ → 직각, $< 0$ → 둔각
|
||||
- ⚠️ 사잇각을 논할 때 두 벡터 모두 **영벡터가 아니어야** 한다 (길이로 나누기 때문).
|
||||
- **2대 부등식** ($|\cos\theta| \le 1$ 에서 유도)
|
||||
- **슈바르츠 부등식(Schwarz inequality)**: $|v \cdot w| \le \|v\|\,\|w\|$ — "수학에서 가장 중요한 부등식"
|
||||
- **삼각부등식(triangle inequality)**: $\|v + w\| \le \|v\| + \|w\|$ — 삼각형의 두 변의 합은 나머지 변보다 크거나 같다
|
||||
- 유도 순서: 슈바르츠 → 삼각. $\|v+w\|^2 = \|v\|^2 + 2v\cdot w + \|w\|^2 \le \|v\|^2 + 2\|v\|\|w\| + \|w\|^2 = (\|v\|+\|w\|)^2$
|
||||
- 등호 성립 조건: 한 벡터가 다른 벡터의 상수배일 때 ($w = cv$, 사잇각 $0°$ 또는 $180°$, 삼각형이 납작해지는 경우)
|
||||
- 💡 산술-기하평균 부등식 $\sqrt{xy} \le \frac{1}{2}(x+y)$ 도 슈바르츠 부등식의 특수한 경우로 나온다 ($v=(\sqrt x, \sqrt y)$, $w=(\sqrt y, \sqrt x)$).
|
||||
- **코사인 법칙**: $\|v-w\|^2 = \|v\|^2 - 2\|v\|\|w\|\cos\theta + \|w\|^2$ ($(v-w)\cdot(v-w)$ 전개로 유도)
|
||||
- **응용**
|
||||
- 시소의 균형: 가중치 벡터 $w$와 거리 벡터 $v$의 내적 $= 0$ 이면 균형.
|
||||
- 경제: (비용) $=$ (수량 벡터 $q$) $\cdot$ (가격 벡터 $p$). 내적이 0이면 수입과 지출의 일치 ("장부의 균형").
|
||||
- 기울기: 원점에서 $v$, $w$로 가는 화살표의 기울기의 곱이 $-1$이면 $v \cdot w = 0$ (수직인 직선의 기울기 조건과 일치).
|
||||
- **3차원 공간 안의 평면**: 법선벡터 $n$과 수직인 모든 벡터 $w$의 집합. 방정식 $n_1w_1 + n_2w_2 + n_3w_3 = 0$
|
||||
- 예: $xy$-평면의 법선벡터는 $n = (0,0,1)$ → 방정식은 $w_3 = 0$
|
||||
- ### ❓ 스스로 점검 (1.2)
|
||||
- $\|v\| = 5$, $\|w\| = 3$일 때 $v \cdot w$가 가질 수 있는 값의 범위는? $\|v - w\|$의 범위는?
|
||||
- 슈바르츠 부등식에서 $-15 \le v \cdot w \le 15$. $\|v-w\|$는 두 벡터가 같은 방향일 때 최소 $2$, 반대 방향일 때 최대 $8$ (삼각부등식).
|
||||
- $\|v+w\|^2 = \|v\|^2 + \|w\|^2$ 이 성립한다는 것은 두 벡터에 대해 무엇을 말해주는가? 역도 성립하는가?
|
||||
- $2v\cdot w = 0$, 즉 수직이라는 뜻. 전개식에서 곧바로 나오므로 역방향도 성립 (동치).
|
||||
- 슈바르츠 부등식과 삼각부등식 중 어느 것이 어느 것으로부터 유도되는가?
|
||||
- 삼각부등식이 슈바르츠 부등식으로부터 유도된다 ($\|v+w\|^2$ 전개에서 $v\cdot w$를 $\|v\|\|w\|$로 키움).
|
||||
- 벡터 $(1,1,1)$과 수직인 벡터들은 $\mathbb{R}^3$에서 무엇을 이루는가?
|
||||
- $w_1+w_2+w_3=0$을 만족하는, 원점을 지나는 **평면** ($(1,1,1)$이 법선벡터).
|
||||
-
|
||||
- ## 1.3 행렬과 열공간
|
||||
- **행렬(matrix)**: $m$개의 행과 $n$개의 열로 이루어진 직사각형 수 배열 ($m \times n$ 행렬). $m = n$이면 **정사각행렬**.
|
||||
- 특수한 행렬 4형제: **항등행렬**(대각선 1), **대각행렬**(대각선 밖 0), **삼각행렬**(대각선 아래쪽 또는 위쪽이 0), **대칭행렬**(행과 열을 바꿔도 같음)
|
||||
- $Ax$ **를 계산하는 2가지 방법**
|
||||
- **행 방법**: $Ax$의 각 성분 $=$ ($A$의 각 행) $\cdot x$ 의 내적 → 숫자가 주어졌을 때 계산에 유리
|
||||
- **열 방법**: $Ax = x_1a_1 + x_2a_2 + \cdots + x_na_n$ → $Ax$ 는 $A$ 의 **열들의 선형결합**
|
||||
- 💡 이 문장이 이 장에서 가장 중요한 한 줄이다. 행 방법은 성분(수) 하나씩, 열 방법은 벡터 단위로 본다. "$Ax$의 의미를 이해하고 싶으면 열 방법".
|
||||
- **열공간(column space)** $C(A)$: 모든 벡터 $Ax$의 집합 = $A$의 열들의 모든 선형결합의 집합.
|
||||
- "**생성(span)**" = 벡터 집합의 모든 선형결합. 열들의 생성이 곧 열공간.
|
||||
- 💡 $Ax = b$ 를 풀 수 있다 $\iff$ $b \in C(A)$. 1.1절의 질문 ②가 "b가 열공간 안에 있는가?"로 번역된 것.
|
||||
- **선형독립의 정의 (행렬 버전)**: $Ax = 0$ 의 유일한 해가 $x = 0$ 일 때, $A$의 열들은 선형독립이다.
|
||||
- 판정은 보통 왼쪽 열부터 오른쪽으로: 각 열이 **이전 열들의 선형결합이 아니면** (새로운 방향을 제시하면) 독립인 열로 센다.
|
||||
- ⚠️ 오른쪽에서 왼쪽으로 판정해도 **독립인 열의 개수는 같다** (어느 열이 뽑히는지는 달라질 수 있음).
|
||||
- $m = 3$ **일 때 열공간으로 가능한 4가지** (독립인 열 개수 기준)
|
||||
- 3개 → $\mathbb{R}^3$ 전체 공간
|
||||
- 2개 → 원점을 지나는 평면
|
||||
- 1개 → 원점을 지나는 직선
|
||||
- 0개 (영행렬) → 점 $(0,0,0)$
|
||||
- ⚠️ 어느 경우든 열공간은 반드시 **원점을 포함**한다 ($x=0$이면 $Ax=0$).
|
||||
- **랭크(rank)** $r$: $A$의 선형독립인 열의 개수. 처음 $r$개의 독립인 열들 = 열공간의 **기저(basis)**. (기저·차원의 엄밀한 정의는 3장 예고)
|
||||
- **랭크 1 행렬**: 모든 열이 같은 직선 위(한 열의 상수배). 이때 놀랍게도 모든 **행**도 같은 직선 위에 있다.
|
||||
- 2×2로 확인: 2열이 1열의 $m$배인 $A = \begin{bmatrix} a & ma \\ b & mb \end{bmatrix}$ 이면 2행 $[b\ \ mb]$ 는 1행 $[a\ \ ma]$의 $\frac{b}{a}$배 ($a=0$인 경우는 따로 확인).
|
||||
- 💡 이것이 **(열 랭크) = (행 랭크)** 의 첫 사례. 이 등식은 모든 행렬에서 성립하며 "선형대수학의 첫 번째 위대한 정리". 일반적인 증명은 1.4절의 $A=CR$이 해준다.
|
||||
- ### ❓ 스스로 점검 (1.3)
|
||||
- $Ax$를 "행의 관점"과 "열의 관점"으로 각각 한 문장으로 말하면?
|
||||
- 행: $Ax$의 각 성분은 $A$의 각 행과 $x$의 내적. 열: $Ax$는 $A$의 열들을 $x$의 성분으로 가중한 선형결합.
|
||||
- 3×3 행렬의 열공간이 "원점을 지나는 직선"이 되려면 열들이 어떤 상태여야 하는가?
|
||||
- 영벡터가 아닌 열이 존재하되, 모든 열이 그 한 열의 상수배 (선형독립인 열이 1개, 랭크 1).
|
||||
- $b$가 $C(A)$ 밖에 있으면 $Ax = b$는 어떻게 되는가?
|
||||
- 해가 존재하지 않는다. $Ax$는 항상 열들의 선형결합이므로 열공간을 벗어날 수 없다.
|
||||
- 어떤 행렬의 모든 열이 선형종속 쌍(모든 열의 쌍이 같은 직선 위)이라면 열공간은?
|
||||
- 원점을 지나는 하나의 직선 (혹은 전부 영벡터면 원점 하나).
|
||||
-
|
||||
- ## 1.4 행렬곱 AB와 CR
|
||||
- **행렬곱의 기본 규칙**
|
||||
- $(m \times n)(n \times p) = (m \times p)$: $A$의 행 길이($n$)와 $B$의 열 길이($n$)가 같아야 곱할 수 있다.
|
||||
- 핵심 정의: $(AB\text{의 } j\text{열}) = A \times (B\text{의 } j\text{열})$, 즉 $AB = [Ab_1\ Ab_2\ \cdots\ Ab_p]$
|
||||
- 총 곱셈 횟수는 어떤 방법이든 $mnp$ 번. (참고: 슈트라센은 2×2 곱을 곱셈 7번으로 줄였고, 지수를 얼마나 낮출 수 있는지는 미해결 문제)
|
||||
- $AB$ **를 계산하는 4가지 방법** (순서만 다르고 결과·곱셈 횟수는 동일)
|
||||
- ① (행)·(열): $(AB)_{ij} = (A$의 $i$행$)\cdot(B$의 $j$열$)$ — 손 계산에 편리
|
||||
- ② (행렬)×(열): $Ab_j$ → $AB$의 열들을 하나씩 생성. $AB$의 각 열은 $A$ 의 **열들의 선형결합**
|
||||
- ③ (행)×(행렬): $A$의 각 행 × $B$ → $AB$의 행들을 생성. $AB$의 각 행은 $B$의 행들의 선형결합
|
||||
- ④ **(열)×(행)**: $AB = a_1b_1^* + a_2b_2^* + \cdots + a_nb_n^*$ — **랭크 1 행렬들의 합**
|
||||
- (열)×(행) 하나하나가 **외적(outer product)** 이며 랭크 1 행렬. (물리의 벡터곱(cross product)과는 다른 것 — 이 책의 외적은 텐서곱)
|
||||
- 💡 내적은 (행)×(열) = 수, 외적은 (열)×(행) = 행렬. 모양이 결과를 결정한다: $(1 \times n)(n \times 1) = 1\times 1$, $(m \times 1)(1 \times p) = m \times p$.
|
||||
- **연산 법칙**
|
||||
- **교환법칙 불성립**: 일반적으로 $AB \neq BA$
|
||||
- 💡 교환행렬 $P$로 확인: $AP$는 $A$의 **열**을 교환(오른쪽 곱), $PA$는 $A$의 **행**을 교환(왼쪽 곱). "행 연산은 왼쪽에서, 열 연산은 오른쪽에서".
|
||||
- **결합법칙 성립**: $(AB)C = A(BC)$ — 조용해 보이지만 매우 중요한 법칙
|
||||
- **분배법칙 성립**: $A(B+C) = AB + AC$
|
||||
- **행렬 분해** $A = CR$ — 이 장의 최종 목표
|
||||
- $A$($m \times n$, 랭크 $r$) $= C$($m \times r$) $\times R$($r \times n$)
|
||||
- $C$ **만들기**: 왼쪽에서 오른쪽으로 이동하며 이전 열들의 선형결합이 아닌 열(= 새로운 방향의 열)만 $A$에서 골라 담는다. → $C$의 $r$개 열은 모두 선형독립 ($Cx=0 \Rightarrow x=0$).
|
||||
- $R$ **의 역할**: $C$의 열들을 어떻게 선형결합하면 $A$의 각 열이 되는지 알려주는 계수 행렬.
|
||||
- $A$의 열이 그대로 $C$에 들어간 위치 → $R$의 그 열은 항등행렬의 열. 그래서 $R$ 안에 $r \times r$ **항등행렬** $I$ 가 들어 있다: $R = [I\ F]$ 꼴 (열 위치는 섞일 수 있음), $A = [C\ CF]$
|
||||
- ⚠️ $C$는 $A$의 열을 그대로 가져오지만, $R$은 $A$의 행을 그대로 가져온 것이 **아니다** (계수 행렬임).
|
||||
- $R$ **찾는 방법 = 소거법(행 연산)**: $A \to$ (아래쪽 소거) 상삼각 $U \to$ (위쪽까지 소거) $R_0 = \text{rref}(A)$ (**기약행사다리꼴**). $R_0$의 영벡터 행 $(m-r)$개를 제거하면 $R$. (소거법 본격 전개는 2~3장 예고)
|
||||
- 특수한 경우: $A$의 모든 열이 선형독립이면 $C = A$, $R = I$. 랭크 1이면 $C$는 열 하나, $R$은 행 하나.
|
||||
- $A = CR$ **의 주요 사실**
|
||||
- $C$의 $r$개 열 = $A$의 **열공간의 기저** → 열공간은 $r$차원
|
||||
- $R$의 $r$개 행 = $A$의 **행공간(row space)의 기저** → 행공간도 $r$차원
|
||||
- **(행 랭크) = (열 랭크) 증명 스케치** (4단계)
|
||||
- ① $C$의 $r$개 열은 선형독립 (독립인 것만 골랐으므로)
|
||||
- ② $A$의 모든 열은 $C$의 열들의 선형결합 ($A = CR$)
|
||||
- ③ $R$의 $r$개 행은 선형독립 ($R$ 안에 $I$가 있으므로)
|
||||
- ④ $A$의 모든 행은 $R$의 행들의 선형결합 ($A = CR$을 행 관점으로 읽기)
|
||||
- 💡 같은 식 $A=CR$을 열 관점으로 읽으면 열공간 정보($C$), 행 관점으로 읽으면 행공간 정보($R$)가 나온다는 것이 이 증명의 묘미.
|
||||
- ### ❓ 스스로 점검 (1.4)
|
||||
- $AB$의 $j$열을 하나의 곱으로 표현하면? $AB$의 각 열은 누구의 선형결합인가?
|
||||
- $(AB)_j = A b_j$. 따라서 $AB$의 모든 열은 $A$의 열들의 선형결합이고, $C(AB)$는 $C(A)$에 포함된다.
|
||||
- (열)×(행) 방법으로 $AB$를 계산하면 무엇을 몇 개 더하게 되는가?
|
||||
- 랭크 1 행렬($A$의 $k$열 × $B$의 $k$행)을 $n$개 더한다.
|
||||
- $A = CR$에서 $R$ 안에 항등행렬이 반드시 나타나는 이유는?
|
||||
- $C$에 들어간 $A$의 열 자신을 표현할 때는 "그 열 1배 + 나머지 0배"이므로, 해당 위치의 $R$ 열이 항등행렬의 열이 된다.
|
||||
- 3×3 행렬 $A$, $B$의 랭크가 모두 3이 아니어도 $AB$의 랭크가 3이 될 수 있는가? (이 절의 관점에서)
|
||||
- 없다. $AB$의 열은 모두 $A$의 열들의 선형결합이므로 $AB$의 독립인 열 개수는 $A$의 랭크를 넘을 수 없다.
|
||||
- $P = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$를 $A$의 왼쪽에 곱할 때와 오른쪽에 곱할 때 각각 무슨 일이 일어나는가?
|
||||
- 왼쪽($PA$): 행 교환. 오른쪽($AP$): 열 교환.
|
||||
-
|
||||
- ## 1장에 대한 고찰
|
||||
- 선형대수학이 쉬운 이유: 모든 방정식이 **선형**. 어려운 이유: 방정식·미지수·아이디어가 많음. → 해법은 **행렬로 한번에 처리** ($Ax = b$는 크기에 상관없는 완벽한 형식).
|
||||
- 선형성의 규칙: $A(x + y) = Ax + Ay$ — 결합법칙 $(AB)C = A(BC)$도 결국 이 선형성으로 증명된다.
|
||||
- $m \times n$ **랜덤행렬**의 $Ax = b$ 에 대한 기대 (반드시 성립하는 것은 아님)
|
||||
- $m < n$ (방정식 < 미지수): 아마도 해가 많이 존재
|
||||
- $m = n$: 아마도 해가 하나 존재
|
||||
- $m > n$ (방정식 > 미지수): 아마도 해가 존재하지 않음
|
||||
- ⚠️ "아마도"인 이유: 어떤 방정식(행)이 이전 방정식들의 선형결합이면 새로운 정보가 아니기 때문. → 랭크 $r$ 이 **문제의 실제 크기**를 알려준다.
|
||||
- $Ax$, $AB$, $CR$ 모두 "**열들의 선형결합**" 관점으로 설명하는 것이 이 책의 일관된 방식이다 (행들의 내적이 아니라).
|
||||
- ### ❓ 1장 전체 총정리 질문
|
||||
- 1장의 내용을 "선형결합" 한 단어로 꿰어서 요약하면?
|
||||
- 벡터들의 선형결합(1.1) → 내적으로 그 기하(길이·각)를 잰다(1.2) → $Ax$ = 열들의 선형결합, 그 전체가 열공간(1.3) → $AB$의 열도 선형결합, $A=CR$은 "독립인 열($C$) + 결합 계수($R$)"로의 분해(1.4).
|
||||
- $A = CR$ 분해가 알려주는 정보 세 가지는?
|
||||
- $A$의 랭크 $r$, 열공간의 기저($C$의 열), 행공간의 기저($R$의 행) — 그리고 그 결과로 (행 랭크)=(열 랭크).
|
||||
@ -1,3 +0,0 @@
|
||||
deck:: Logseq/전공공부/선형대수학
|
||||
|
||||
- 
|
||||
@ -1,26 +0,0 @@
|
||||
- Swift Arrow
|
||||
- 너는 누구지? :->code::hello
|
||||
id:: 683d7d8c-f684-4309-9eb7-d297f58c2cb5
|
||||
- close:->hello
|
||||
id:: 683d8268-ca86-4567-9619-7146b82d501c
|
||||
- hello
|
||||
collapsed:: true
|
||||
- ceuak
|
||||
- hello:->ceuak
|
||||
id:: 683d81b8-6ce7-4576-9713-7e7db5b6fdc5
|
||||
- ceuak!
|
||||
collapsed:: true
|
||||
- ceuak :<- dongsang
|
||||
id:: 683d81be-fdc8-44d0-8110-d055e684370d
|
||||
-
|
||||
- card tag
|
||||
- ceuak #card
|
||||
id:: 683d82e5-9e7b-42f2-a227-f56429ab93f8
|
||||
- ceuak1 #card
|
||||
- dongsang
|
||||
- ceauk2
|
||||
- ceuak3
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
@ -1,4 +0,0 @@
|
||||
- 영어공부
|
||||
- [[기초영어강의(성정혜)]]
|
||||
-
|
||||
- oo공부
|
||||
@ -1 +0,0 @@
|
||||
-
|
||||
@ -1 +0,0 @@
|
||||
-
|
||||
@ -1,2 +0,0 @@
|
||||
-
|
||||
-
|
||||
@ -1,2 +0,0 @@
|
||||
- [[기초영어강의 1강]]
|
||||
-
|
||||
@ -1,4 +0,0 @@
|
||||
deck:: Logseq/coding tip
|
||||
|
||||
- [[분리집합(Disjoint Set) (Union Find)]]
|
||||
-
|
||||
@ -1,3 +0,0 @@
|
||||
deck:: Logseq/coding tip
|
||||
|
||||
-
|
||||
@ -1 +0,0 @@
|
||||
-
|
||||
@ -1,283 +0,0 @@
|
||||
deck:: Logseq/coding tip
|
||||
|
||||
- ## **❖ Javascript / Typescript**
|
||||
- ### **► 이차원 배열(n*m) 생성**
|
||||
- id:: 6867f897-928a-4f22-8184-491fa70314db
|
||||
1. Array.from() 사용법
|
||||
- ```javascript
|
||||
const arr = Array.from({length : n}, () => new Array(m).fill(0));
|
||||
```
|
||||
- id:: 6867f8fc-3249-4ced-91aa-a2c951c11b0b
|
||||
2. Array().fill() 사용법
|
||||
- ```javascript
|
||||
const arr = new Array(n).fill().map(() => new Array(m).fill(0));
|
||||
```
|
||||
- id:: 6867f8fe-39c6-438b-a045-4f8687ad0b1d
|
||||
3. 반복문 순회
|
||||
- ```javascript
|
||||
let arr = [];
|
||||
for(int i=0; i<n; i++){
|
||||
arr[i] = [];
|
||||
for(int j=0; j<m; j++){
|
||||
arr[i][j] = 0;
|
||||
}
|
||||
}
|
||||
```
|
||||
- ### **► 배열 매서드**
|
||||
- ### **◼︎ Array.every((element, index, array) => {조건식})**
|
||||
id:: 686922a8-1c72-4261-8339-aff6ece36f03
|
||||
- **배열의 모든 요소가 조건식을 만족하는지 확인해서 true/false를 반환하는 매서드**
|
||||
- **elememt : 현재 요소, index : 현재 인덱스(생략가능), array : 원본 배열(생략 가능)**
|
||||
- **배열의 모든 요소가 특정 값인지 혹은 특정 범위에 있는지 확인하는 용도로 사용가능**
|
||||
- ```javascript
|
||||
const arr = [1,2,3,4,5,6,7,8,9,10];
|
||||
|
||||
arr.every((v,i) => v===i+1); // true
|
||||
arr.every((v,i,array) => {
|
||||
if(i<[array.length-1]){
|
||||
return array[i] < array[i+1];
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}); // true
|
||||
arr.every(v => v===arr[0]); // false
|
||||
```
|
||||
- ### **◼︎ Array.slice(start_idx, end_idx)**
|
||||
id:: 68692600-551c-488b-ad74-de8145729133
|
||||
- **배열에서 특정 범위의 인덱스 부분만 잘라내서 그 배열을 반환하는 매서드**
|
||||
- **end_idx는 생략 가능하다**
|
||||
- 이 경우에는 start_idx 부터 끝까지 반환한다.
|
||||
- **배열의 start_idx 인덱스 부터 end_idx - 1 인덱스까지의 배열을 잘라내서 반환홤**
|
||||
- 예를 들면 arr.slice(2,7) 은 arr의 인덱스2 부터 인덱스 6까지의 배열을 반환함.
|
||||
- **범위를 초과해도 에러를 내지 않음. 그저 빈 배열을 반환할 뿐임.**
|
||||
- **아무리 호출해도 원본 배열 자체를 바꾸지는 않는다.**
|
||||
- ```javascript
|
||||
const arr = [0,1,2,3,4,5,6,7,8,9,10];
|
||||
|
||||
const arr1 = arr.slice(2); // [2,3,4,5,6,7,8,9,10]
|
||||
const arr2 = arr.slice(5,10); // [5,6,7,8,9]
|
||||
const arr3 = arr.slice(12); // []
|
||||
```
|
||||
- ### **◼︎ Array.forEach((element, index, array) => {})**
|
||||
id:: 6869280c-f685-44c4-b73e-a33f351be582
|
||||
- **배열의 모든 요소를 순서대로 순회하면서 코드를 실행하는 매서드**
|
||||
- **element(현재 요소)는 반드시 필요하고, index(현재 인덱스)와 array(원본 배열)는 생략 가능하다.**
|
||||
- **모든 배열을 순회하는 반복문과 비슷하게 사용이 가능하다**
|
||||
- 단 반복문에서 쓰이는 continue나 break는 사용할 수 없다.
|
||||
- return을 continue 처럼 사용할 수 있고, break는 사용할 수 없다.
|
||||
- 즉 break가 꼭 필요하다면 반복문으로 구현한다.
|
||||
- ```javascript
|
||||
const arr = [1,2,3,4,5];
|
||||
arr.forEach(v => {
|
||||
if(v===3) return;
|
||||
console.log(v);
|
||||
});
|
||||
// 1 2 4 5
|
||||
```
|
||||
- ### **◼︎ Array.reduce((acc, element, index) => {콜백함수}, initial value)**
|
||||
id:: 6869298b-18fd-4524-a697-c1af9e510c34
|
||||
- **배열의 각 요소별로 순회하며 누적자(acc)를 계산하고 모든 순회를 마친 뒤의 누적자를 반환하는 매서드**
|
||||
- **초기값을 입력하지 않으면 기본적으로 acc는 0으로 초기화 된 채 실행된다.**
|
||||
- **코드가 한줄이면 굳이 return으로 반환을 할 필요는 없으나 계산코드가 2줄 이상이면 누적값을 직접 return 해주어야 한다.**
|
||||
- ```javascript
|
||||
const arr = [1,2,3,4,5];
|
||||
const sum = arr.reduce((acc,v) => acc + v, 0); // 15
|
||||
const sum_odd = arr.reduce((acc,v) => {
|
||||
if(v%2===0) return acc;
|
||||
else return acc+v;
|
||||
},0); //9
|
||||
```
|
||||
- ### **◼︎ Array.sort((a,b)=>{콜백함수})**
|
||||
id:: 686a6dfd-328e-4dd0-bd8a-abbef2ae13ee
|
||||
- **배열을 정렬하는 매서드이고 기본적으로 파라미터를 입력하지 않으면 오름차순으로 정렬한다.**
|
||||
- **반환값은 없고 원본 배열 자체를 변경한다.**
|
||||
- **이 정렬 알고리즘은 배열의 데이터를 무조건 문자형으로 보고 정렬(사전순)하기 때문에 숫자를 정렬할 때는 이상하게 정렬이 될 수도 있다.**
|
||||
- [10,2,5,9,8,7] 을 오름차순 정렬하면 [2,5,7,8,9,10] 이 되어야 하지만 이걸 문자로 보고 정렬하기 때문에 실제로는 [10,2,5,7,8,9] 로 정렬된다.
|
||||
- **숫자에 대해서 제대로 정렬하기 위해서는 콜백함수를 넣어줘야 한다.**
|
||||
- a와 b는 각각 인덱스 기준으로 보면 a가 b보다 앞선 인덱스에 있는 두 요소들을 의미한다.
|
||||
- 이 두 요소 사이의 인덱스 간격은 신경쓰지 않는다. 그저 a가 앞에 있다는 것만 기억하자.
|
||||
- 이때 이 a와 b의 관계식을 통해 콜백함수의 반환값을 설정해서 이 관계식이 모든 정렬이 끝난 뒤에 이 반환값이 모두 false가 되면 정렬이 완료된 것으로 취급한다.
|
||||
- **예시**
|
||||
- ```javascript
|
||||
const arr = [5,9,7,4,3,2,8];
|
||||
arr.sort((a,b)=>a-b); //[2,3,4,5,7,8,9] 오름차순
|
||||
// 이전 인덱스 요소와 다음 인덱스 요소의 차이가 모두 양수가 아니게 되도록 정렬한다
|
||||
arr.sort((a-b)=>b-a); //[9,8,7,5,4,3,2] 내림차순
|
||||
// 이전 인덱스 요소와 다음 인덱스 요소의 차이가 모두 음수가 아니게 되도록 정렬한다
|
||||
```
|
||||
- ### **► Object 자료형**
|
||||
- ### **◼︎ 정의 및 선언 및 접근방법**
|
||||
id:: 6874a753-d361-4df8-8dd5-15bb865ac8df
|
||||
- 키(key)와 값(value)을 가지는 데이터의 집합
|
||||
- 자체적으로는 iterable하지 않음(반복가능한 자료형이 아님)
|
||||
- 따라서 for문에서 순회할 때 for ... in Object.keys(), Object.values(), Object.entries() 와 같은 방법으로 순회해야함
|
||||
- 키는 무조건 문자열과 심볼만 가능함.
|
||||
- 키의 삽입 순서가 보장되지 않음.
|
||||
- ```javascript
|
||||
// 빈데이터 초기화 방법
|
||||
let obj = {};
|
||||
|
||||
// 직접 선언 방법
|
||||
let obj = {
|
||||
"name": "Yechan",
|
||||
"age" : 30
|
||||
};
|
||||
|
||||
// 출력
|
||||
console.log(obj.name);
|
||||
console.log(obj["age"]);
|
||||
// Yechan
|
||||
// 30
|
||||
// 두 방법 모두 사용 가능
|
||||
```
|
||||
- ### **◼︎ 키 및 값 순회**
|
||||
- **for ... in**
|
||||
id:: 6874a966-4831-47ed-b969-a7d6d6269a9b
|
||||
- 기본적으로 Object의 키값을 순회함.
|
||||
- ```javascript
|
||||
let obj = {
|
||||
"name": "Yechan",
|
||||
"age" : 30
|
||||
};
|
||||
|
||||
for(let key in obj){
|
||||
console.log(obj[key]);
|
||||
}
|
||||
```
|
||||
- **for ... of**
|
||||
id:: 6874a9fd-e3da-475b-95d8-06889eb8ce56
|
||||
- 각 객체의 매서드를 통해 키, 값, 혹은 둘 다를 직접 가져와서 순회해야함.
|
||||
- ```javascript
|
||||
let obj = {
|
||||
"name": "Yechan",
|
||||
"age" : 30
|
||||
};
|
||||
|
||||
for key of Object.keys(obj) {
|
||||
console.log(key, obj[key]);
|
||||
}
|
||||
// name Yechan
|
||||
// age 30
|
||||
|
||||
// key, value 순회
|
||||
for [key, value] of Object.entries(obj) {
|
||||
console.log(key, value);
|
||||
}
|
||||
// name Yechan
|
||||
// age 30
|
||||
```
|
||||
- ### **► 반복가능 객체에서의 순회**
|
||||
- ### **◼︎ 일반적인 방법(for문)**
|
||||
id:: 6874a69f-d252-4666-813b-17e1e2b50101
|
||||
- for문에서 of로 하나씩 순회함
|
||||
- ```javascript
|
||||
const num = [1,2,3,4,5];
|
||||
for(let n of num) {
|
||||
console.log(n);
|
||||
}
|
||||
// 1 2 3 4 5
|
||||
```
|
||||
- ## **❖ Python**
|
||||
- ### **► 이차원 배열(n*m) 생성**
|
||||
id:: 6867f994-13d0-4937-90e9-d8aec7be5d67
|
||||
- ```python
|
||||
arr = [[0]*m for _ in range(n)]
|
||||
```
|
||||
- ### **► 배열 관련 매서드**
|
||||
- ### **◼︎ arr.count(value)**
|
||||
id:: 686a721d-df2e-4662-a6dd-c235cce8c5ac
|
||||
- 리스트, 혹은 문자열에서 특정 값의 개수를 반환하는 매서드
|
||||
- ```python
|
||||
string = "aaabbcccc"
|
||||
print(string.count('a')) # 3
|
||||
print(string.count('b')) # 2
|
||||
print(string.count('c')) # 4
|
||||
|
||||
arr = [1,2,2,3,3,3,4,4,4,4]
|
||||
print(arr.count(1)) # 1
|
||||
print(arr.count(2)) # 2
|
||||
print(arr.count(3)) # 3
|
||||
print(arr.count(4)) # 4
|
||||
```
|
||||
- ### **◼︎ arr.sort()**
|
||||
id:: 686a726b-38e3-4adc-836a-2d0856046e73
|
||||
- 원본 배열 자체를 정렬하는 매서드.
|
||||
- 기본값은 오름차순이고 파라미터에 reverse=True 를 하면 내림차순으로 정렬됨.
|
||||
- 문자열에도 정렬이 가능함.
|
||||
- 단 문자열이 문자들로 이뤄진 리스트로 바뀌게 됨으로 다시 문자열로 바꾸기 위해서는 join을 이용해서 합쳐줘야함.
|
||||
- ```python
|
||||
arr = [5,8,2,4,9]
|
||||
arr.sort() # 2 4 5 8 9
|
||||
arr.sort(reverse=True) # 9 8 5 4 2
|
||||
```
|
||||
- ### **◼︎ sorted(arr)**
|
||||
id:: 686a732c-734e-417c-b7e2-f3bfb8caa71b
|
||||
- 변수로 들어온 배열을 정렬한 뒤 그 결과를 반환하는 매서드, 즉 반환값이 배열임.
|
||||
- 기본값은 오름차순이고 파라미터에 reverse=True 를 하면 내림차순으로 정렬됨.
|
||||
id:: 686a734e-b423-486f-8ec7-e5491e310fe0
|
||||
- ```python
|
||||
arr = [5,8,2,4,9]
|
||||
arr1 = sorted(arr)
|
||||
arr2 = sorted(arr, reverse=True)
|
||||
print(arr1) :-> # 2 4 5 8 9
|
||||
print(arr2) # 9 8 5 4 2
|
||||
```
|
||||
- ## **❖ C**
|
||||
- ## **❖ Java**
|
||||
- ## **❖ 프로그래밍 관련 이론 정리**
|
||||
- ### **► 알고리즘**
|
||||
- ### **◼︎ 진수변환 알고리즘**
|
||||
- ◉ **B진수 숫자 N을 10진수로 바꾸기(누적곱)**
|
||||
id:: 687250f4-c492-4481-90b4-2894f302b02d
|
||||
- 최종 변환 결과 result 를 0으로 초기화
|
||||
- B진수 숫자 N의 가장 왼쪽자리부터 한자리씩 순회하면서 진행
|
||||
- 순회하며 읽은 값을 10진수로 바꿈(10 이상의 수는 A=10, B=11 등등), 이 값을 val로 지정
|
||||
- result = result*B + val
|
||||
- 모든 자리수에 대해 수행하고 나면 최종적으로 result에 10진수로 변환된 숫자가 나옴.
|
||||
- ◉ **10진수 숫자 N을 B진수로 바꾸기(나머지 계산법)**
|
||||
id:: 6872521b-6fe5-4b65-a929-38c176052368
|
||||
- 최종 변환 결과 result 를 배열로서 초기화
|
||||
- N이 0이 될 때까지 반복문을 돌림
|
||||
- val = N%B
|
||||
- 이때 계산된 val값을 B진수에 맞게 변환에서 result 배열에 삽입.
|
||||
- 앞에서부터 순서대로 넣는다.
|
||||
- N = N//B
|
||||
- result 배열을 맨 마지막 인덱스부터 역순으로 읽으면 그것이 최종 변환 결과.
|
||||
- ### **◼︎ 유클리드 호제법(최소공배수, 최대공약수 구하기)**
|
||||
- ◉ **최대공약수(GCD) 구하기**
|
||||
id:: 687253f3-7eb2-421e-b8c0-d9b96d4d7323
|
||||
- 입력한 두 수의 최대공약수를 구하는 함수 GCD에서 아래의 두 공식이 성립한다.
|
||||
- GCD(a, b) = GCD(b, a % b)
|
||||
- GCD(a, 0) = a
|
||||
- 위의 공식을 바탕으로 다음의 과정을 통해 최대공약수를 구한다.(a>=b)
|
||||
- 1. r = a%b
|
||||
- 2. a-b, b=r 로 값 갱신
|
||||
- 3. b = 0이면, a가 최대공약수
|
||||
- 4. b != 0이면 다시 1번부터 실행
|
||||
- 유클리드 호제법 gcd 예시코드
|
||||
id:: 687255f3-27a7-4bef-a684-60daab2fa33f
|
||||
- 재귀방식
|
||||
- ```python
|
||||
def gcd(a,b):
|
||||
return a if b==0 else gcd(b, a%b)
|
||||
```
|
||||
- 반복문 방식
|
||||
- ```python
|
||||
def gcd(a,b):
|
||||
while b:
|
||||
a, b = b, a%b
|
||||
return a
|
||||
```
|
||||
- ◉ **최소공배수(LCM) 구하기**
|
||||
id:: 687256b1-be35-4052-a12e-133e2c3b2f50
|
||||
- 두 수 a,b와 그 수의 최대공약수(GCD)를 알면 a,b의 최소공배수(LCM)는 다음과 같다.
|
||||
- LCM = (a * b) / GCD
|
||||
- ### **► 사소한 테크닉**
|
||||
- ### **◼︎ 소수점 올림 연산(ceil)**
|
||||
id:: 68725357-aae4-4805-9550-21927cf3731a
|
||||
- 대부분의 언어에는 ceil이라는 올림연산 메서드를 지원하지만 사용할 수 없는 환경일 경우에는 다음과 같이 계산한다.
|
||||
- ```python
|
||||
ceil(x/y) = (x+y-1)//y
|
||||
```
|
||||
-
|
||||
@ -1 +0,0 @@
|
||||
-
|
||||
@ -1,31 +0,0 @@
|
||||
## **❖ 프로그래밍 관련 이론 정리**
|
||||
- ### **► 알고리즘**
|
||||
- ### **◼︎ 유클리드 호제법(최소공배수, 최대공약수 구하기)**
|
||||
- ◉ **최대공약수(GCD) 구하기**
|
||||
id:: 687253f3-7eb2-421e-b8c0-d9b96d4d7323
|
||||
- 입력한 두 수의 최대공약수를 구하는 함수 GCD에서 아래의 두 공식이 성립한다.
|
||||
- GCD(a, b) = GCD(b, a % b)
|
||||
- GCD(a, 0) = a
|
||||
- 위의 공식을 바탕으로 다음의 과정을 통해 최대공약수를 구한다.(a>=b)
|
||||
- 1. r = a%b
|
||||
- 2. a-b, b=r 로 값 갱신
|
||||
- 3. b = 0이면, a가 최대공약수
|
||||
- 4. b != 0이면 다시 1번부터 실행
|
||||
- 유클리드 호제법 gcd 예시코드
|
||||
id:: 687255f3-27a7-4bef-a684-60daab2fa33f
|
||||
- 재귀방식
|
||||
- ```python
|
||||
def gcd(a,b):
|
||||
return a if b==0 else gcd(b, a%b)
|
||||
```
|
||||
- 반복문 방식
|
||||
- ```python
|
||||
def gcd(a,b):
|
||||
while b:
|
||||
a, b = b, a%b
|
||||
return a
|
||||
```
|
||||
- ◉ **최소공배수(LCM) 구하기**
|
||||
id:: 687256b1-be35-4052-a12e-133e2c3b2f50
|
||||
- 두 수 a,b와 그 수의 최대공약수(GCD)를 알면 a,b의 최소공배수(LCM)는 다음과 같다.
|
||||
- LCM = (a * b) / GCD
|
||||
@ -1,443 +0,0 @@
|
||||
{:meta/version 1
|
||||
|
||||
;; Set the preferred format.
|
||||
;; Available options:
|
||||
;; - Markdown (default)
|
||||
;; - Org
|
||||
;; :preferred-format "Markdown"
|
||||
|
||||
;; Set the preferred workflow style.
|
||||
;; Available options:
|
||||
;; - :now for NOW/LATER style (default)
|
||||
;; - :todo for TODO/DOING style
|
||||
:preferred-workflow :now
|
||||
|
||||
;; Exclude directories/files.
|
||||
;; Example usage:
|
||||
;; :hidden ["/archived" "/test.md" "../assets/archived"]
|
||||
:hidden ["/claude.md"]
|
||||
|
||||
;; Define the default journal page template.
|
||||
;; Enter the template name between the quotes.
|
||||
:default-templates
|
||||
{:journals ""}
|
||||
|
||||
;; Set a custom date format for the journal page title.
|
||||
;; Default value: "MMM do, yyyy"
|
||||
;; e.g., "Jan 19th, 2038"
|
||||
;; Example usage e.g., "Tue 19th, Jan 2038"
|
||||
;; :journal/page-title-format "EEE do, MMM yyyy"
|
||||
|
||||
;; Specify the journal filename format using a valid date format string.
|
||||
;; !Warning:
|
||||
;; This configuration is not retroactive and affects only new journals.
|
||||
;; To show old journal files in the app, manually rename the files in the
|
||||
;; journal directory to match the new format.
|
||||
;; Default value: "yyyy_MM_dd"
|
||||
;; :journal/file-name-format "yyyy_MM_dd"
|
||||
|
||||
;; Enable tooltip preview on hover.
|
||||
;; Default value: true
|
||||
:ui/enable-tooltip? true
|
||||
|
||||
;; Display brackets [[]] around page references.
|
||||
;; Default value: true
|
||||
;; :ui/show-brackets? true
|
||||
|
||||
;; Display all lines of a block when referencing ((block)).
|
||||
;; Default value: false
|
||||
:ui/show-full-blocks? false
|
||||
|
||||
;; Automatically expand block references when zooming in.
|
||||
;; Default value: true
|
||||
:ui/auto-expand-block-refs? true
|
||||
|
||||
;; Enable Block timestamps.
|
||||
;; Default value: false
|
||||
:feature/enable-block-timestamps? false
|
||||
|
||||
;; Disable accent marks when searching.
|
||||
;; After changing this setting, rebuild the search index by pressing (^C ^S).
|
||||
;; Default value: true
|
||||
:feature/enable-search-remove-accents? true
|
||||
|
||||
;; Enable journals.
|
||||
;; Default value: true
|
||||
;; :feature/enable-journals? true
|
||||
|
||||
;; Enable flashcards.
|
||||
;; Default value: true
|
||||
;; :feature/enable-flashcards? true
|
||||
|
||||
;; Enable whiteboards.
|
||||
;; Default value: true
|
||||
;; :feature/enable-whiteboards? true
|
||||
|
||||
;; Disable the journal's built-in 'Scheduled tasks and deadlines' query.
|
||||
;; Default value: false
|
||||
;; :feature/disable-scheduled-and-deadline-query? false
|
||||
|
||||
;; Specify the number of days displayed in the future for
|
||||
;; the 'scheduled tasks and deadlines' query.
|
||||
;; Example usage:
|
||||
;; Display all scheduled and deadline blocks for the next 14 days:
|
||||
;; :scheduled/future-days 14
|
||||
;; Default value: 7
|
||||
;; :scheduled/future-days 7
|
||||
|
||||
;; Specify the first day of the week.
|
||||
;; Available options:
|
||||
;; - integer from 0 to 6 (Monday to Sunday)
|
||||
;; Default value: 6 (Sunday)
|
||||
:start-of-week 6
|
||||
|
||||
;; Specify a custom CSS import.
|
||||
;; This option takes precedence over the local `logseq/custom.css` file.
|
||||
;; Example usage:
|
||||
;; :custom-css-url "@import url('https://cdn.jsdelivr.net/gh/dracula/logseq@master/custom.css');"
|
||||
|
||||
;; Specify a custom JS import.
|
||||
;; This option takes precedence over the local `logseq/custom.js` file.
|
||||
;; Example usage:
|
||||
;; :custom-js-url "https://cdn.logseq.com/custom.js"
|
||||
|
||||
;; Set a custom Arweave gateway
|
||||
;; Default gateway: https://arweave.net
|
||||
;; :arweave/gateway "https://arweave.net"
|
||||
|
||||
;; Set bullet indentation when exporting
|
||||
;; Available options:
|
||||
;; - `:eight-spaces` as eight spaces
|
||||
;; - `:four-spaces` as four spaces
|
||||
;; - `:two-spaces` as two spaces
|
||||
;; - `:tab` as a tab character (default)
|
||||
;; :export/bullet-indentation :tab
|
||||
|
||||
;; Publish all pages within the Graph
|
||||
;; Regardless of whether individual pages have been marked as public.
|
||||
;; Default value: false
|
||||
;; :publishing/all-pages-public? false
|
||||
|
||||
;; Define the default home page and sidebar status.
|
||||
;; If unspecified, the journal page will be loaded on startup and the right sidebar will stay hidden.
|
||||
;; The `:page` value represents the name of the page displayed at startup.
|
||||
;; Available options for `:sidebar` are:
|
||||
;; - "Contents" to display the Contents page in the right sidebar.
|
||||
;; - A specific page name to display in the right sidebar.
|
||||
;; - An array of multiple pages, e.g., ["Contents" "Page A" "Page B"].
|
||||
;; If `:sidebar` remains unset, the right sidebar will stay hidden.
|
||||
;; Examples:
|
||||
;; 1. Set "Changelog" as the home page and display "Contents" in the right sidebar:
|
||||
;; :default-home {:page "Changelog", :sidebar "Contents"}
|
||||
;; 2. Set "Jun 3rd, 2021" as the home page without the right sidebar:
|
||||
;; :default-home {:page "Jun 3rd, 2021"}
|
||||
;; 3. Set "home" as the home page and display multiple pages in the right sidebar:
|
||||
;; :default-home {:page "home", :sidebar ["Page A" "Page B"]}
|
||||
|
||||
;; Set the default location for storing notes.
|
||||
;; Default value: "pages"
|
||||
;; :pages-directory "pages"
|
||||
|
||||
;; Set the default location for storing journals.
|
||||
;; Default value: "journals"
|
||||
;; :journals-directory "journals"
|
||||
|
||||
;; Set the default location for storing whiteboards.
|
||||
;; Default value: "whiteboards"
|
||||
;; :whiteboards-directory "whiteboards"
|
||||
|
||||
;; Enabling this option converts
|
||||
;; [[Grant Ideas]] to [[file:./grant_ideas.org][Grant Ideas]] for org-mode.
|
||||
;; For more information, visit https://github.com/logseq/logseq/issues/672
|
||||
;; :org-mode/insert-file-link? false
|
||||
|
||||
;; Configure custom shortcuts.
|
||||
;; Syntax:
|
||||
;; 1. + indicates simultaneous key presses, e.g., `Ctrl+Shift+a`.
|
||||
;; 2. A space between keys represents key chords, e.g., `t s` means
|
||||
;; pressing `t` followed by `s`.
|
||||
;; 3. mod refers to `Ctrl` for Windows/Linux and `Command` for Mac.
|
||||
;; 4. Use false to disable a specific shortcut.
|
||||
;; 5. You can define multiple bindings for a single action, e.g., ["ctrl+j" "down"].
|
||||
;; The full list of configurable shortcuts is available at:
|
||||
;; https://github.com/logseq/logseq/blob/master/src/main/frontend/modules/shortcut/config.cljs
|
||||
;; Example:
|
||||
;; :shortcuts
|
||||
;; {:editor/new-block "enter"
|
||||
;; :editor/new-line "shift+enter"
|
||||
;; :editor/insert-link "mod+shift+k"
|
||||
;; :editor/highlight false
|
||||
;; :ui/toggle-settings "t s"
|
||||
;; :editor/up ["ctrl+k" "up"]
|
||||
;; :editor/down ["ctrl+j" "down"]
|
||||
;; :editor/left ["ctrl+h" "left"]
|
||||
;; :editor/right ["ctrl+l" "right"]}
|
||||
:shortcuts {}
|
||||
|
||||
;; Configure the behavior of pressing Enter in document mode.
|
||||
;; if set to true, pressing Enter will create a new block.
|
||||
;; Default value: false
|
||||
:shortcut/doc-mode-enter-for-new-block? false
|
||||
|
||||
;; Block content larger than `block/content-max-length` will not be searchable
|
||||
;; or editable for performance.
|
||||
;; Default value: 10000
|
||||
:block/content-max-length 10000
|
||||
|
||||
;; Display command documentation on hover.
|
||||
;; Default value: true
|
||||
:ui/show-command-doc? true
|
||||
|
||||
;; Display empty bullet points.
|
||||
;; Default value: false
|
||||
:ui/show-empty-bullets? false
|
||||
|
||||
;; Pre-defined :view function to use with advanced queries.
|
||||
:query/views
|
||||
{:pprint
|
||||
(fn [r] [:pre.code (pprint r)])}
|
||||
|
||||
;; Advanced queries `:result-transform` function.
|
||||
;; Transform the query result before displaying it.
|
||||
:query/result-transforms
|
||||
{:sort-by-priority
|
||||
(fn [result] (sort-by (fn [h] (get h :block/priority "Z")) result))}
|
||||
|
||||
;; The following queries will be displayed at the bottom of today's journal page.
|
||||
;; The "NOW" query returns tasks with "NOW" or "DOING" status.
|
||||
;; The "NEXT" query returns tasks with "NOW", "LATER", or "TODO" status.
|
||||
:default-queries
|
||||
{:journals
|
||||
[{:title "🔨 NOW"
|
||||
:query [:find (pull ?h [*])
|
||||
:in $ ?start ?today
|
||||
:where
|
||||
[?h :block/marker ?marker]
|
||||
[(contains? #{"NOW" "DOING"} ?marker)]
|
||||
[?h :block/page ?p]
|
||||
[?p :block/journal? true]
|
||||
[?p :block/journal-day ?d]
|
||||
[(>= ?d ?start)]
|
||||
[(<= ?d ?today)]]
|
||||
:inputs [:14d :today]
|
||||
:result-transform (fn [result]
|
||||
(sort-by (fn [h]
|
||||
(get h :block/priority "Z")) result))
|
||||
:group-by-page? false
|
||||
:collapsed? false}
|
||||
{:title "📅 NEXT"
|
||||
:query [:find (pull ?h [*])
|
||||
:in $ ?start ?next
|
||||
:where
|
||||
[?h :block/marker ?marker]
|
||||
[(contains? #{"NOW" "LATER" "TODO"} ?marker)]
|
||||
[?h :block/page ?p]
|
||||
[?p :block/journal? true]
|
||||
[?p :block/journal-day ?d]
|
||||
[(> ?d ?start)]
|
||||
[(< ?d ?next)]]
|
||||
:inputs [:today :7d-after]
|
||||
:group-by-page? false
|
||||
:collapsed? false}]}
|
||||
|
||||
;; Add custom commands to the command palette
|
||||
;; Example usage:
|
||||
;; :commands
|
||||
;; [
|
||||
;; ["js" "Javascript"]
|
||||
;; ["md" "Markdown"]
|
||||
;; ]
|
||||
:commands
|
||||
[
|
||||
["c1" [[:editor/input "{{c1 }}"] [:editor/move-cursor -2]]]
|
||||
["ㅊ1" [[:editor/input "{{c1 }}"] [:editor/move-cursor -2]]]
|
||||
["c2" [[:editor/input "{{c2 }}"] [:editor/move-cursor -2]]]
|
||||
["ㅊ2" [[:editor/input "{{c2 }}"] [:editor/move-cursor -2]]]
|
||||
["extra" [[:editor/input "extra::"]]]
|
||||
["begin_end" [
|
||||
[:editor/input "#+BEGIN_EXTRA\n\n#+END_EXTRA"]
|
||||
[:editor/move-cursor -12]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
;; Enable collapsing blocks with titles but no children.
|
||||
;; By default, only blocks with children can be collapsed.
|
||||
;; Setting `:outliner/block-title-collapse-enabled?` to true allows collapsing
|
||||
;; blocks with titles (multiple lines) and content. For example:
|
||||
;; - block title
|
||||
;; block content
|
||||
;; Default value: false
|
||||
:outliner/block-title-collapse-enabled? false
|
||||
|
||||
;; Macros replace texts and will make you more productive.
|
||||
;; Example usage:
|
||||
;; Change the :macros value below to:
|
||||
;; {"poem" "Rose is $1, violet's $2. Life's ordered: Org assists you."}
|
||||
;; input "{{poem red,blue}}"
|
||||
;; becomes
|
||||
;; Rose is red, violet's blue. Life's ordered: Org assists you.
|
||||
:macros {
|
||||
}
|
||||
|
||||
;; Configure the default expansion level for linked references.
|
||||
;; For example, consider the following block hierarchy:
|
||||
;; - a [[page]] (level 1)
|
||||
;; - b (level 2)
|
||||
;; - c (level 3)
|
||||
;; - d (level 4)
|
||||
;;
|
||||
;; With the default value of level 2, block b will be collapsed.
|
||||
;; If the level's value is set to 3, block c will be collapsed.
|
||||
;; Default value: 2
|
||||
:ref/default-open-blocks-level 2
|
||||
|
||||
;; Configure the threshold for linked references before collapsing.
|
||||
;; Default value: 100
|
||||
:ref/linked-references-collapsed-threshold 50
|
||||
|
||||
;; Graph view configuration.
|
||||
;; Example usage:
|
||||
;; :graph/settings
|
||||
;; {:orphan-pages? true ; Default value: true
|
||||
;; :builtin-pages? false ; Default value: false
|
||||
;; :excluded-pages? false ; Default value: false
|
||||
;; :journal? false} ; Default value: false
|
||||
|
||||
;; Graph view configuration.
|
||||
;; Example usage:
|
||||
;; :graph/forcesettings
|
||||
;; {:link-dist 180 ; Default value: 180
|
||||
;; :charge-strength -600 ; Default value: -600
|
||||
;; :charge-range 600} ; Default value: 600
|
||||
|
||||
;; Favorites to list on the left sidebar
|
||||
:favorites ["📋 index page" "index page" "Index"]
|
||||
|
||||
;; Set flashcards interval.
|
||||
;; Expected value:
|
||||
;; - Float between 0 and 1
|
||||
;; higher values result in faster changes to the next review interval.
|
||||
;; Default value: 0.5
|
||||
;; :srs/learning-fraction 0.5
|
||||
|
||||
;; Set the initial interval after the first successful review of a card.
|
||||
;; Default value: 4
|
||||
;; :srs/initial-interval 4
|
||||
|
||||
;; Hide specific block properties.
|
||||
;; Example usage:
|
||||
;; :block-hidden-properties #{:public :icon}
|
||||
|
||||
;; Create a page for all properties.
|
||||
;; Default value: true
|
||||
:property-pages/enabled? true
|
||||
|
||||
;; Properties to exclude from having property pages
|
||||
;; Example usage:
|
||||
;; :property-pages/excludelist #{:duration :author}
|
||||
|
||||
;; By default, property value separated by commas will not be treated as
|
||||
;; page references. You can add properties to enable it.
|
||||
;; Example usage:
|
||||
;; :property/separated-by-commas #{:alias :tags}
|
||||
|
||||
;; Properties that are ignored when parsing property values for references
|
||||
;; Example usage:
|
||||
;; :ignored-page-references-keywords #{:author :website}
|
||||
|
||||
;; logbook configuration.
|
||||
;; :logbook/settings
|
||||
;; {:with-second-support? false ;limit logbook to minutes, seconds will be eliminated
|
||||
;; :enabled-in-all-blocks true ;display logbook in all blocks after timetracking
|
||||
;; :enabled-in-timestamped-blocks false ;don't display logbook at all
|
||||
;; }
|
||||
|
||||
;; Mobile photo upload configuration.
|
||||
;; :mobile/photo
|
||||
;; {:allow-editing? true
|
||||
;; :quality 80}
|
||||
|
||||
;; Mobile features options
|
||||
;; Gestures
|
||||
;; Example usage:
|
||||
;; :mobile
|
||||
;; {:gestures/disabled-in-block-with-tags ["kanban"]}
|
||||
|
||||
;; Extra CodeMirror options
|
||||
;; See https://codemirror.net/5/doc/manual.html#config for possible options
|
||||
;; Example usage:
|
||||
;; :editor/extra-codemirror-options
|
||||
;; {:lineWrapping false ; Default value: false
|
||||
;; :lineNumbers true ; Default value: true
|
||||
;; :readOnly false} ; Default value: false
|
||||
|
||||
;; Enable logical outdenting
|
||||
;; Default value: false
|
||||
;; :editor/logical-outdenting? false
|
||||
|
||||
;; Prefer pasting the file when text and a file are in the clipboard.
|
||||
;; Default value: false
|
||||
;; :editor/preferred-pasting-file? false
|
||||
|
||||
;; Quick capture templates for receiving content from other apps.
|
||||
;; Each template contains three elements {time}, {text} and {url}, which can be auto-expanded
|
||||
;; by receiving content from other apps. Note: the {} cannot be omitted.
|
||||
;; - {time}: capture time
|
||||
;; - {date}: capture date using current date format, use `[[{date}]]` to get a page reference
|
||||
;; - {text}: text that users selected before sharing.
|
||||
;; - {url}: URL or assets path for media files stored in Logseq.
|
||||
;; You can also reorder them or use only one or two of them in the template.
|
||||
;; You can also insert or format any text in the template, as shown in the following examples.
|
||||
;; :quick-capture-templates
|
||||
;; {:text "[[quick capture]] **{time}**: {text} from {url}"
|
||||
;; :media "[[quick capture]] **{time}**: {url}"}
|
||||
|
||||
;; Quick capture options.
|
||||
;; - insert-today? Insert the capture at the end of today's journal page (boolean).
|
||||
;; - redirect-page? Redirect to the quick capture page after capturing (boolean).
|
||||
;; - default-page The default page to capture to if insert-today? is false (string).
|
||||
;; :quick-capture-options
|
||||
;; {:insert-today? false ;; Default value: true
|
||||
;; :redirect-page? false ;; Default value: false
|
||||
;; :default-page "quick capture"} ;; Default page: "quick capture"
|
||||
|
||||
;; File sync options
|
||||
;; Ignore these files when syncing, regexp is supported.
|
||||
;; :file-sync/ignore-files []
|
||||
|
||||
;; Configure the Enter key behavior for
|
||||
;; context-aware editing with DWIM (Do What I Mean).
|
||||
;; context-aware Enter key behavior implies that pressing Enter will
|
||||
;; have different outcomes based on the context.
|
||||
;; For instance, pressing Enter within a list generates a new list item,
|
||||
;; whereas pressing Enter in a block reference opens the referenced block.
|
||||
;; :dwim/settings
|
||||
;; {:admonition&src? true ;; Default value: true
|
||||
;; :markup? false ;; Default value: false
|
||||
;; :block-ref? true ;; Default value: true
|
||||
;; :page-ref? true ;; Default value: true
|
||||
;; :properties? true ;; Default value: true
|
||||
;; :list? false} ;; Default value: false
|
||||
|
||||
;; Configure the escaping method for special characters in page titles.
|
||||
;; Warning:
|
||||
;; This is a dangerous operation. To modify the setting,
|
||||
;; access the 'Filename format' setting and follow the instructions.
|
||||
;; Otherwise, You may need to manually rename all affected files and
|
||||
;; re-index them on all clients after synchronization.
|
||||
;; Incorrect handling may result in messy page titles.
|
||||
;; Available options:
|
||||
;; - :triple-lowbar (default)
|
||||
;; ;use triple underscore `___` for slash `/` in page title
|
||||
;; ;use Percent-encoding for other invalid characters
|
||||
:file/name-format :triple-lowbar
|
||||
:journal/page-title-format "yyyy-MM-dd EEEE"
|
||||
:feature/enable-journals? false
|
||||
:default-home {:page "📋 Index Page"}
|
||||
:graph/forcesettings {:link-dist 10
|
||||
:charge-strength -1000}
|
||||
:graph/settings {:builtin-pages? false
|
||||
:excluded-pages? true
|
||||
:orphan-pages? true
|
||||
:journal? false}}
|
||||
@ -1,5 +0,0 @@
|
||||
.page-title {
|
||||
font-size: 1.em !important;
|
||||
font-weight : bold !important;
|
||||
color: #006400 !important; /* 원하는 색상으로 변경 */
|
||||
}
|
||||