[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,116 +2,183 @@
|
||||
id: wiki-2026-0508-complexity-theory
|
||||
title: Complexity Theory
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: []
|
||||
aliases: [Complex Systems, Complexity Science]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.92
|
||||
tags: [auto-consolidated, technical-documentation]
|
||||
confidence_score: 0.85
|
||||
verification_status: applied
|
||||
tags: [complexity, systems, emergence, cynefin]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-08
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: agnostic
|
||||
framework: agnostic
|
||||
---
|
||||
|
||||
# [[Complexity Theory|Complexity Theory]]
|
||||
# Complexity Theory
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "전체는 부분의 합보다 크다: 개별 요소들은 단순해 보이더라도, 이들이 얽히고설켜 상호작용할 때 발생하는 예측 불가능하고 비선형적인 패턴인 '복잡성'을 연구하는 현대 과학의 새로운 눈."
|
||||
## 매 한 줄
|
||||
> **"매 system 의 behavior 가 매 part 의 sum 보다 크다 — 매 emergence, nonlinearity, feedback."**. Complexity theory는 Santa Fe Institute (1984~) 가 정립한 cross-disciplinary field. Software 에서는 Cynefin framework (Snowden), Brooks 의 essential vs accidental complexity, Promise Theory, distributed systems 의 emergent behavior 로 산다. 2026년 ML systems 의 emergent capabilities 도 매 핵심 case.
|
||||
|
||||
---
|
||||
## 매 핵심
|
||||
|
||||
> "문제의 본질적 난이도를 측정하고, 계산 가능성의 경계를 설정하라" — 문제를 해결하는 데 필요한 자원(시간, 공간)의 양에 따라 문제들을 분류하고, 현실적으로 해결 가능한 문제와 불가능한 문제를 구분하는 전산학의 핵심 이론.
|
||||
### 매 complex vs complicated
|
||||
| Complicated | Complex |
|
||||
|---|---|
|
||||
| Many parts, knowable | Many parts, emergent |
|
||||
| Aircraft, watch | Ecosystem, market, brain, microservices fleet |
|
||||
| Decompose & analyze | Probe → sense → respond |
|
||||
| Predictable | Unpredictable in detail |
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
복잡계 이론(Complexity Theory)은 수많은 구성 요소가 서로 밀접하게 연관되어 질서와 혼돈 사이의 독특한 패턴을 만들어내는 시스템을 탐구합니다.
|
||||
### 매 Cynefin (Snowden)
|
||||
- **Clear (Simple)**: cause→effect 자명. Best practice.
|
||||
- **Complicated**: expert analysis 필요. Good practice.
|
||||
- **Complex**: emergent, retrospective coherence. Probe → sense → respond.
|
||||
- **Chaotic**: no cause→effect. Act → sense → respond.
|
||||
- **Confusion** (Disorder): which domain unclear.
|
||||
|
||||
1. **핵심 개념**:
|
||||
* **Emergence (발현)**: 하위 수준의 단순한 규칙이 상위 수준의 지능적 패턴을 만듦. ([[Collective-Intelligence|Collective-Intelligence]]와 연결)
|
||||
* **Feedback Loops**: 시스템 내의 결과가 다시 원인이 되어 증폭(Positive)되거나 억제(Negative)되는 순환 구조.
|
||||
* **Self-Organization**: 외부의 지휘 없이도 스스로 새로운 질서를 찾아감.
|
||||
* **Non-linearity**: 원인의 작은 변화가 결과의 엄청난 차이를 가져옴 (Butterfly Effect).
|
||||
2. **적용 분야**:
|
||||
* 주식 시장, 기후 변화, 인간 뇌의 신경망, 거대 언어 모델의 창발 등.
|
||||
### 매 essential vs accidental complexity (Brooks)
|
||||
- **Essential**: 매 problem itself 의 complexity (irreducible).
|
||||
- **Accidental**: tools, languages, infra 가 만든 complexity (reducible).
|
||||
- 매 silver bullet 없음 → essential complexity 의 tackling.
|
||||
|
||||
---
|
||||
### 매 emergent properties
|
||||
- Self-organization (ant colonies, market prices).
|
||||
- Phase transitions (water → ice, network connectivity).
|
||||
- Power laws (Zipf, scale-free networks).
|
||||
- Adaptive feedback (immune systems, ML training dynamics).
|
||||
|
||||
- **추출된 패턴:** 알고리즘의 구체적인 성능을 넘어, 문제 자체가 가진 복잡도를 수치화하여 문제 해결의 전략적 가이드라인을 제시하는 분류 패턴.
|
||||
- **핵심 클래스:**
|
||||
- **P (Polynomial Time):** 효율적으로 해결 가능한 문제 (예: 정렬, 검색).
|
||||
- **NP (Nondeterministic Polynomial Time):** 답을 맞히기는 어렵지만, 주어진 답이 맞는지 확인하기는 쉬운 문제.
|
||||
- **NP-complete:** NP 문제 중 가장 어려운 문제들. 하나만 해결하면 모든 NP 문제를 해결할 수 있음 (예: SAT 문제).
|
||||
- **P vs NP:** 현대 전산학 최대의 난제. "확인이 쉬운 문제는 해결도 쉬운가?"에 대한 질문.
|
||||
- **의의:** 암호학(해독하기 힘든 문제 설계)과 대규모 데이터 처리 알고리즘 설계의 이론적 기반.
|
||||
### 매 응용 in software
|
||||
1. Microservice fleet behavior (cascading failures, retry storms).
|
||||
2. ML emergent capabilities (in-context learning at scale).
|
||||
3. Distributed consensus (CAP, FLP impossibility).
|
||||
4. Tech debt accumulation (compound complexity).
|
||||
5. Team scaling (Brooks' law as complexity manifestation).
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌**: 과거의 과학 정책은 문제를 쪼개서 분석하는 '환원주의 정책'이었으나, 현대 정책은 쪼개면 사라지는 시스템 전체의 성질을 분석하는 '전체론적 복잡계 정책'으로 패러다임을 전환함(RL Update).
|
||||
- **정책 변화(RL Update)**: 거대 AI 모델의 '창발 능력 정책'을 예측하고 제어하기 위해, 단순 성능 측정을 넘어 복잡계 이론을 적용한 '상전이(Phase Transition) 분석 정책'이 도입되고 있음.
|
||||
## 💻 패턴
|
||||
|
||||
---
|
||||
|
||||
- **과거 데이터와의 충돌:** 초기에는 '정답'을 찾는 알고리즘에 집중했으나, 복잡성 이론의 발달로 인해 완벽한 정답 대신 '근사해'를 찾는 휴리스틱의 정당성이 확보됨.
|
||||
- **정책 변화:** Antigravity 프로젝트는 에이전트의 작업 계획 수립 시, 해당 태스크가 NP-hard 수준의 복잡도를 가지는지 판단하여 전수 조사 대신 탐색 위주의 전략을 채택함.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Emergence|Emergence]], [[Systems Thinking|Systems Thinking]], [[Collective-Intelligence|Collective-Intelligence]], Chaos Theory, [[Analysis|Analysis]]
|
||||
- **Modern Tech/Tools**: Agent-based modeling (NetLogo), Network [[Analysis|Analysis]] software,[[_system|system]] dynamics tools.
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
- [[Algorithm-Complexity-Big-O|Algorithm-Complexity-Big-O]], [[Combinatorial-Optimization|Combinatorial-Optimization]], Turing-Machine-Foundations, Cryptography
|
||||
- **Raw Source:** 10_Wiki/Topics/AI/Complexity-Theory.md
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
### Cynefin-driven decision (in code review)
|
||||
```python
|
||||
def categorize_problem(problem):
|
||||
if known_solution(problem):
|
||||
return "Clear: apply best practice"
|
||||
if expertise_resolves(problem):
|
||||
return "Complicated: expert analysis"
|
||||
if requires_experimentation(problem):
|
||||
return "Complex: probe-sense-respond"
|
||||
if no_cause_effect(problem):
|
||||
return "Chaotic: act-sense-respond"
|
||||
return "Disorder: clarify first"
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### Probe → sense → respond (chaos engineering)
|
||||
```typescript
|
||||
// Netflix Chaos Monkey style — controlled probe of complex system
|
||||
import { ChaosClient } from '@netflix/chaos';
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
const chaos = new ChaosClient();
|
||||
await chaos.experiment({
|
||||
name: 'kill-random-pod-payment-svc',
|
||||
hypothesis: 'system handles single pod loss within 30s',
|
||||
blast_radius: 'one pod',
|
||||
rollback_on: 'p99 > 500ms',
|
||||
observe: ['error_rate', 'latency_p99', 'saturation'],
|
||||
});
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### Reduce accidental complexity — replace shell with compiled tool
|
||||
```python
|
||||
# Accidental: bash script with 5 sed/awk/jq pipes
|
||||
# Essential: extract user emails from JSON
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
# After: simple, type-checked
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
emails = [
|
||||
user["email"]
|
||||
for user in json.loads(Path("users.json").read_text())
|
||||
if user.get("active")
|
||||
]
|
||||
```
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
### Feedback loop modeling (system dynamics)
|
||||
```python
|
||||
# Tech debt feedback loop — simple ODE
|
||||
import numpy as np
|
||||
from scipy.integrate import odeint
|
||||
|
||||
def tech_debt(state, t, capacity, debt_growth, paydown_rate):
|
||||
debt, velocity = state
|
||||
d_debt = debt_growth - paydown_rate * velocity
|
||||
d_velocity = capacity * (1 - debt / 100) - velocity * 0.1
|
||||
return [d_debt, d_velocity]
|
||||
|
||||
# Emergent: nonlinear collapse when debt > capacity
|
||||
sol = odeint(tech_debt, [10, 5], np.linspace(0, 100, 200),
|
||||
args=(10, 2, 0.5))
|
||||
```
|
||||
|
||||
### Power-law detection (scale-free service dependency)
|
||||
```python
|
||||
import numpy as np
|
||||
import powerlaw
|
||||
|
||||
# In-degree of microservice call graph
|
||||
in_degrees = compute_in_degrees(service_graph)
|
||||
fit = powerlaw.Fit(in_degrees)
|
||||
print(f"alpha={fit.power_law.alpha:.2f}") # ~2-3 → scale-free
|
||||
# Implication: targeted attack on hubs is catastrophic
|
||||
```
|
||||
|
||||
### Promise Theory (Burgess) — autonomous agents
|
||||
```yaml
|
||||
# Each service makes promises, others assess
|
||||
service: payment-svc
|
||||
promises:
|
||||
- id: p99_latency_under_300ms
|
||||
conditions: [load < 1000rps]
|
||||
valid_until: 2026-12-31
|
||||
- id: idempotent_charge_endpoint
|
||||
conditions: []
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Clear problem | Apply best practice, automate |
|
||||
| Complicated | Expert review, formal analysis |
|
||||
| Complex (emergent) | Probe with chaos engineering, observability |
|
||||
| Chaotic (incident) | Act first, stabilize, then sense |
|
||||
| Tech debt | Distinguish essential vs accidental |
|
||||
|
||||
**기본값**: Most production distributed systems 매 Complex domain 매 산다 → SLO + chaos + observability + post-incident review.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Systems Theory]] · [[Cybernetics]]
|
||||
- 변형: [[Cynefin]] · [[Promise Theory]] · [[Chaos Engineering]]
|
||||
- 응용: [[Distributed Systems]] · [[Microservices]] · [[SRE]]
|
||||
- Adjacent: [[No Silver Bullet]] · [[Conceptual Integrity]] · [[Emergent Behavior]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: incident retrospective, architecture decision in distributed system, tech debt classification, organizational design, ML system behavior analysis.
|
||||
**언제 X**: simple CRUD app design, single-node algorithm, bounded local logic.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Best-practice in complex domain**: clear-domain solution 을 complex domain 에 강제.
|
||||
- **Ignoring accidental complexity**: 매 essential 처럼 취급 → tooling 의 미개선.
|
||||
- **Predicting emergent behavior**: complex system 의 detail prediction 시도 — probe 가 답.
|
||||
- **No feedback loops in design**: system dynamics 무시 → 매 surprise outage.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Brooks "No Silver Bullet" / Snowden Cynefin / Mitchell "Complexity: A Guided Tour" / Burgess "Thinking in Promises").
|
||||
- 신뢰도 A-.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — Cynefin + Brooks essential/accidental + chaos engineering |
|
||||
|
||||
Reference in New Issue
Block a user