๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ

(116)
BOJ2628 : ์ข…์ด์ž๋ฅด๊ธฐ (Silver 5) #include #include #include #include using namespace std; int main() { int a, b; int linenum; int line_a[10000] = { 0, }; int line_b[10000] = { 0, }; int acount = 0, bcount = 0; int tmp = 0; cin >> a >> b; cin >> linenum; for (int i = 0; i > tmp; if (tmp == 1) { cin >> line_a[acount]; acount++; } else { cin >> line_b[bcount]; bcount++; } } // cout
BOJ2456 : ๋‚˜๋Š” ํ•™๊ธ‰ํšŒ์žฅ์ด๋‹ค (Bronze1) #include #include #include #include using namespace std; int main() { int N; int score[1000][3]; cin >> N; int total[3][3] = {0}; for (int i = 0; i > score[i][0] >> score[i][1] >> score[i][2]; if (score[i][0] == 1) total[0][0]++; if (score[i][0] == 2) total[0][1]++; if (score[i][0] == 3) total[0][2]++; if (score[i][1] == 1) total[1][0]++; if (score[i][1] == 2) total[1][1]++; if ..
[์ธ๊ณต์ง€๋Šฅ] 17. Making Sequential Decisions 1. Markov Decision Process 1) Episodic Decisions - nondeterministic, partially observableํ•œ ์ƒํ™ฉ์—์„œ๋Š” ๋‹ค์Œ state๋ฅผ ํ™•์‹ ํ•  ์ˆ˜ ์—†๋‹ค. ๋”ฐ๋ผ์„œ observations e๊ฐ€ ์ฃผ์–ด์กŒ์„ ๋•Œ outcome์€ outcome s'๊ฐ€ ๋งž์„ ๋•Œ์˜ ํ™•๋ฅ ๋กœ ๋‚˜ํƒ€๋‚ผ ์ˆ˜ ์žˆ๋‹ค. P(Result(a) = s' | a, e) - Utility function U(s)๋Š” ๊ฐ state์˜ ์ข‹์€ ์ •๋„๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ํ•˜๋‚˜์˜ ์ˆซ์ž์ด๋‹ค. ์ฃผ์–ด์ง„ evidence์—์„œ ์–ด๋–ค action์„ ์ทจํ–ˆ์„ ๋•Œ์˜ expected utility ๊ฐ’์€, ๊ทธ action์„ ์ทจํ–ˆ์„ ๋•Œ ๋‚˜์˜ค๋Š” outcome์˜ average utility value๊ฐ’์ด๋‹ค. EU(a | e) = ∑(s') P(Res..
[์ธ๊ณต์ง€๋Šฅ] 16. Hidden Markov Models (HMM) 1. Definition of Hidden Markov Model : ์‹œ๊ฐ„์˜ ๊ฐœ๋…์ด ํฌํ•จ๋œ ํ™•๋ฅ  ๋ชจ๋ธ - single discrete random variable๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ๋Š” probabilistic model. - state variable Xt ๋Š” ์ •์ˆ˜ 1, ... , S๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์œผ๋ฉฐ, S๋Š” ๊ฐ€๋Šฅํ•œ states์˜ ์ˆ˜์ด๋‹ค. - transition model P(Xt|Xt-1) ์€ S*S์˜ matrix T์ด๋‹ค. (T_ij = P(Xt = j | X_t-1 = i) - evidence variable Et๋Š” ๊ฐ state์—์„œ specifyํ•˜๊ณ , ๊ฐ state i์—์„œ P(et | Xt = i) ๋ฅผ ํ†ตํ•ด state๊ฐ€ et๋ฅผ ์•ผ๊ธฐํ•˜๋Š”์ง€์— ๋Œ€ํ•ด ์•Œ ์ˆ˜ ์žˆ๋‹ค. ์ด value๋Š” ํŽธ์˜์ƒ S*S์˜ diagona..
[์ธ๊ณต์ง€๋Šฅ] 15. Probabilistic Reasoning over Time (PRoT) 1. Introduction - ์„ธ์ƒ์„ ๋ช‡ ๊ฐœ์˜ observable ํ•˜๊ฑฐ๋‚˜ ๊ทธ๋ ‡์ง€ ์•Š์€ random variables์„ ํฌํ•จํ•˜๊ณ  ์žˆ๋Š” ์–ด๋–ค snapshot ๋˜๋Š” time slices์˜ ์ง‘ํ•ฉ์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜์ž. - Xt : state variables at time t , ์‹œ๊ฐ„์ด t์ผ ๋•Œ์˜ state variable๋“ค์˜ ์ง‘ํ•ฉ. ๊ด€์ธกํ•  ์ˆ˜ ์—†๋Š”, ๊ทธ ๊ฐ’์„ ์•Œ ์ˆ˜ ์—†๋Š” variable์ด๋‹ค. - Et : evidence variables, ๊ด€์ธกํ•  ์ˆ˜ ์žˆ๋Š”, ์•Œ ์ˆ˜ ์žˆ๋Š” variable - transition model : state์ด ์–ด๋–ป๊ฒŒ ๋ณ€ํ•˜๋Š”์ง€ ์ •์˜ํ•œ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด t-1 ์ผ ๋•Œ state์ด X์ผ ๋•Œ, ๋‹ค์Œ state์ด X ์ผ ํ™•๋ฅ  - sensor model : evidence variable์ด ๊ฐ’์ด ์–ด๋–ป๊ฒŒ ..
[์ธ๊ณต์ง€๋Šฅ] 14. Bayesian Networks 1. Definition of Bayesian Networks 1) Bayesian networks (= belief networks, Bayesian belief networks, graphical models) - Directed graph์ž„ - Nodes (= Random variable)์™€ Links ๋กœ ๊ตฌ์„ฑ๋จ - node X๋กœ๋ถ€ํ„ฐ node Y๋กœ์˜ links๋กœ ์ด๋ฃจ์–ด์ง„ directed acyclic graph(DAG) - X๋Š” causes, Y๋Š” effects - Conditional probability distribution P(Xi | Parents(Xi) ) : Xi ์˜ ๋ถ€๋ชจ ๋…ธ๋“œ๋“ค์ด ๋ฐœ์ƒํ•  ๋•Œ Xi๊ฐ€ ๋ฐœ์ƒํ•  ํ™•๋ฅ  ์ฆ‰ ~๊ฐ€ ๋ฐœ์ƒํ•  ๋•Œ์˜ ํ™•๋ฅ ์„ ํŠธ๋ฆฌ์ฒ˜๋Ÿผ..? ๊ทธ๋ž˜ํ”„๋กœ ๋‚˜ํƒ€๋ƒ„ 2) Condit..
[์ธ๊ณต์ง€๋Šฅ] 13. Probability and Statistics 1. Review of Probabilities and Statics 1) Elements of Probability - Random experiment : ์‹œํ–‰, Nondeterministic - Sample space : ์ „์ฒด์ง‘ํ•ฉ ์š”์†Œ๋“ค. Mutually exclusive(๋ฐฐ๋ฐ˜์‚ฌ๊ฑด)์ด๊ณ  exhaustive(ํ•ฉ์ง‘ํ•ฉ = ์ „์ฒด์ง‘ํ•ฉ) ์ด๋‹ค. - Events : ์‚ฌ๊ฑด, Sample space์˜ ๋ถ€๋ถ„์ง‘ํ•ฉ - Probability : ํ™•๋ฅ . the proportion, or relative frequency (๋น„์œจ, ์ƒ๋Œ€์  ๋นˆ๋„์ˆ˜) / degree of belief (๊ธฐ๋Œ“๊ฐ’) 2) Axioms of Probability Theory - ํ™•๋ฅ ์€ 0๊ณผ 1 ์‚ฌ์ด์ž„ - Sample space์˜ ๋ชจ๋“  ํ™•๋ฅ ์„ ๋”ํ•˜๋ฉด 1 -..
[์ด์‚ฐ์ˆ˜ํ•™] Chapter 1. Logic and proofs 1. Propositions : ๋ช…์ œ - ๋งŒ์•ฝ p, q๊ฐ€ ๋ช…์ œ๋ผ๋ฉด, connective๋ฅผ ์ด์šฉํ•ด ์ƒˆ๋กœ์šด compound proposition์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค. (conjunction AND, inclusive disjunction OR, exclusive disjunction OR(XOR), negation, implication, double implication) 2. Conditional propositions(์กฐ๊ฑด๋ช…์ œ) and logical equivalence(๋™์น˜) - conditional proposition : p->q "if p then q", "p only if q" p : ๊ฐ€์ •, ์ถฉ๋ถ„์กฐ๊ฑด / q : ๊ฒฐ๋ก , ํ•„์š”์กฐ๊ฑด - logically equivalent (converse(์—ญ), co..
[์ด์‚ฐ์ˆ˜ํ•™] Chapter 6. Counting methods and the pigeonhole principle 1. Basic Principles - Menu for Quick Lunch : ์ ์‹ฌ ๋ฉ”๋‰ด๋ฅผ ๊ณ ๋ฅด๋Š” ๊ฒฝ์šฐ์˜ ์ˆ˜ 1) Multiplication Principle(๊ณฑ์…ˆ๋ฒ•์น™) : k๊ฐœ์˜ ์—ฐ์†์ ์ธ ํ–‰๋™์ด ์žˆ์„ ๋•Œ, ์ด ํ–‰๋™์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒฝ์šฐ์˜ ์ˆ˜๋Š” n1n2...nk ex) 8 bit string ์—์„œ 101์ด๋‚˜ 111๋กœ ์‹œ์ž‘ํ•˜๋Š” ๊ฒƒ์˜ ๊ฐœ์ˆ˜ : 2^5 * 2 2) Addition Principle (๋ง์…ˆ๋ฒ•์น™) nj๊ฐœ์˜ elements๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” k๊ฐœ์˜ pairwise disjoint sets๊ฐ€ ์žˆ์„ ๋•Œ, ์ด sets์˜ ๊ฒฐํ•ฉ X = ∪Xj ๋Š” n1 + n2+...+ nk์˜ elements๋ฅผ ๊ฐ€์ง„๋‹ค. 2. Permutations and Combinations (์ˆœ์—ด๊ณผ ์กฐํ•ฉ) 1) Permutation : ์ˆœ์—ด (..
[์ด์‚ฐ์ˆ˜ํ•™] Chapter 5. Introduction to Number Theory 1. Divisors 1) - d๊ฐ€ n์„ ๋‚˜๋ˆ„์–ด ๋–จ์–ด์ง€๊ฒŒ ํ•  ๋•Œ, ์ฆ‰ n=dq๋ฅผ ๋งŒ์กฑํ•˜๋Š” integer q๊ฐ€ ์กด์žฌํ•  ๋•Œ, d divides n์ด๋ผ๊ณ  ๋งํ•œ๋‹ค. - ์ด ๋•Œ q๋ฅผ quotient, d๋ฅผ divisor ๋˜๋Š” n์˜ factor๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค. - d divides n์ผ ๋•Œ d|n์œผ๋กœ ์“ด๋‹ค. Theorem 5.1.3 m, n, d๋ฅผ ์ •์ˆ˜๋ผ๊ณ  ํ•˜์ž. ๋งŒ์•ฝ d|m์ด๊ณ  d|n์ด๋ฉด d|(m±n)์ด๋‹ค. ๋˜ํ•œ d|m์ด๋ฉด d|mn์ด๋‹ค. proof : d|m์ด๊ณ  d|n์ด๋ฉด m=dq, n=dq' ๋ผ๊ณ  ์“ธ ์ˆ˜ ์žˆ๋‹ค. m+n = dq + dq' = d(q+q')์ด๋‹ค. ๋”ฐ๋ผ์„œ d|(m+n) ์ด๋‹ค. 2) Prime and Composite - Prime : ์†Œ์ˆ˜ - Composite : ํ•ฉ์„ฑ์ˆ˜ composition์€ 2์™€ ๋ฃจ..