AI-05 · ARTIFICIAL INTELLIGENCE

MDP·가치함수·벨만 방정식MDPs, value functions and Bellman equations

연습과 휴식의 작은 결정에서 가치 반복의 수렴 증명까지From small practice-and-rest decisions to convergence of value iteration

실습 6종 · 풀이 포함 연습문제 60개6 labs · 60 exercises with solutions

기초Foundations

1. 연습할까, 쉬었다 할까1. Practice now or rest first?

오늘 피아노를 연습하면 바로 성취 점수를 얻지만 내일 피곤해질 수 있습니다. 쉬면 오늘 점수는 작아도 다음 선택의 조건이 좋아질 수 있습니다. 여기서는 실제 학생 조사 대신 준비됨 ready와 피곤함 tired 두 상태를 가정합니다. 점수는 성적이나 행복의 객관적 측정치가 아니라 우리가 정한 연습용 단위입니다.

장 전체에서 사용하는 가정한 교실 모형
현재행동다음 상태와 확률즉시 점수
readyrestready 11
readypracticeready 1/2, tired 1/23
tiredrestready 1/2, tired 1/21
tiredpracticetired 10

한 번만 선택한다면 ready에서는 practice의 3점이 rest의 1점보다 큽니다. 그런데 같은 기준으로 여러 번 선택할 때도 늘 같은 판단이 맞는지는 아직 모릅니다. 현재 선택이 다음 상태를 바꾸기 때문입니다. 이 장은 선택→결과→다음 선택의 연결을 표로 읽는 것부터 시작합니다.

Practicing piano may earn an immediate achievement score but leave you tired tomorrow. Rest gives less today while changing the conditions for the next decision. We assume two states, ready and tired, rather than claiming to have surveyed students. Scores are chosen teaching units, not objective grades or measures of happiness.

Hypothetical classroom model used throughout the chapter
CurrentActionNext state and probabilityImmediate score
readyrestready 11
readypracticeready 1/2, tired 1/23
tiredrestready 1/2, tired 1/21
tiredpracticetired 10

With just one decision, practice earns 3 rather than 1 in ready. Repeated decisions need further analysis because today’s action changes tomorrow’s state. Start by reading the chain action, outcome and next action, before introducing a long-run formula.

기초Foundations

2. 상태는 상황, 행동은 선택2. A state describes; an action chooses

상태는 결정을 내리기 직전 알고 있는 상황입니다. 행동은 그 상황에서 고르는 선택입니다. ready라는 상태에서 rest와 practice가 가능하며, 다음 상태가 어느 쪽인지까지 마음대로 고르지는 못합니다. 확률은 선택 뒤 결과의 불확실성을 표현합니다. 행동과 결과를 같은 목록에 넣으면 내가 통제하는 것과 그렇지 않은 것이 섞입니다.

모든 상태에 같은 행동이 있어야 하는 것은 아닙니다. 실제 재고가 없으면 배송 불가처럼 가능한 행동 집합은 상태에 따라 달라질 수 있습니다. 이 실습은 각 상태의 행동을 별도로 선언하고, 이름을 같게 붙여도 상태별 결과표를 따로 요구합니다. 파일의 행 번호 자체는 경제적 상태가 아닙니다.

A state is the situation known immediately before a decision. An action is an available choice. In ready you choose rest or practice, but cannot directly choose which random successor occurs. Keeping actions separate from outcomes distinguishes what is controlled from what remains uncertain.

Available actions may depend on the state: shipping may be unavailable with no stock. The lab therefore declares actions separately for every state, including separate outcome rows for an action with the same name in different states. A row number in a dataset is not automatically an economically meaningful state.

기초Foundations

3. 같은 다음 상태에도 보상이 다를 수 있다3. Different rewards can share a successor

결과 한 칸에는 다음 상태, 그 결과의 확률, 그때의 보상을 함께 적습니다. 같은 상태로 돌아오는 두 결과라도 보상이 다를 수 있습니다. 예를 들어 한 칸짜리 게임이 확률 1/3로 −2점, 확률 2/3로 4점을 주고 다시 시작하면 기대 보상은 2점입니다. 두 칸을 상태 이름만 보고 덮어쓰면 이 평균을 잃습니다.

rˉ(s,a)=∑op(o∣s,a)r(o),P(s′∣s,a)=∑o: next(o)=s′p(o∣s,a)\bar r(s,a)=\sum_o p(o\mid s,a)r(o),\qquad P(s^{\prime}\mid s,a)=\sum_{o:\,\mathrm{next}(o)=s^{\prime}}p(o\mid s,a)

결과 확률은 음수가 아니고 행동별 합이 정확히 1이어야 합니다. 합이 1.1인 표를 엔진이 몰래 정규화하지 않습니다. 보상은 확률과 달리 음수여도 되고 1보다 커도 됩니다. 전이확률과 기대 보상을 따로 집계해도, 미래 가치가 다음 상태에만 의존하는 Bellman 계산은 같습니다.

Each outcome contains a successor, its probability and its reward. Two outcomes may reach the same state while paying differently. A one-state game paying −2 with probability 1/3 and 4 with probability 2/3 has expected reward 2. Overwriting outcomes by successor name loses this average.

rˉ(s,a)=∑op(o∣s,a)r(o),P(s′∣s,a)=∑o: next(o)=s′p(o∣s,a)\bar r(s,a)=\sum_o p(o\mid s,a)r(o),\qquad P(s^{\prime}\mid s,a)=\sum_{o:\,\mathrm{next}(o)=s^{\prime}}p(o\mid s,a)

Probabilities are nonnegative and sum exactly to one for each action. The engine does not silently normalize a row totaling 1.1. Rewards may be negative or exceed one. Aggregated transition probabilities and expected rewards preserve Bellman calculations when future value depends only on the successor state.

기초Foundations

4. 현재 상태에 무엇을 기억시킬까4. What should the current state remember?

피곤함이 같은 두 날이라도 어제 수면 시간이 달라 내일 결과가 달라진다면 tired 하나로는 부족할 수 있습니다. 필요한 수면 정보나 남은 시간까지 상태에 넣으면 모형이 달라집니다. Markov 가정은 현재 상태와 행동을 알면 더 오래된 이력이 다음 결과를 추가로 예측하지 못한다는 가정입니다. 과거가 현실에서 중요하지 않다는 선언이 아닙니다.

P(St+1,Rt+1∣S0,A0,…,St,At)=P(St+1,Rt+1∣St,At)P(S_{t+1},R_{t+1}\mid S_0,A_0,\ldots,S_t,A_t)=P(S_{t+1},R_{t+1}\mid S_t,A_t)

또 매 시점 같은 표를 쓴다는 정상성 가정도 구별합니다. 자료를 시간순으로 정렬했다고 Markov 성질이나 정상성이 증명되지는 않습니다. 실제 국가 사례에서 관측한 인접 연도 비율을 계산한 뒤, 그것을 반복되는 결정의 전이표로 사용하는 단계가 별도 가정인 이유입니다.

Two tired days may have different next-day outcomes because prior sleep differs. Adding relevant sleep information or remaining time changes the state definition. The Markov assumption says that, conditional on the current state and action, older history adds no further predictive information for the next outcome. It does not declare that history is irrelevant in reality.

P(St+1,Rt+1∣S0,A0,…,St,At)=P(St+1,Rt+1∣St,At)P(S_{t+1},R_{t+1}\mid S_0,A_0,\ldots,S_t,A_t)=P(S_{t+1},R_{t+1}\mid S_t,A_t)

Stationarity, using the same tables at every time, is another assumption. Sorting data chronologically proves neither property. In the country case, computing observed adjacent-year ratios and reusing them as a repeated decision kernel are separate steps.

기초Foundations

5. 끝난 뒤에는 0점을 유지한다5. After termination, keep rewards at zero

한 문제를 풀고 끝나는 게임은 terminal 상태로 들어간 뒤 0점만 받아야 합니다. 실습은 terminal에 stop 행동과 자기 자신으로 확률 1인 결과, 보상 0을 명시합니다. 끝난 상태에 행동 행이 없다는 표현과 수학적으로 같은 종료를 나타낼 수 있지만, 두 입력 규약을 섞지 않습니다.

완료 보상 10점을 도착할 때 한 번 주었다면, terminal의 매 시점 보상을 또 10으로 두면 안 됩니다. 할인율 1/2에서 그 상태의 가치는 20이 되어 종료 보상을 무한히 되풀이하는 다른 문제가 됩니다. 종료 상태도 처음 값이 임의이면 가치 반복 중에는 0으로 줄어들 수 있지만 정확한 고정점 가치는 0입니다.

A game ending after a prediction should earn zero after entering terminal. Our API explicitly supplies a stop action with a probability-one self-loop and zero reward. This can represent the same termination as a no-outgoing-action convention, but input conventions must remain consistent.

If a completion bonus of 10 is paid once upon arrival, assigning reward 10 at every terminal step repeats the bonus forever. At discount 1/2 the resulting terminal value is 20, a different task. A nonzero initial terminal estimate may decay during iteration; its exact fixed-point value is zero.

기초Foundations

6. 기대값은 결과별 점수의 가중평균6. Expectation is a weighted average of outcomes

가정한 게임에서 확률 3/4로 2점, 확률 1/4로 −2점이면 기대 점수는 1점입니다. 2와 −2를 그냥 더해 0으로 만들면 서로 다른 확률을 빠뜨립니다. 기대값 1점은 한 번 실행할 때 반드시 받는 점수도 아닙니다. 같은 선언을 반복할 때의 평균을 요약합니다.

E[R]=(3/4)⋅2+(1/4)⋅(−2)=1\mathbb E[R]=(3/4)\cdot2+(1/4)\cdot(-2)=1

위험이 다른 두 선택이 같은 평균을 가질 수 있습니다. 모든 사람에게 기대 점수 최대화가 유일한 목표라고 말할 수는 없습니다. 이번 장은 정한 점수의 기대 할인합을 최대화하는 모형을 풉니다. 위험·형평·안전 제약을 보상 하나에 숨겨 넣기 전에 무엇을 목표로 정했는지 토론해야 합니다.

A hypothetical game paying 2 with probability 3/4 and −2 with probability 1/4 has expectation 1. Adding the two outcomes without weights loses their unequal probabilities. The expected score is not a score guaranteed in one play; it summarizes the declared repeated experiment.

E[R]=(3/4)⋅2+(1/4)⋅(−2)=1\mathbb E[R]=(3/4)\cdot2+(1/4)\cdot(-2)=1

Different risks may share an expectation. Maximizing expected score is not the only legitimate human objective. We solve the declared expected discounted-score task, while making room to discuss risk, fairness and constraints rather than hiding them inside an unexplained reward.

기초Foundations

7. 두 번 선택하는 나무를 먼저 펼친다7. Unroll two decisions before an infinite sum

할인 없이 두 번만 선택하고 끝낸다고 합시다. 마지막 선택의 ready 최대 점수는 3, tired는 1입니다. 첫 ready에서 practice하면 첫 3점에 다음 기대 점수 (3+1)/2=2점이 더해져 5점입니다. rest하면 1+3=4점입니다. 첫 tired에서는 rest가 1+(3+1)/2=3점, practice는 0+1=1점입니다.

유한 두 결정 · 할인 없이 종료
상태1회 남음2회 남음
ready35
tired13

마지막 날의 답을 먼저 구해 첫날 계산에 재사용했습니다. 이것이 뒤에서 앞으로 푸는 동적 계획법의 작은 모습입니다. 무한 기간의 문제와 달리 유한 기간에서는 남은 횟수도 값의 일부이며, 같은 물리 상태여도 날짜에 따라 최적 행동이 달라질 수 있습니다.

Suppose exactly two decisions remain, without discounting. With one decision left, the best ready score is 3 and the best tired score is 1. Practicing first in ready gives 3+(3+1)/2=5, while resting gives 1+3=4. From tired, rest gives 3 and practice gives 1.

Finite two-decision task without discounting
StateOne decision leftTwo decisions left
ready35
tired13

We solved the final decision first and reused its answer at the earlier decision. This is backward dynamic programming. Unlike a stationary infinite-horizon problem, remaining time matters in a finite horizon, and the best action in one physical state may depend on the date.

기초Foundations

8. 실습 A · 결과표의 구조부터 확인8. Lab A · Check the complete outcome table

교실 기본 표를 열어 ready/rest의 확률 합, 기대 보상, 다음 상태 분포를 확인하세요. 이어 같은 다음 상태에 서로 다른 보상을 주는 예를 넣어 기대 보상 2가 유지되는지 보세요. 마지막으로 확률 합이 틀린 행과 할인율 1을 시험해 입력 거부 이유를 구분합니다.

예측하기→한 칸 계산하기→실행하기→설명하기 순서로 진행합니다. 그래프의 화살표가 예쁘다는 사실은 전이표가 실제 자료에서 추정되었다는 증거가 아닙니다. 실시간 결과는 브라우저 JavaScript 계산이며 보관된 Python/R 실행은 같은 화면의 별도 자료입니다.

Open the classroom table and inspect the ready/rest probability total, expected reward and successor distribution. Then test different rewards for the same successor and check expected reward 2. Finally distinguish an unnormalized outcome row from discount 1, both outside this API’s input contract.

Predict, compute one entry, run and explain. A neat arrow diagram does not establish that transitions were estimated from evidence. Live results use browser JavaScript; archived Python/R executions are separate materials on the same page.

기초Foundations

9. 미래 점수의 무게를 정한다9. Choose how future rewards are weighted

할인율 γ=1/2는 내일 점수에 오늘의 절반 무게, 모레에는 1/4 무게를 준다는 뜻입니다. 시간 t의 행동 뒤 받는 보상을 R_(t+1)로 쓰면 첫 보상은 할인하지 않습니다. 1, 2, 4점을 차례로 받는 세 단계의 합은 1+(1/2)2+(1/4)4=3입니다.

G0=R1+γR2+γ2R3+⋯G_0=R_1+\gamma R_2+\gamma^2R_3+\cdots

할인율이 내일 살아남을 확률이거나 시장 이자율인 것은 이 수학 정의만으로 정해지지 않습니다. 종료 확률로 해석하는 특별한 모형도 있지만 여기서는 목표의 시간 가중치입니다. 점수의 단위와 한 단계가 하루인지 한 해인지 정해야 같은 γ를 비교할 수 있습니다.

At discount γ=1/2, tomorrow’s score receives half today’s weight and the following score one-quarter. Write R_(t+1) for the reward after action t; the first reward is undiscounted. Scores 1, 2, 4 over three stages give 1+(1/2)2+(1/4)4=3.

G0=R1+γR2+γ2R3+⋯G_0=R_1+\gamma R_2+\gamma^2R_3+\cdots

This definition alone makes γ neither a survival probability nor a market interest rate. Some special models support such interpretations; here it specifies temporal weighting in the objective. State the score units and whether one step is a day or a year before comparing discounts.

기초Foundations

10. 끝없이 더해도 유한한 이유10. Why an endless sum can remain finite

매 단계 보상의 절댓값이 M 이하이고 0≤γ<1이면 어떤 경로에서도 할인합의 절댓값은 M/(1−γ) 이하입니다. 양수 보상만 더하는 논리가 아니라 먼저 절댓값으로 상쇄 없는 상한을 만듭니다. M=3, γ=1/2이면 6이 상한입니다. 실제 가치가 반드시 6이라는 뜻은 아닙니다.

∣∑t=0∞γtRt+1∣≤∑t=0∞γt∣Rt+1∣≤M1−γ\left|\sum_{t=0}^\infty\gamma^tR_{t+1}\right|\le\sum_{t=0}^\infty\gamma^t|R_{t+1}|\le\frac{M}{1-\gamma}

유한 상태·유한 행동·유한 결과에 유한 보상을 적으면 그런 M이 존재합니다. 따라서 이 장의 기대값과 무한합을 다룰 때 필요한 유계성이 확보됩니다. 상태가 무한하거나 보상이 무한히 커질 수 있는 문제에는 같은 보장을 그대로 복사하지 않습니다.

If every reward has absolute value at most M and 0≤γ<1, every path’s discounted return has absolute value at most M/(1−γ). Take absolute values first, so the bound does not rely on positive and negative rewards canceling. With M=3 and γ=1/2 the bound is 6, not necessarily the actual value.

∣∑t=0∞γtRt+1∣≤∑t=0∞γt∣Rt+1∣≤M1−γ\left|\sum_{t=0}^\infty\gamma^tR_{t+1}\right|\le\sum_{t=0}^\infty\gamma^t|R_{t+1}|\le\frac{M}{1-\gamma}

Finite states, actions and outcomes with finite rewards supply such an M. This boundedness supports the expectation and infinite-sum arguments in this chapter. Infinite state spaces or unbounded rewards require further conditions.

기초Foundations

11. 정책은 매 상태에서 쓸 선택 규칙11. A policy is a rule for every state

정책 π는 오늘 한 번 적는 행동 목록이 아니라 어떤 상태에 있든 사용할 규칙입니다. 항상 rest와 ready에서는 practice, tired에서는 rest는 서로 다른 정상 결정론 정책입니다. 정상은 날짜와 이력에 따라 규칙을 바꾸지 않는다는 뜻이며, 상태 안에 필요한 정보를 넣었다는 전제와 연결됩니다.

무작위 정책은 상태마다 행동 확률을 줍니다. ready에서 rest 1/3, practice 2/3처럼 합이 1인 행입니다. 환경의 결과 확률과 내가 행동을 섞는 확률은 별개입니다. 혼합정책 계산에 주어진 확률을 무시하고 임의로 가장 큰 행동만 고르면 다른 정책을 평가한 것입니다.

A policy specifies a rule for every state, not just today’s action. Always rest differs from practice in ready and rest in tired. These are stationary deterministic policies: the rule does not separately vary with the date or history, assuming relevant information is included in the state.

A randomized policy supplies action probabilities in each state, such as rest 1/3 and practice 2/3 in ready. These probabilities describe the agent’s mixing, separately from environmental outcomes. Replacing a supplied mixture by its highest-scoring action evaluates a different policy.

기초Foundations

12. 미래 합에서 첫 보상을 떼어낸다12. Separate the first reward from the return

정책 π를 계속 따른다고 정하고 상태 s에서 시작한 할인합의 기대값을 Vπ(s)라고 부릅니다. 첫 보상 R1을 떼면 나머지는 γ를 한 번 곱한, 다음 상태부터의 같은 문제입니다. 다음 상태가 무엇일지 모르므로 그 상태별 가치를 전이확률로 평균합니다.

G0=R1+γG1Vπ(s)=Eπ[R1+γVπ(S1)∣S0=s]\begin{gathered}G_0=R_1+\gamma G_1\\V^\pi(s)=\mathbb E_\pi[R_1+\gamma V^\pi(S_1)\mid S_0=s]\end{gathered}

마지막 식은 조건부 기대값의 반복 법칙과 Markov·정상 정책 가정을 씁니다. G1은 실제 경로의 미래 합이고 Vπ(S1)은 그 상태를 조건으로 다시 평균한 값입니다. 무작위 실제 점수와 기대 가치를 같은 숫자로 놓은 것이 아닙니다. 이 구별이 Bellman 식을 이해하는 핵심입니다.

Fix a policy π. Its value Vπ(s) is the expected discounted return starting at s. Remove the first reward R1: the remainder is γ times the same problem starting from the next state. Since that state is uncertain, average its value under the transition law.

G0=R1+γG1Vπ(s)=Eπ[R1+γVπ(S1)∣S0=s]\begin{gathered}G_0=R_1+\gamma G_1\\V^\pi(s)=\mathbb E_\pi[R_1+\gamma V^\pi(S_1)\mid S_0=s]\end{gathered}

The final equality uses iterated conditional expectation together with the Markov and stationary-policy assumptions. G1 is a random path return, while Vπ(S1) averages remaining returns conditional on S1. We have not equated a realized random reward with its expectation.

기초Foundations

13. 정한 정책의 Bellman 기대 식13. The Bellman expectation equation

무작위 정책이라면 행동을 먼저 π(a|s)로 평균하고, 행동 뒤 결과를 p(o|s,a)로 평균합니다. 대괄호 안에는 지금의 보상과 할인한 다음 가치가 함께 있습니다. 현재 V와 다음 V가 같은 함수라는 것이 무한 정상 문제의 자기 일관성입니다.

(TπV)(s)=∑aπ(a∣s)∑op(o∣s,a){r(o)+γV(next(o))}(T_\pi V)(s)=\sum_a\pi(a\mid s)\sum_o p(o\mid s,a)\{r(o)+\gamma V(\mathrm{next}(o))\}

Vπ=TπVπ가 정책 평가의 방정식입니다. 임의의 숫자표 V에 Tπ를 한 번 적용한 것은 백업이라는 계산이며, 아직 방정식을 푼 값이라는 보장은 없습니다. 엔진은 한 번 갱신한 표와 정확히 푼 표를 다른 API로 제공합니다.

For a randomized policy, first average actions under π(a|s), then outcomes under p(o|s,a). Each bracket contains the immediate reward and discounted successor value. Reusing the same value function on both sides expresses consistency in the stationary infinite-horizon task.

(TπV)(s)=∑aπ(a∣s)∑op(o∣s,a){r(o)+γV(next(o))}(T_\pi V)(s)=\sum_a\pi(a\mid s)\sum_o p(o\mid s,a)\{r(o)+\gamma V(\mathrm{next}(o))\}

The equation Vπ=TπVπ defines policy evaluation. Applying Tπ once to an arbitrary table V is a backup, not necessarily a solution of that equation. Separate APIs expose a single update and an exactly solved value.

기초Foundations

14. 행동을 고르는 최대값이 들어간다14. Optimization introduces a maximum over actions

최적 가치는 상태 s에서 시작해 얻을 수 있는 기대 할인합의 최대값입니다. 한 행동을 고른 뒤에는 결과가 무작위이고, 결과 상태에서는 다시 적절히 선택합니다. 유한 할인 모형에서는 정상 결정론 최적 정책이 존재해 모든 상태에서 하나의 최적 가치표를 달성합니다.

(T∗V)(s)=max⁡a{rˉ(s,a)+γ∑jP(j∣s,a)V(j)},V∗=T∗V∗(T_*V)(s)=\max_a\left\{\bar r(s,a)+\gamma\sum_jP(j\mid s,a)V(j)\right\},\qquad V^*=T_*V^*

이는 이번 장의 유한·유계·0≤γ<1 조건에서의 결과입니다. 처음에는 모든 미래 전략을 비교하는 것처럼 보여도 Bellman의 자기 일관성과 축약성을 통해 같은 고정점을 구할 수 있습니다. 최대값을 구하는 행동이 여러 개이면 전부 최적 후보로 남기며, 화면의 첫 항목만 유일한 정답이라고 부르지 않습니다.

Optimal value is the largest expected discounted return attainable from a state. Choose an action before its random outcome; then choose appropriately in the successor state. In this finite discounted setting, one stationary deterministic policy attains the optimal value in every state.

(T∗V)(s)=max⁡a{rˉ(s,a)+γ∑jP(j∣s,a)V(j)},V∗=T∗V∗(T_*V)(s)=\max_a\left\{\bar r(s,a)+\gamma\sum_jP(j\mid s,a)V(j)\right\},\qquad V^*=T_*V^*

The conclusion uses finite states and actions, bounded rewards and 0≤γ<1. Bellman consistency and contraction let us find the same fixed point without explicitly listing every future strategy. Retain every maximizing action when ties occur; the first displayed choice need not be unique.

기초Foundations

15. 결과를 보기 전에 고른다는 제약15. Choose before observing the random outcome

내일 맑음·비가 각각 확률 1/2라고 합시다. 야외 행동은 맑으면 4점, 비면 0점이고, 실내 행동은 항상 1점입니다. 결과를 보기 전 최선은 야외의 기대값 2점입니다. 맑으면 야외, 비면 실내를 사후에 고르면 평균 5/2점이지만 이는 날씨를 미리 아는 다른 정보 조건입니다.

max⁡aE[Q(a,W)]≤E[max⁡aQ(a,W)]\max_a\mathbb E[Q(a,W)]\le\mathbb E[\max_a Q(a,W)]

같은 이유로 Q(s,a)는 첫 행동 a를 고정하고 이후에 따를 정책의 가치를 포함합니다. 결과별 최대값을 앞 단계로 잘못 옮기면 아직 얻지 못한 정보를 사용하는 모형이 됩니다. 순차적 정보 조회 사례에서는 언제 픽셀을 볼 수 있고 언제 예측하는지까지 상태·행동으로 적습니다.

Suppose tomorrow is dry or rainy with equal probability. An outdoor activity pays 4 if dry and 0 if rainy, while an indoor activity always pays 1. Before seeing weather, the best expectation is 2 outdoors. Choosing outdoors when dry and indoors when rainy yields 5/2, but uses advance information.

max⁡aE[Q(a,W)]≤E[max⁡aQ(a,W)]\max_a\mathbb E[Q(a,W)]\le\mathbb E[\max_a Q(a,W)]

Similarly Q(s,a) fixes the first action and includes future value afterward. Moving a maximum inside an outcome expectation can grant information unavailable at the decision. Our feature-acquisition case explicitly records when a pixel can be revealed and when prediction occurs.

기초Foundations

16. 실습 B · 한 번의 갱신을 손으로 추적16. Lab B · Trace one synchronous backup

교실 모형에서 V=(0,0), γ=1/2로 시작하면 T*V=(3,1)입니다. 그다음은 ready의 rest 1+(1/2)3=5/2, practice 3+(1/2)(3+1)/2=4를 비교합니다. tired의 rest는 2, practice는 1/2이므로 다음 표는 (4,2)입니다. 두 상태 모두 이전 표 (3,1)을 써야 합니다.

실습에서 값 한 칸을 먼저 바꾼 뒤 같은 순회 안의 다른 칸에 즉시 사용하는 방식과 구분하세요. 결과표에는 입력값, 갱신값, 모든 행동 Q, 입력점에서의 잔차와 오차 상한이 표시됩니다. 잔차가 어느 표에 속하는지 표시를 보고 설명합니다.

In the classroom model, V=(0,0) and γ=1/2 give T*V=(3,1). Next compare ready/rest 1+(1/2)3=5/2 with ready/practice 3+(1/2)(3+1)/2=4. Tired/rest gives 2 and tired/practice 1/2, producing (4,2). Both updates must use the old vector (3,1).

Distinguish this from immediately reusing a newly changed state entry within the same sweep. The lab displays input and updated values, all action Q values, and a residual and error bound belonging to the input vector. Explain which vector each quantity describes.

기초Foundations

17. 행동 혼합을 전이 행렬로 모은다17. Aggregate a policy into a transition matrix

정책을 고정하면 더 이상 행동의 최대값을 취하지 않습니다. 각 상태에서 행동 확률로 평균한 즉시 보상 rπ와 전이 행렬 Pπ를 만듭니다. Pπ의 i행 j열은 현재 i에서 다음 j로 갈 확률이며 각 행의 합은 1입니다. 값 V는 상태 순서와 같은 열벡터로 적습니다.

rπ(s)=∑aπ(a∣s)rˉ(s,a)Pπ(s,j)=∑aπ(a∣s)P(j∣s,a)Vπ=rπ+γPπVπ\begin{gathered}r_\pi(s)=\sum_a\pi(a\mid s)\bar r(s,a)\\P_\pi(s,j)=\sum_a\pi(a\mid s)P(j\mid s,a)\\V^\pi=r_\pi+\gamma P_\pi V^\pi\end{gathered}

행렬을 전치해서 곱하면 출발 상태와 도착 상태를 바꾸는 오류가 생길 수 있습니다. 교실의 항상 rest 정책은 ready에서 ready로 확률 1, tired에서 두 상태로 각각 1/2입니다. 표의 각 행을 한 문장으로 읽고 나서 곱셈을 시작하세요.

Fixing a policy removes the maximum over actions. Average immediate rewards and transitions under its action probabilities to form rπ and Pπ. Row i, column j of Pπ is the probability of moving from i to j, and every row sums to one. V is a column vector in the same declared state order.

rπ(s)=∑aπ(a∣s)rˉ(s,a)Pπ(s,j)=∑aπ(a∣s)P(j∣s,a)Vπ=rπ+γPπVπ\begin{gathered}r_\pi(s)=\sum_a\pi(a\mid s)\bar r(s,a)\\P_\pi(s,j)=\sum_a\pi(a\mid s)P(j\mid s,a)\\V^\pi=r_\pi+\gamma P_\pi V^\pi\end{gathered}

Transposing the matrix accidentally swaps departure and arrival roles. Under always rest in the classroom, ready returns to ready surely and tired goes to each state with probability 1/2. Read every row as a sentence before multiplying.

기초Foundations

18. 항상 쉬는 규칙을 직접 푼다18. Solve the always-rest policy by hand

할인율 1/2에서 항상 rest를 고릅니다. ready의 식은 x=1+x/2이므로 x=2입니다. tired의 식은 y=1+(x+y)/4입니다. x=2를 넣으면 3y/4=3/2이어서 y=2입니다. 두 값이 같다고 두 상태의 전이표까지 같다는 뜻은 아닙니다.

x=1+12x⟹x=2y=1+14x+14y⟹y=2\begin{gathered}x=1+\tfrac12x\Longrightarrow x=2\\y=1+\tfrac14x+\tfrac14y\Longrightarrow y=2\end{gathered}

결과를 원래 식에 다시 대입하면 두 상태 모두 2=2입니다. 하지만 ready에서 practice를 한 번 시도하고 다시 이 정책으로 돌아오면 3+(1/2)2=4가 됩니다. 따라서 정한 정책을 정확히 푼 것과 최적 정책을 찾은 것은 다른 성취입니다.

At discount 1/2, always rest gives ready equation x=1+x/2, so x=2. Tired satisfies y=1+(x+y)/4. Substituting x=2 gives 3y/4=3/2, hence y=2. Equal values do not imply equal transition rows.

x=1+12x⟹x=2y=1+14x+14y⟹y=2\begin{gathered}x=1+\tfrac12x\Longrightarrow x=2\\y=1+\tfrac14x+\tfrac14y\Longrightarrow y=2\end{gathered}

Substitution verifies both equations exactly. Yet practicing once in ready and then returning to this policy yields 3+(1/2)2=4. Solving a specified policy correctly is distinct from finding an optimal one.

기초Foundations

19. 연습·휴식 정책의 5점과 3점19. Values five and three for practice-and-rest

ready에서는 practice, tired에서는 rest를 고정합니다. x=3+(x+y)/4, y=1+(x+y)/4이므로 두 식을 빼면 x−y=2입니다. 합은 x+y=4+(x+y)/2여서 8입니다. 따라서 x=5, y=3입니다. 두 상태에서 가치가 다른 이유는 첫 보상의 차이이며 이후 평균 부분은 같습니다.

V=(5,3)Q(ready,rest)=7/2<5Q(tired,practice)=3/2<3\begin{gathered}V=(5,3)\\Q(\mathrm{ready},\mathrm{rest})=7/2<5\\Q(\mathrm{tired},\mathrm{practice})=3/2<3\end{gathered}

다른 행동들도 확인하니 현재 행동보다 좋지 않습니다. 그래서 T*V=V이고 이 할인 모형의 최적 고정점입니다. 한 정책을 평가한 숫자만 보고 최적이라고 결론내리지 않고, 가능한 모든 행동의 Q를 비교하는 마지막 확인까지 수행했습니다.

Fix practice in ready and rest in tired. Then x=3+(x+y)/4 and y=1+(x+y)/4. Subtract to get x−y=2; add to get x+y=4+(x+y)/2=8. Hence x=5 and y=3. Their immediate rewards differ while their subsequent expected continuation terms match.

V=(5,3)Q(ready,rest)=7/2<5Q(tired,practice)=3/2<3\begin{gathered}V=(5,3)\\Q(\mathrm{ready},\mathrm{rest})=7/2<5\\Q(\mathrm{tired},\mathrm{practice})=3/2<3\end{gathered}

Checking alternative actions confirms neither improves the value. Thus T*V=V, the optimal fixed point in this discounted model. We evaluated a candidate and then checked all actions, rather than calling the evaluated numbers optimal without justification.

심화Extension

20. 역행렬 기호가 뜻하는 실제 계산20. What the inverse-matrix expression means

정책 식을 옮기면 (I−γPπ)V=rπ입니다. I는 대각선이 1이고 나머지가 0인 항등행렬입니다. V=(I−γPπ)⁻¹rπ는 이 연립방정식의 유일한 해를 뜻합니다. 실습은 숫자 역행렬을 먼저 만들기보다 정확한 분수 소거법으로 직접 풉니다.

(I−γPπ)−1=∑k=0∞γkPπk(I-\gamma P_\pi)^{-1}=\sum_{k=0}^\infty\gamma^kP_\pi^k

이 급수가 수렴하는 이유는 Pπ의 최대 행합 노름이 1이고 γ<1이기 때문입니다. k제곱은 k단계 전이를, γ^k는 그때의 무게를 나타냅니다. 식 하나에 모든 미래 보상이 담겼습니다. γ=1이면 일반적으로 이 역행렬이 존재하지 않을 수 있으므로 같은 기호만 그대로 쓰면 안 됩니다.

Rearranging the policy equation gives (I−γPπ)V=rπ. I has ones on the diagonal and zeros elsewhere. Writing V=(I−γPπ)⁻¹rπ denotes the unique solution. The lab solves directly by exact rational elimination rather than first constructing a floating-point inverse.

(I−γPπ)−1=∑k=0∞γkPπk(I-\gamma P_\pi)^{-1}=\sum_{k=0}^\infty\gamma^kP_\pi^k

The series converges because a stochastic matrix has maximum absolute row-sum norm one and γ<1. Its kth power represents k-step transitions and γ^k gives the temporal weight. At γ=1 the inverse may fail to exist, so the same notation cannot be reused without checking assumptions.

기초Foundations

21. 동전을 섞는 정책의 가치는 평균 보상부터21. Evaluate a randomized policy through its reward

상태가 하나이고 두 행동 모두 그 상태로 돌아온다고 합시다. a는 0점, b는 2점이고, 매번 a를 확률 1/4, b를 확률 3/4로 선택합니다. 기대 보상은 3/2이고 γ=1/2이면 V=3/2+V/2를 풀어 3입니다. 항상 b를 고르면 4이므로 무작위 정책 평가와 최적화가 구분됩니다.

이 혼합은 게임 시작 때 동전 한 번으로 평생의 정책 a 또는 b를 뽑는 실험과 일반적으로 다릅니다. 여기서는 방문할 때마다 주어진 상태별 확률을 적용합니다. 정책이 숨은 이력 변수에 따라 상관된 선택을 하면 현재 상태만으로 같은 Markov 전이표를 쓰는 근거를 다시 점검해야 합니다.

Consider one state with two self-loop actions: a pays zero and b pays two. Choose a with probability 1/4 and b with probability 3/4 on each visit. Expected reward is 3/2, and at γ=1/2 the equation V=3/2+V/2 gives V=3. Always b has value 4, separating evaluation from optimization.

This stationary mixing generally differs from tossing one coin at the beginning to select an entire lifetime policy. Here the specified state-dependent probabilities apply at every visit. If choices depend on hidden, correlated history, reconsider whether the current state supports the same Markov kernel.

기초Foundations

22. 보상과 다음 상태를 함께 평균한다22. Average rewards and successor values correctly

한 행동의 두 결과가 모두 같은 다음 상태 j이지만 보상이 −2와 4, 확률이 1/3과 2/3이면 Q=2+γV(j)입니다. j로 갈 전체 확률은 1이지만 보상을 임의로 첫 행 −2로 고르면 틀립니다. 보상과 다음 상태의 결합분포를 보관하거나 정확한 기대 보상과 전이표를 따로 보관해야 합니다.

반대로 보상이 다음 상태에 따라 다른 경우에도 먼저 전체 기대 보상을 구한 뒤 전이 가치를 더할 수 있습니다. 기대값의 선형성 때문이며 보상과 다음 상태의 독립이 필요하지 않습니다. 독립 가정을 불필요하게 붙이지 않고도 되는 계산인지 식을 보고 판단하세요.

If an action reaches the same successor j with reward −2 at probability 1/3 or reward 4 at probability 2/3, its Q value is 2+γV(j). Total successor probability one does not justify keeping only the first reward. Preserve the joint outcome law or aggregate expected rewards and transitions correctly.

Even when rewards differ by successor, the expected immediate reward and expected continuation value may be added separately. This uses linearity of expectation, not independence between reward and successor. Distinguish a necessary modeling assumption from an unnecessary one.

기초Foundations

23. 식을 푼 뒤 잔차의 뜻을 나눈다23. Distinguish equation residuals after solving

선형계 잔차는 (I−γPπ)V−rπ가 얼마나 0에서 벗어났는지입니다. 정책 Bellman 잔차는 TπV−V입니다. 정확한 정책 해라면 둘 다 0입니다. 최적성 잔차 T*V−V는 다를 수 있습니다. 항상 rest의 V=(2,2)는 정책 잔차 0이지만 최대노름 최적성 잔차는 2입니다.

잔차가 0이라는 말을 할 때 어느 방정식인지 적어야 합니다. 보상표를 잘못 입력해도 그 잘못된 표에 대한 선형계 잔차는 0일 수 있습니다. 계산의 내부 일관성, 원자료와의 일치, 문제 설정의 적절성은 각각 확인할 과제입니다.

The linear-system residual measures deviation of (I−γPπ)V−rπ from zero. The policy Bellman residual measures TπV−V. Both vanish for the exact policy value. The optimality residual T*V−V can remain nonzero: always-rest value (2,2) has policy residual zero but optimality sup-norm residual two.

Whenever reporting a zero residual, name the equation. Incorrectly entered rewards may still yield zero residual for that incorrect model. Internal arithmetic consistency, agreement with original records and the suitability of the model are separate checks.

기초Foundations

24. 실습 C · 정책을 바꾸며 정확한 값 확인24. Lab C · Change a policy and solve its value

항상 rest를 평가해 (2,2)를 확인하고 ready의 행동만 practice로 바꾸어 (5,3)을 확인합니다. 이어 한 상태의 행동을 1/3과 2/3으로 섞어 보세요. 표에서 정책 확률, 평균 전이, 평균 보상, 해, 정책 잔차, 최적성 잔차를 차례로 연결합니다.

점수 기대값의 소수 표시만 비교하지 말고 정확한 분수와 원래 방정식 대입 결과도 확인합니다. 결과가 커졌다면 어느 상태의 전이 또는 즉시 보상이 달라졌는지 설명하세요. 선언한 정책의 가치가 모든 상태에서 최적인지 여부는 별도 표지가 보여 줍니다.

Evaluate always rest to obtain (2,2), then switch ready to practice to obtain (5,3). Next mix one state’s actions with probabilities 1/3 and 2/3. Connect policy probabilities, averaged transitions, averaged rewards, solution and the two different Bellman residuals.

Inspect exact fractions and substitution into the original equations alongside decimal displays. If a value rises, explain the changed immediate reward or transition. A separate indicator checks whether this policy is exactly optimal in every declared state.

기초Foundations

25. 여러 칸의 오차를 한 숫자로 잰다25. Measure a value-table error by its largest entry

두 가치표 U=(5,3), V=(4.8,3.4)를 비교하면 칸별 차이는 0.2와 −0.4입니다. 최대노름은 절댓값 중 가장 큰 0.4입니다. 차이를 그냥 더한 −0.2는 오차가 서로 지워져 가장 틀린 칸을 숨깁니다. 확률 가중평균 오차와도 다른 기준입니다.

∥U−V∥∞=max⁡s∣U(s)−V(s)∣\|U-V\|_\infty=\max_s|U(s)-V(s)|

상태가 유한하면 이 숫자가 작다는 것은 모든 상태의 오차가 작다는 뜻입니다. 보상의 단위를 두 배로 바꾸면 값과 최대노름 오차도 두 배가 됩니다. 실습의 허용 오차는 확률 단위가 아니라 가치 점수 단위입니다.

Compare U=(5,3) with V=(4.8,3.4). Entry differences are 0.2 and −0.4, so the sup norm is 0.4. Adding signed differences would allow cancellation and hide the worst entry. This is also different from a probability-weighted mean error.

∥U−V∥∞=max⁡s∣U(s)−V(s)∣\|U-V\|_\infty=\max_s|U(s)-V(s)|

With finitely many states, a small sup norm bounds every state’s error. Doubling reward units doubles values and their absolute errors. The lab’s tolerance therefore has value-score units, not probability units.

기초Foundations

26. 최대값의 차이를 묶는 작은 부등식26. A small inequality controls differences of maxima

행동별 값이 u_a와 v_a이고 모든 행동에서 |u_a−v_a|≤d라면 u_a≤v_a+d≤max_b v_b+d입니다. 모든 a 중 최대를 취해도 같은 상한입니다. u와 v를 바꾸어 한 번 더 쓰면 최대값 두 개의 절댓값 차이가 d 이하임을 얻습니다.

∣max⁡aua−max⁡ava∣≤max⁡a∣ua−va∣\left|\max_a u_a-\max_a v_a\right|\le\max_a|u_a-v_a|

최대 행동이 두 표에서 달라도 성립합니다. ready에서 U가 practice를, V가 rest를 고르더라도 괜찮습니다. 최적 행동이 바뀌는 지점에서 미분 가능성을 가정하지 않고도 가치 반복의 오차를 다룰 수 있는 이유입니다.

If |u_a−v_a|≤d for every action, then u_a≤v_a+d≤max_b v_b+d. Taking the maximum over a preserves the bound. Reverse u and v to obtain the absolute difference bound.

∣max⁡aua−max⁡ava∣≤max⁡a∣ua−va∣\left|\max_a u_a-\max_a v_a\right|\le\max_a|u_a-v_a|

The maximizing action may differ between the two tables. No differentiability at an action switch is needed. This inequality therefore handles value-iteration error even where the greedy action changes.

심화Extension

27. 한 번 갱신하면 차이는 γ배 이하27. One backup shrinks differences by at most gamma

같은 모형에 U와 V를 넣어 비교하면 즉시 보상은 빼면서 사라집니다. 남는 것은 γ를 곱한 전이 가중평균의 차이입니다. 확률은 비음수이고 합이 1이라 모든 칸의 차이를 최대 차이 하나로 바꾸어도 더 작아지지 않습니다. 앞 절의 최대값 부등식을 마지막으로 연결합니다.

∥T∗U−T∗V∥∞≤γmax⁡s,a∑jP(j∣s,a)∣U(j)−V(j)∣≤γ∥U−V∥∞.\begin{aligned}\|T_*U-T_*V\|_\infty&\le\gamma\max_{s,a}\sum_jP(j\mid s,a)|U(j)-V(j)|\\&\le\gamma\|U-V\|_\infty.\end{aligned}

정한 정책 Tπ도 행동 확률까지 평균하므로 같은 상한을 만족합니다. γ=1/2이면 서로 4점 차이나던 두 표는 같은 작용소 한 번 뒤 최대 2점 차이입니다. γ=0이면 미래 값이 사라져 어떤 시작 표에서도 같은 한 단계 최선 보상표로 갑니다.

Compare U and V under the same model. Immediate rewards cancel, leaving γ times a probability-weighted difference of continuation values. Nonnegative probabilities summing to one let us bound every entry difference by the largest one. Combine this with the preceding maximum inequality.

∥T∗U−T∗V∥∞≤γmax⁡s,a∑jP(j∣s,a)∣U(j)−V(j)∣≤γ∥U−V∥∞.\begin{aligned}\|T_*U-T_*V\|_\infty&\le\gamma\max_{s,a}\sum_jP(j\mid s,a)|U(j)-V(j)|\\&\le\gamma\|U-V\|_\infty.\end{aligned}

A fixed-policy operator Tπ satisfies the same bound after averaging actions. At γ=1/2, tables initially four points apart become at most two points apart after one common backup. At γ=0, continuation values disappear and every starting table maps to the same one-step optimum.

심화Extension

28. MATH22의 축약과 유일한 고정점28. A unique fixed point through contraction

유한 상태의 실수 가치표 공간은 최대노름에서 완비입니다. 가까워지는 표들의 극한도 같은 공간에 남는다는 뜻입니다. 축약계수 γ<1인 T*를 반복하면 어디서 시작해도 유일한 고정점으로 수렴합니다. MATH22의 축약 사상을 지금 가치표에 적용한 것입니다.

∥Vk−V∗∥∞≤γk∥V0−V∗∥∞\|V_k-V^*\|_\infty\le\gamma^k\|V_0-V^*\|_\infty

두 고정점 U,V가 있다면 차이가 자기 자신의 γ배 이하이므로 차이는 0일 수밖에 없습니다. 존재는 반복열이 Cauchy가 되고 완비성으로 극한을 얻는 논리로 확보합니다. 고정점에서 최대 행동을 상태별로 하나씩 고르면 그 정책의 기대 식도 만족하므로 최적 정책의 가치입니다.

Real value vectors over finitely many states form a complete space under the sup norm: Cauchy sequences remain inside this space. Repeatedly applying a contraction T* with γ<1 converges from any finite starting vector to its unique fixed point. This applies the contraction theorem from MATH22 to value tables.

∥Vk−V∗∥∞≤γk∥V0−V∗∥∞\|V_k-V^*\|_\infty\le\gamma^k\|V_0-V^*\|_\infty

Two fixed points would have a distance at most γ times itself, forcing distance zero. Existence follows because the iterates are Cauchy and completeness supplies a limit. Selecting a maximizing action at each fixed-point state also satisfies that policy’s expectation equation, yielding its optimal value.

기초Foundations

29. 0에서 시작한 반복과 남은 꼬리29. Zero initialization and the remaining tail

V0=0으로 시작하면 Vk는 k번 결정한 뒤 끝나는 할인 문제의 최적 가치입니다. 첫 k개 보상 뒤 남은 경로의 절댓값 합은 γ^k M/(1−γ) 이하이므로 무한 문제와의 차이도 그 이하입니다. 임의의 초기 V0에서는 유한 기간 뒤의 말단 보상을 V0로 정한 문제로 해석해야 합니다.

V0=0⟹∥Vk−V∗∥∞≤γkM1−γV_0=0\quad\Longrightarrow\quad\|V_k-V^*\|_\infty\le\frac{\gamma^kM}{1-\gamma}

γ=1/2, M=3이면 k=4에서 상한은 3/8입니다. 느슨한 공통 상한이므로 실제 오차가 더 작을 수 있습니다. γ가 1에 가까우면 과거의 오차를 천천히 줄이고 먼 미래의 꼬리도 커집니다. 같은 반복 횟수가 같은 정확도를 뜻하지 않는 이유입니다.

Starting with V0=0, Vk is the optimal value with exactly k decisions before termination. The absolute remaining return is bounded by γ^k M/(1−γ), which also bounds the infinite-horizon value difference. An arbitrary initial V0 instead acts as a terminal payoff at the end of the finite horizon.

V0=0⟹∥Vk−V∗∥∞≤γkM1−γV_0=0\quad\Longrightarrow\quad\|V_k-V^*\|_\infty\le\frac{\gamma^kM}{1-\gamma}

For γ=1/2, M=3 and k=4, the bound is 3/8. It may be loose. A discount near one reduces errors more slowly and leaves a larger distant tail. Equal iteration counts therefore need not mean equal accuracy.

심화Extension

30. 정답을 몰라도 오차 상한을 계산한다30. Bound error without already knowing the answer

실제 V*를 모르더라도 δ=||T*V−V||∞는 현재 표로 계산할 수 있습니다. 삼각부등식과 축약성을 쓰면 ||V−V*||≤δ+γ||V−V*||입니다. 왼쪽으로 옮기면 오차는 δ/(1−γ) 이하입니다. 이것이 실습의 멈출 기준입니다.

∥V−V∗∥∞≤∥T∗V−V∥∞1−γ\|V-V^*\|_\infty\le\frac{\|T_*V-V\|_\infty}{1-\gamma}

γ=0.9에서 잔차 0.01이면 가치 오차 상한은 0.1입니다. 잔차 자체를 가치 오차 0.01이라고 부르면 10배 작게 보고합니다. 갱신한 새 표를 보고하면서 옛 표의 잔차를 붙이지 않도록 매번 보고할 표에서 다시 계산합니다. 상한이 작다는 것과 추출 정책이 정확한 최적 정책이라는 것은 별도 주장입니다.

Even without V*, the current table gives δ=||T*V−V||∞. The triangle inequality and contraction imply ||V−V*||≤δ+γ||V−V*||. Rearranging yields the lab’s stopping bound.

∥V−V∗∥∞≤∥T∗V−V∥∞1−γ\|V-V^*\|_\infty\le\frac{\|T_*V-V\|_\infty}{1-\gamma}

At γ=0.9, residual 0.01 bounds value error by 0.1. Reporting the residual itself as a 0.01 value-error bound understates it tenfold. Recompute the residual for the vector being reported. A small value-error bound alone does not certify an exactly optimal extracted policy.

기초Foundations

31. 같은 이전 표로 모든 칸을 갱신31. Update every state from the same old table

동기식 반복은 새 배열을 따로 만들고 이전 배열에서만 다음 상태의 가치를 읽습니다. 교실에서는 0→(3,1)→(4,2)→(4.5,2.5)로 갑니다. 첫 갱신의 ready=3을 바로 tired 계산에 쓰면 첫 표부터 달라집니다. 비동기 갱신도 별도 조건에서 수렴할 수 있지만 같은 순회 결과라고 주장할 수는 없습니다.

반복 횟수 제한 0은 오류가 아닙니다. 초기 표를 그대로 보고하며 그 초기점의 잔차와 상한을 계산합니다. 허용 오차 0은 정확한 고정점에 도달할 때만 충족합니다. 일반 할인 반복은 극한에서만 정확히 도달할 수 있으므로 무한히 기다리게 하지 않고 계산 횟수와 자원 제한을 둡니다.

Synchronous iteration builds a new array using only the previous one. The classroom sequence is 0→(3,1)→(4,2)→(4.5,2.5). Reusing ready=3 immediately inside the first tired update changes that sweep. Asynchronous methods can converge under additional conditions, but their intermediate results need not match.

An update cap of zero is valid: report the initial vector and its own residual and bound. Tolerance zero requires an exact fixed point, which discounted iteration may reach only in the limit. Finite computation and resource caps prevent an endless wait.

기초Foundations

32. 실습 D · 반복 수보다 오차 기준32. Lab D · Read error bounds, not just iteration counts

먼저 γ=1/2에서 0, 1, 3회 제한을 비교하고 초기값·완료 갱신 수·현재 잔차를 기록하세요. 이어 허용 오차를 1/1000으로 정합니다. 교실에서는 12회 뒤 (5119/1024,3071/1024)이고 상한 1/1024가 1/1000보다 작습니다. 정확한 (5,3)과 실제 차이를 비교하세요.

할인율을 0.9로 올린 뒤 같은 반복 제한이 충분한지 확인합니다. 그래프의 선이 평평해 보이는 것과 엄밀한 잔차 기준을 구분하세요. 자원 제한에 걸리면 결과를 완료로 위장하지 않고 거부를 표시하며, 보관 실행은 정해진 설정만 재현합니다.

Compare update caps 0, 1 and 3 at γ=1/2, recording the initial vector, completed updates and current residual. Then use tolerance 1/1000. After 12 classroom updates the vector is (5119/1024,3071/1024), with bound 1/1024 below 1/1000. Compare its actual error against (5,3).

Raise the discount to 0.9 and ask whether the same cap suffices. A visually flat curve is not a rigorous residual criterion. Resource exhaustion is reported as rejection, not successful completion; archived runs reproduce only their stated fixed settings.

심화Extension

33. 좋아 보이는 한 행동이 정책 개선이 되는 이유33. Why greedy improvement improves a policy

먼저 현재 정책 π의 정확한 Vπ를 풉니다. 그 값에서 Q를 비교해 더 큰 행동을 상태별로 고른 정책을 π′라고 합시다. 그러면 Tπ′Vπ≥TπVπ=Vπ입니다. 확률과 γ가 비음수라 Tπ′는 순서를 보존합니다. 반복 적용해도 값이 내려가지 않고 그 정책의 고정점 Vπ′로 수렴합니다.

Tπ′Vπ≥Vπ⟹Vπ′≥VπT_{\pi^{\prime}}V^\pi\ge V^\pi\quad\Longrightarrow\quad V^{\pi^{\prime}}\ge V^\pi

이는 현재 Vπ가 정확하고 같은 할인 모형을 쓰는 경우의 증명입니다. 추정이 큰 오차를 가진 Q에서 가장 큰 수를 고르는 것에 같은 보장을 즉시 붙일 수는 없습니다. 실제 강화학습의 학습 오차·탐험 문제는 다음 장에서 따로 다룹니다.

First solve the current policy value Vπ exactly. Choose a maximizing action at each state using its Q values to form π′. Then Tπ′Vπ≥TπVπ=Vπ. Nonnegative probabilities and γ make Tπ′ order-preserving, so repeated application cannot decrease values and converges to Vπ′.

Tπ′Vπ≥Vπ⟹Vπ′≥VπT_{\pi^{\prime}}V^\pi\ge V^\pi\quad\Longrightarrow\quad V^{\pi^{\prime}}\ge V^\pi

The proof uses an exact current policy value and the same discounted model. Greedy choices from noisy estimated Q values do not automatically inherit this guarantee. Learning error and exploration belong to the next chapter.

기초Foundations

34. 같은 값이면 현재 행동을 유지한다34. Keep the current action when it is tied for best

두 행동의 Q가 정확히 같으면 임의로 바꾸는 것이 가치 향상을 뜻하지 않습니다. 실습의 정책 반복은 현재 행동이 최대값 집합에 있으면 유지합니다. 현재 행동이 최대가 아닐 때만 선언 순서의 첫 최대 행동으로 바꿉니다. 이 규칙은 매번 서로 다른 동률 행동을 골라 정책 이름만 왔다 갔다 하는 일을 막습니다.

최종 결과에는 모든 최대 행동도 남깁니다. 유일성은 정책이 아니라 가치표에 대한 보장입니다. 같은 최적 가치표를 달성하는 정책은 여러 개일 수 있고, 최고 Q가 같은 상태에서 다른 행동을 택해도 최적일 수 있습니다. 소수 둘이 같아 보여도 정확한 분수가 다르면 동률이 아닙니다.

Changing between actions with exactly equal Q values does not improve value. Our policy iteration keeps the current action whenever it belongs to the maximizing set. Otherwise it selects the first declared maximizer. This avoids artificial cycling caused only by alternating names among tied choices.

All maximizing actions remain visible. The uniqueness guarantee concerns the value function, not the policy: several policies can attain the same optimal value. Identical decimal displays are not sufficient for an exact tie when underlying fractions differ.

기초Foundations

35. 평가한 정책과 다음 후보를 분리한다35. Separate the evaluated policy from its next candidate

교실에서 항상 rest를 한 번 평가하면 값은 (2,2)입니다. 개선 결과는 ready/practice, tired/rest이지만 아직 그 새 정책을 평가하지 않았다면 (2,2)를 새 정책의 가치라고 쓰면 안 됩니다. 그 정책의 정확한 값은 다음 평가의 (5,3)입니다. 한 번 제한 결과는 평가 정책·그 값·다음 미평가 후보를 따로 보여 줍니다.

평가 횟수 제한 0이면 평가한 정책도 값도 없습니다. 시작 정책이라는 후보만 있습니다. 제한 때문에 멈춘 상태와 정책이 더 바뀌지 않아 최적성을 확인한 상태는 다른 상태 표지입니다. 결과의 일부가 존재한다는 사실만으로 완성된 최적 정책을 얻었다고 부르지 않습니다.

One evaluation of always rest gives (2,2). Improvement proposes practice in ready and rest in tired, but those old values do not yet evaluate the new policy. Its exact values (5,3) arrive in the next evaluation. A one-evaluation cap therefore reports the evaluated policy, its values and a separate unevaluated candidate.

At cap zero, no policy has been evaluated and no value is fabricated. Only the starting candidate exists. Stopping at a cap differs from certifying a policy stable and optimal. Partial information should retain its correct status.

심화Extension

36. 정책은 유한하지만 계산이 공짜는 아니다36. Finite policies do not make computation free

상태마다 가능한 행동 수를 곱하면 정상 결정론 정책의 수입니다. 두 상태에 두 행동씩이면 4개입니다. 정확한 평가와 동률 유지 규칙에서는 정책이 바뀔 때 적어도 한 상태에서 개선되므로 예전 정책으로 되돌아갈 수 없습니다. 유한 정책 집합에서 결국 안정 정책에 도달합니다.

하지만 상태마다 행동이 많으면 정책 수가 빠르게 커지고 각 평가에도 연립방정식 풀이가 필요합니다. 가치 반복이 한 번 단순하다는 것과 전체 계산이 항상 더 빠르다는 것은 다릅니다. 정책 반복도 모든 문제에서 일정 횟수 안에 끝난다고 과장하지 않고, 실습은 평가 횟수와 분수 크기·작업량 제한을 따로 둡니다.

Multiplying available action counts gives the number of stationary deterministic policies: two actions in each of two states give four policies. Exact evaluation and stable tie handling ensure that a changed policy improves at least one state, so a previous policy cannot recur. Finitely many policies imply eventual stability.

The policy count can still grow rapidly, and every evaluation solves a linear system. A cheap value-iteration sweep does not guarantee a cheaper complete run. Neither method receives a universal small iteration count; the lab caps evaluations, rational size and work separately.

기초Foundations

37. 보상 단위와 기준점을 바꾸면37. Changing reward units and baselines

모든 결과 보상을 같은 양수 c배 하면 정책별 가치와 Q도 c배가 되어 최적 행동은 유지됩니다. 단위를 1점에서 100점으로 바꾸어도 상대 선택은 같습니다. 반면 특정 행동의 비용만 바꾸면 상대값이 달라져 정책이 바뀔 수 있습니다. 실제 사례의 비용 슬라이더는 이 차이를 살펴보는 장치입니다.

r′=cr, c>0⇒Vπ′=cVπ;r′=r+b⇒Vπ′=Vπ+b1−γr^{\prime}=cr,\ c>0\Rightarrow V^{\pi\prime}=cV^\pi;\qquad r^{\prime}=r+b\Rightarrow V^{\pi\prime}=V^\pi+\frac{b}{1-\gamma}

두 번째 등식은 종료 뒤를 포함한 모든 무한 단계의 보상에 같은 b를 더할 때입니다. 종료 보상 0을 그대로 두고 살아 있는 동안에만 b를 주면 길이에 따른 선호가 달라질 수 있습니다. 조건을 생략한 보상 변환 규칙은 조기 종료를 유도하거나 늦추는 다른 문제를 만들 수 있습니다.

Multiplying every outcome reward by the same positive c scales every policy value and Q value by c, preserving optimal actions. Changing only one action’s cost can change relative values and the policy. Cost controls in the actual-data cases explore that sensitivity.

r′=cr, c>0⇒Vπ′=cVπ;r′=r+b⇒Vπ′=Vπ+b1−γr^{\prime}=cr,\ c>0\Rightarrow V^{\pi\prime}=cV^\pi;\qquad r^{\prime}=r+b\Rightarrow V^{\pi\prime}=V^\pi+\frac{b}{1-\gamma}

The second identity adds b at every infinite step, including absorbing post-termination steps. Keeping terminal reward zero while adding b only during active steps can change preferences over termination time. Always state the conditions of a reward transformation.

기초Foundations

38. 할인율 1은 다른 조건을 살핀다38. Discount one requires a different guarantee

한 상태에서 매번 1점을 주고 γ=1이면 총합은 무한대입니다. 매번 0점이면 V=V라는 식을 어떤 상수도 만족해 고정점이 유일하지 않습니다. 이것만으로 유한 할인 문제의 증명을 γ=1에 그대로 옮길 수 없음을 보입니다. 실습 API는 할인율 1을 이 계약 밖으로 거부합니다.

반면 정확히 두 번 선택하고 끝나는 앞의 유한 기간 문제는 γ=1이어도 잘 정의됩니다. 종료가 적절하게 보장되는 확률적 최단 경로, 평균 보상 기준 등도 각각 다른 조건과 방정식을 씁니다. 할인 API가 거부한다는 말과 모든 무할인 결정 문제가 불가능하다는 말은 다릅니다. 무한 상태·유계가 아닌 보상 역시 추가 이론을 확인해야 합니다.

A one-state self-loop paying one at γ=1 has infinite total reward. With zero reward instead, every constant solves V=V, so uniqueness fails. These examples prevent transferring the discounted proof unchanged to γ=1. Our API rejects discount one as outside its contract.

The earlier two-decision finite-horizon task is nevertheless well-defined at γ=1. Properly terminating stochastic shortest-path models and average-reward criteria have their own assumptions and equations. An API rejection does not make every undiscounted problem impossible. Infinite states or unbounded rewards likewise require additional theory.

기초Foundations

39. 보이는 정보가 상태 전체가 아닐 때39. When an observation is not the full state

교실에서 ready/tired를 정확히 안다고 가정했습니다. 실제로는 학생의 표정만 보거나 건강 상태를 완전히 모르기 쉽습니다. 관측을 진짜 상태처럼 놓고 표 하나를 적용하면 정보 부족을 숨길 수 있습니다. AI04의 믿음 분포를 상태로 삼는 POMDP 접근이 이어지지만 그 믿음 공간은 일반적으로 연속이라 이 장의 작은 유한 엔진과 다릅니다.

손글씨 사례에서는 이미 확인한 픽셀의 값 전체를 상태에 보관합니다. 같은 관측 상태를 두 경로로 얻어도 남은 기록의 조건부 집합이 같도록 설계했습니다. 한 픽셀만 남기고 전에 본 다른 픽셀을 잊어버리면 조건부 예측이 달라져 상태 정의를 다시 해야 합니다.

We assumed ready and tired were fully observed. Real decisions may rely on facial expressions or incomplete health information. Treating an observation as the full state can hide this information gap. POMDPs can use an AI04 belief distribution as a state, but that belief space is generally continuous and exceeds this small finite engine.

The handwriting case remembers all revealed pixel values. Reaching the same observation state along different paths then retains the same conditional record set. Forgetting a previously revealed pixel can alter that set and invalidate the chosen state representation.

기초Foundations

40. 실습 E · 평가와 개선을 번갈아40. Lab E · Alternate evaluation and improvement

시작 정책을 항상 rest로 두고 평가 제한 1을 실행합니다. 평가 정책 (rest,rest), 값 (2,2), 다음 후보 (practice,rest)를 적어 둡니다. 제한을 2로 바꾸면 (5,3)을 평가하고 같은 후보가 유지되는지 확인합니다. 이어 두 행동의 보상이 같은 모형에서 시작 행동을 바꾸어 동률 유지 규칙을 봅니다.

가치 반복과 정책 반복의 최종 값이 맞는지 비교하되, 서로 다른 중간 단계 번호를 같은 의미로 읽지 않습니다. 한쪽은 동기식 갱신 횟수이고 다른 쪽은 정확한 정책 평가 횟수입니다. 결과표가 정책의 이름과 값의 소유 관계를 어떻게 보존하는지도 설명하세요.

Start with always rest and cap evaluations at one. Record evaluated policy (rest,rest), values (2,2) and next candidate (practice,rest). At cap two, check values (5,3) and policy stability. Then test equal-reward actions with different starting choices to inspect the keep-current tie rule.

Compare final values from value iteration and policy iteration without equating their step numbers: one counts synchronous updates, the other exact policy evaluations. Explain how the output preserves the association between a policy and its own values.

기초Foundations

41. 국가 사례 · 26개 GDP값에서 24개 전이41. Country case · Twenty-six GDP values give twenty-four band transitions

보관한 World Bank 원본에서 한국의 1999~2024년 1인당 실질 GDP 26개를 새로 읽었습니다. 단위는 constant 2015 US$입니다. 인접 값의 비율로 2000~2024년 성장률 25개를 계산합니다. 인구 전체의 GDP 성장률과 다른 1인당 수치이며, 명목 달러 환율 변화를 그대로 보여 주는 자료도 아닙니다.

gt=100(GDPpctGDPpct−1−1)g_t=100\left(\frac{\mathrm{GDPpc}_t}{\mathrm{GDPpc}_{t-1}}-1\right)

성장률 2% 이상을 fast, 미만을 slow로 정하면 fast 20년, slow 5년입니다. 25개 밴드의 인접 쌍은 24개이며 slow→slow 2, slow→fast 2, fast→slow 3, fast→fast 17입니다. 마지막 2024년은 뒤의 관측 연도가 없어 출발 쌍에 포함되지 않으므로 단순 밴드 수와 전이 행 분모가 다릅니다.

We freshly read 26 retained original World Bank values for Korean GDP per capita in constant 2015 US dollars, covering 1999–2024. Adjacent ratios yield 25 annual growth rates for 2000–2024. Per-capita real growth is different from total GDP growth and from movements in nominal dollar exchange values.

gt=100(GDPpctGDPpct−1−1)g_t=100\left(\frac{\mathrm{GDPpc}_t}{\mathrm{GDPpc}_{t-1}}-1\right)

A chosen threshold of at least 2% gives 20 fast years and five slow years. Their 24 adjacent pairs have counts slow→slow 2, slow→fast 2, fast→slow 3, fast→fast 17. The final 2024 band has no observed following year, so band totals and outgoing-pair denominators differ.

기초Foundations

42. 가정한 지원 행동을 실제 정책 효과로 읽지 않는다42. Do not read hypothetical support as an estimated policy effect

관측 행을 정규화하면 slow에서 fast는 2/4=1/2, fast에서 fast는 17/20입니다. 이 표를 계속 반복되는 Markov 전이로 쓰는 것이 첫 가정입니다. 지원 행동은 slow로 갈 질량의 1/5을 fast로 옮긴다고 가정합니다. 두 fast 확률은 3/5와 22/25가 되지만 실제 지원사업의 인과 효과를 추정한 것이 아닙니다.

실제 수치·전처리·행동 가정을 분리한 표
구성요소수치성격
기준 전이1/2, 17/20관측 인접 쌍 비율
성장 보상0.971, 3.922밴드별 관측 평균을 소수3자리 반올림
지원 질량 이동slow 목적지 질량의1/5가정한 행동 효과
지원 비용1/2선택한 점수 비용

보상은 도착 밴드의 관측 평균 성장을 한 번 반올림한 대용 점수입니다. 사회 후생이나 정책 성과가 아닙니다. 기본 비용에서 두 상태 모두 baseline이 최적이어도 현실에서 지원이 무익하다는 결론은 아닙니다. 관측하지 못한 행동 효과와 비용을 바꾸면 모형의 답도 달라집니다.

Normalizing observed pairs gives fast-destination probabilities 2/4=1/2 from slow and 17/20 from fast. Repeating this as a stationary Markov kernel is an assumption. A support action is assumed to redirect one-fifth of slow-destination mass to fast, producing probabilities 3/5 and 22/25. No causal support-program effect was estimated.

Separate observed values, preprocessing and decision assumptions
ComponentValueStatus
Baseline transitions1/2, 17/20Observed adjacent-pair ratios
Growth rewards0.971, 3.922Observed band means rounded to 3 decimals
Support shift1/5 of slow-destination massAssumed action effect
Support cost1/2Chosen score cost

Rewards proxy destination-band mean growth after explicit rounding, not welfare or policy impact. Baseline is optimal in both states at default costs, but that is not evidence that real support is useless. Different unobserved action effects and chosen costs change the modeled answer.

기초Foundations

43. 개인 자료 · 픽셀을 언제 볼지 결정한다43. Individual record · Decide when to reveal a pixel

UCI optdigits의 제공 test 1797행에서 실제 라벨과 픽셀 18,45의 원래 값을 새로 읽었습니다. 여기서 18과 45는 64개 입력 필드를 0부터 센 인덱스로, CSV 열 순서로는 19번째와 46번째 입력입니다. 기록 강도 0~16에서 8 이상을 ink로 정합니다. 두 밴드의 도수는 pale/pale 295, pale/ink 283, ink/pale 462, ink/ink 757입니다. 모든 값을 이미 자료 파일에는 갖고 있지만, 가상 의사결정자는 처음에는 보지 못하게 설정합니다.

처음 unknown에서 한 픽셀을 공개하거나 바로 숫자 0~9 중 하나를 예측할 수 있습니다. 공개 후에는 이미 본 모든 픽셀을 상태에 남깁니다. 두 픽셀을 본 네 상태, 한 픽셀만 본 네 상태, 처음 상태와 terminal을 합해 10상태입니다. 공개 확률은 남은 실제 기록의 조건부 도수이며 예측하면 정답 1점·오답 0점 뒤 종료합니다.

We freshly read labels and original pixels 18 and 45 from all 1,797 provided test records in UCI optdigits. Indices 18 and 45 count the 64 input fields from zero, so they select the 19th and 46th input columns. Intensity at least 8 on the recorded 0–16 scale is called ink. Joint pale/pale, pale/ink, ink/pale and ink/ink counts are 295, 283, 462 and 757. The file contains all values, but our hypothetical decision maker initially cannot see them.

From unknown it may reveal a pixel or predict one of digits 0–9. Every revealed field remains in the state. Four one-pixel states, four two-pixel states, unknown and terminal give ten states. Reveal probabilities use conditional counts among remaining records. A prediction earns one if correct and zero otherwise, then terminates.

기초Foundations

44. 정보의 이익과 비용을 같은 시점에 둔다44. Put information benefits and costs on the correct timeline

두 픽셀이 ink인 757행에서는 실제 라벨 0이 149행으로 가장 많아 즉시 예측 성공 비중은 149/757입니다. 처음 아무것도 보지 않고 예측하면 가장 많은 라벨 3의 183/1797을 사용합니다. 이것은 이미 확인한 보관 기록 안의 적중 비중이며 새로운 손글씨에 대한 평가가 아닙니다.

공개 비용은 한 번에 1/50점, γ=9/10으로 가정합니다. 공개하면 지금 비용을 내고 다음 단계 예측의 점수는 할인됩니다. 기본 모형의 unknown 가치는 52069/299500입니다. 비용을 0이나 크게 바꾸고 최적 공개 순서·즉시 예측 선택을 비교하세요. 정보가 많아질 수 있다는 사실만으로 비용이 큰 조회가 항상 이득인 것은 아닙니다.

Among the 757 both-ink records, digit zero is most common with 149 rows, giving immediate empirical prediction success 149/757. With no fields revealed, digit three is most common with 183/1797. These are hit fractions within inspected retained records, not evaluation on new handwriting.

Assume inspection cost 1/50 and discount 9/10. Revealing a field incurs its cost now and delays a prediction reward by one discounted step. The default unknown-state value is 52069/299500. Change the cost to zero or a larger amount and compare revealing with predicting immediately. More information need not justify an expensive query.

기초Foundations

45. 기업 사례 · 실제 주문 수량으로 처리 대기열45. Company case · A workload queue using actual order quantities

UCI Online Retail 원본 첫 송장 536365의 일곱 줄을 새로 읽으면 수량은 6,6,8,6,6,2,6입니다. 상품 종류가 서로 다르므로 같은 재고 상품으로 취급하지 않습니다. 대신 2개를 한 노동 배치로 보는 교육 가정 아래 작업량 3,3,4,3,3,1,3을 만듭니다. 실제 송장일·가격·상품 식별자는 원래 필드와 함께 내려받는 표에 보존합니다.

대기 배치 수는 0~4, 선택한 처리 능력도 0~4입니다. 먼저 min(대기,능력)을 처리한 뒤 새 작업량이 오고, 4를 넘은 양은 초과로 기록합니다. 다음 작업이 일곱 줄 중 균등 추출되어 매번 독립이라는 법칙은 가정입니다. 처리 1배치당 3점, 선택 능력 비용 1점, 초과 벌점 1/2, 남은 대기 비용 1/10 역시 교육 점수이지 파운드 매출·이윤이 아닙니다.

Freshly reading the seven lines of first UCI Online Retail invoice 536365 gives quantities 6,6,8,6,6,2,6. Different products are not treated as fungible inventory. Instead, a chosen two-items-per-labor-batch equivalence gives workloads 3,3,4,3,3,1,3. Downloadable rows preserve original dates, prices and product identifiers.

Backlog and chosen capacity each range from zero to four. Serve min(backlog,capacity), then add an arrival, cap retained backlog at four and record overflow. IID uniform repeated sampling of the seven lines is assumed. Scores of three per served batch, one per selected capacity, one-half per overflow batch and one-tenth per remaining backlog are teaching credits, not sterling revenue or profit.

기초Foundations

46. 실습 F · 관측·변환·가정을 분해한다46. Lab F · Separate observations, transformations and assumptions

국가·개인 기록·기업을 차례로 선택해 먼저 원본 행 수와 도수 분모를 확인합니다. 다음 행동별 전이와 점수가 어떤 변환으로 생겼는지 추적합니다. 국가 지원 비용, 픽셀 조회 비용, 기업 처리 능력 비용을 하나씩 바꾸고 정책 변화를 설명하세요. 실제 행을 썼다는 사실이 가정한 행동 효과까지 실측으로 바꾸지는 않습니다.

각 사례에서 한 상태·한 행동을 골라 Q를 손으로 계산한 뒤 화면과 대조합니다. 기업에서 backlog=0의 처리 능력 0이 최적인 이유는 처리할 일이 없는데 능력을 사면 비용만 들기 때문입니다. 가상 도착 법칙이 현실을 잘 설명하는지는 새로운 시계열과 운영 자료로 별도 검증해야 합니다.

Select country, individual record and company in turn. Check original row counts and count denominators before tracing derived action transitions and scores. Vary one support, inspection or capacity cost at a time and explain policy changes. Real source rows do not turn assumed action effects into measured effects.

Choose one state-action pair per case, calculate its Q value manually and compare. In the company task, capacity zero is optimal with backlog zero because purchased capacity has nothing to serve. Whether the artificial arrival law fits operations needs separate time-series and operational evidence.

기초Foundations

47. 세 사례의 원자료·전체 계산·시각화47. Original records, complete calculations and visualizations

국가 · 실제 성장률과 가정한 지원

실제 한국 실질 1인당 GDP의26개 원래 토큰에서25개 성장률을 새로 계산했습니다. 연도별 원자료와 성장률을 아래 모두 읽을 수 있습니다. 1999년은 첫 성장률의 기준 수준이며 이 선택표 안에서는 전년 성장률이 없습니다. 공개 자료를 다시 내려받았다는 뜻이 아니라 보관 원본을 새 용도로 재독한 작업입니다.

선택26년 전체와 파생 성장률25개 · 표시는 반올림,계산은 정확한 토큰 비율
연도GDP/인 · constant2015USD성장률% · 표시밴드
199916402.9168341094——
200017763.13534172978.292540fast
200118460.42881938293.925509fast
200219775.38006551397.123081fast
200320278.04064211782.541850fast
200421244.81368005284.767586fast
200522123.76130668514.137234fast
200623162.18601112974.693708fast
200724391.76510134485.308562fast
200824934.53963676912.225237fast
200925009.91483119990.302292slow
201026623.04871229276.449978fast
201127393.4553572722.893758fast
201227944.05641900452.009973fast
201328732.7111520332.822263fast
201429470.67329916552.568369fast
201530171.79065452222.379034fast
201631005.40728763882.762901fast
201731979.90273024673.142985fast
201832852.88874889422.729796fast
201933496.31138156431.958496slow
202033215.9298928108-0.837052slow
202134792.93972145984.747752fast
202235809.01381051442.920346fast
202336347.70363925531.504341slow
202437048.42640014961.927832slow
24개 실제 인접 밴드쌍 · 마지막 연도는 출발쌍 없음
출발slow 도수/분모fast 도수/분모
slow2/42/4
fast3/2017/20

fast는 선택한 기준 성장률 2% 이상입니다. 25개 성장률 중 fast 20개·slow 5개와 24개 출발 쌍의 분모는 다릅니다. 보상은 도착 밴드의 평균 성장률을 소수 3자리로 한 번 반올림한 0.971·3.922의 대용 점수입니다. 정확히 절반이면 0에서 멀어지는 쪽으로 반올림하며, 그 뒤 MDP 계산은 분수로 합니다.

기준 전이 외의 의사결정 조건
항목값자료/가정
γ9/10선택
support shift1/5 of slow destination mass가정 효과
support cost1/2선택 점수
reward slow/fast971/1000 ;1961/500관측 집계 후 반올림

지원은 기준 slow 목적지 질량의 1/5을 fast로 옮긴다는 가정입니다. 그 행동을 실제 지원 정책에서 관측하지 않았습니다. 24개 인접 쌍도 Markov 성질·정상성의 증명이 아닙니다. 기본 조건의 최적 행동은 두 상태 모두 baseline이지만, 현실 지원이 무익하다는 뜻은 아닙니다.

독립 Python분수 해 · γ=9/10
상태기준 값최적 행동들최적 값
slow428127/13700baseline428127/13700
fast112196/3425baseline112196/3425
모든4행동을 비교한 최적성 확인
상태행동즉시 기대 보상최적 Q
slowbaseline4893/2000428127/13700
slowhypothetical-support1401/625427179/13700
fastbaseline69587/20000112196/3425
fasthypothetical-support76697/250002218523/68500

직접 해보기: slow에서 baseline의 fast 확률 1/2을 지원 규칙으로 바꾸면 3/5입니다. 비용을 0으로 낮추고 정책이 바뀌는지 실습에서 확인하세요. 계산상 선호 변화와 현실 정책 효과의 식별을 분리해 설명합니다.

원자료와 독립 재현

재현 순서: 먼저 공개 CSV를 내려받아 원자료 행 수와 조건부 도수의 분모를 확인하세요. 같은 폴더에서 Python 또는 R 코드를 실행하고, 전체 상태의 정책·가치와 모든 행동의 Q를 표와 대조합니다. Python은 정확한 분수, R은 유한 정밀도 수치 계산이므로 마지막 자릿수에는 작은 차이가 생길 수 있습니다. 비용을 바꾸었다면 같은 설정으로 다시 계산하세요. 수치가 일치해도 가정한 지원 효과·조회 목표·도착 법칙이 현실에서 입증되는 것은 아닙니다.

전체 CSV actual26-KOR-GDP-percapita-1999-2024-original.csv · 전체 CSV derived25-KOR-growth-and-chosen-bands.csv

독립 Python · 독립 baseR · 전체 분수 결과 · R 수치 결과 · R 환경 기록 · 전체17상태 · 전체126행동 · 전체401수치

개인 기록 · 실제 픽셀의 순차적 공개

제공 test의 1797개 기록 전체에서 라벨·픽셀 18·45를 새로 읽고 강도 8 이상을 ink로 표시했습니다. 18과 45는 64개 입력을 0부터 센 인덱스로, 19번째와 46번째 입력 열에 해당합니다. 실제 기록을 균등하게 뽑고 필드를 순차 공개하는 유한 문제입니다. 공개 비용 1/50과 γ=9/10, 예측 정답 1·오답 0은 가정한 학습 목표입니다. 확인한 test 라벨을 사용하므로 새 작성자·새 자료에 대한 평가가 아닙니다.

전체1797행의 라벨 도수
실제 라벨기록 수
0178
1182
2177
3183
4181
5182
6181
7179
8174
9180
실제40개 라벨·픽셀 결합도수 · 좌우 스크롤 가능
P18/P450123456789
pale/pale26468201391041410
pale/ink235712345018211814
ink/pale2548944447141325746
ink/ink14935836911081132285110

한 픽셀 값만 아는 상태 4개·두 픽셀 값을 아는 상태 4개·unknown·terminal로 10상태입니다. 공개한 모든 필드를 상태에 남겨두므로 같은 상태의 남은 기록 집합이 같습니다. 공개할 때마다 그 집합의 조건부 도수로 다음 상태를 계산합니다. 두 픽셀이 모두 ink인 757행에서는 숫자 0이 149행으로 가장 많습니다.

기본 공개 비용과 할인율의 전체 상태 해
상태조건 기록 수최적 행동들최적 값
unknown1797reveal-p18 | reveal-p4552069/299500
p18-pale578reveal-p459637/28900
p18-ink1219reveal-p454858/30475
p45-pale757reveal-p188153/37850
p45-ink1040reveal-p1814/65
both-0-0295predict-7104/295
both-0-1283predict-3123/283
both-1-0462predict-247/231
both-1-1757predict-0149/757
terminal—stop0

미공개 상태에서 최다 라벨을 즉시 예측하면 적중 비중은 183/1797입니다. 두 픽셀을 항상 본 뒤 문맥별 최다 라벨을 예측하면 성공 도수의 합은 470/1797입니다. 지연과 두 번의 비용을 반영한 처음 값은 −1/50−(9/10)/50+(9/10)^2(470/1797)=52069/299500입니다. 기본 최적 정책도 두 필드를 확인하지만, 모든 조회 비용에서 그러리라고 일반화하지 않습니다.

전체97개 행동의 기대 보상과 Q 펼치기
조회와 모든0~9예측의 비교
상태행동즉시 기대 보상최적 Q
unknownreveal-p18-1/5052069/299500
unknownreveal-p45-1/5052069/299500
unknownpredict-0178/1797178/1797
unknownpredict-1182/1797182/1797
unknownpredict-259/59959/599
unknownpredict-361/59961/599
unknownpredict-4181/1797181/1797
unknownpredict-5182/1797182/1797
unknownpredict-6181/1797181/1797
unknownpredict-7179/1797179/1797
unknownpredict-858/59958/599
unknownpredict-960/59960/599
p18-palereveal-p45-1/509637/28900
p18-palepredict-02/2892/289
p18-palepredict-199/57899/578
p18-palepredict-275/57875/578
p18-palepredict-3143/578143/578
p18-palepredict-423/28923/289
p18-palepredict-53/5783/578
p18-palepredict-627/57827/578
p18-palepredict-7125/578125/578
p18-palepredict-816/28916/289
p18-palepredict-912/28912/289
p18-inkreveal-p45-1/504858/30475
p18-inkpredict-0174/1219174/1219
p18-inkpredict-183/121983/1219
p18-inkpredict-2102/1219102/1219
p18-inkpredict-340/121940/1219
p18-inkpredict-4135/1219135/1219
p18-inkpredict-5179/1219179/1219
p18-inkpredict-6154/1219154/1219
p18-inkpredict-754/121954/1219
p18-inkpredict-8142/1219142/1219
p18-inkpredict-9156/1219156/1219
p45-palereveal-p18-1/508153/37850
p45-palepredict-027/75727/757
p45-palepredict-1112/757112/757
p45-palepredict-2162/757162/757
p45-palepredict-324/75724/757
p45-palepredict-445/75745/757
p45-palepredict-574/75774/757
p45-palepredict-650/75750/757
p45-palepredict-7136/757136/757
p45-palepredict-871/75771/757
p45-palepredict-956/75756/757
p45-inkreveal-p18-1/5014/65
p45-inkpredict-0151/1040151/1040
p45-inkpredict-17/1047/104
p45-inkpredict-23/2083/208
p45-inkpredict-3159/1040159/1040
p45-inkpredict-417/13017/130
p45-inkpredict-527/26027/260
p45-inkpredict-6131/1040131/1040
p45-inkpredict-743/104043/1040
p45-inkpredict-8103/1040103/1040
p45-inkpredict-931/26031/260
both-0-0predict-02/2952/295
both-0-0predict-164/29564/295
both-0-0predict-268/29568/295
both-0-0predict-34/594/59
both-0-0predict-41/2951/295
both-0-0predict-53/2953/295
both-0-0predict-69/2959/295
both-0-0predict-7104/295104/295
both-0-0predict-814/29514/295
both-0-0predict-92/592/59
both-0-1predict-02/2832/283
both-0-1predict-135/28335/283
both-0-1predict-27/2837/283
both-0-1predict-3123/283123/283
both-0-1predict-445/28345/283
both-0-1predict-500
both-0-1predict-618/28318/283
both-0-1predict-721/28321/283
both-0-1predict-818/28318/283
both-0-1predict-914/28314/283
both-1-0predict-025/46225/462
both-1-0predict-18/778/77
both-1-0predict-247/23147/231
both-1-0predict-32/2312/231
both-1-0predict-42/212/21
both-1-0predict-571/46271/462
both-1-0predict-641/46241/462
both-1-0predict-716/23116/231
both-1-0predict-819/15419/154
both-1-0predict-923/23123/231
both-1-1predict-0149/757149/757
both-1-1predict-135/75735/757
both-1-1predict-28/7578/757
both-1-1predict-336/75736/757
both-1-1predict-491/75791/757
both-1-1predict-5108/757108/757
both-1-1predict-6113/757113/757
both-1-1predict-722/75722/757
both-1-1predict-885/75785/757
both-1-1predict-9110/757110/757
terminalstop00

직접 해보기: P18이 ink인 뒤 P45가 ink일 확률은 757/(462+757)=757/1219입니다. 전체 P45 ink 비중 1040/1797과는 분모가 다릅니다. 공개 비용을 1/5로 올리면 두 번 조회하는 고정 전략의 값은 음수지만, 즉시 예측은 양수입니다. 최적 행동이 왜 달라질 수 있는지 정보와 비용의 시점으로 설명합니다.

원자료와 독립 재현

재현 순서: 먼저 공개 CSV를 내려받아 원자료 행 수와 조건부 도수의 분모를 확인하세요. 같은 폴더에서 Python 또는 R 코드를 실행하고, 전체 상태의 정책·가치와 모든 행동의 Q를 표와 대조합니다. Python은 정확한 분수, R은 유한 정밀도 수치 계산이므로 마지막 자릿수에는 작은 차이가 생길 수 있습니다. 비용을 바꾸었다면 같은 설정으로 다시 계산하세요. 수치가 일치해도 가정한 지원 효과·조회 목표·도착 법칙이 현실에서 입증되는 것은 아닙니다.

전체 CSV actual1797-label-two-pixels-for-feature-acquisition.csv · 전체 CSV derived40-pixel-label-joint-counts.csv

독립 Python · 독립 baseR · 전체 분수 결과 · R 수치 결과 · R 환경 기록 · 전체17상태 · 전체126행동 · 전체401수치

기업 · 실제 주문과 가정한 처리 대기열

원본 XLSX의 첫 송장 536365 일곱 줄을 다시 읽었습니다. 서로 다른 상품 수량을 같은 재고로 섞지 않고, 2개당 노동 1배치라는 공통 작업량 환산을 가정했습니다. 도착량을 이 일곱 줄에서 매기간 독립·균등 추출하는 법칙은 실제 일별 도착에서 추정하지 않았습니다. 원본 단가는 파운드 상품 가격이며 아래 노동 비용 점수와 다릅니다.

원자료7행 전체 · 원래8필드는 CSV에 보존
워크시트 행상품 코드실제 수량가정 배치
285123A63
37105363
484406B84
584029G63
684029E63
72275221
82173063
관측 도수와 반복 IID 도착 가정을 구별
배치실제 줄 도수가정한 도착 확률
111/7
355/7
411/7

먼저 현재 대기에서 선택 능력만큼 처리하고 그 뒤 새 작업이 옵니다. 최대 대기 4를 넘은 양은 초과입니다. 보상=3×처리−1×선택 능력−(1/2)×초과−(1/10)×다음 대기이며 교육 점수입니다. 기본 정책은 모든 상태에서 능력 0을 선택하고, 최적 정책은 현재 대기만큼 능력을 선택합니다.

기본 점수 조건의 전체5상태 정책·가치
상태기준 값최적 행동들최적 값
backlog-0-11131459/686000capacity-0340/7
backlog-1-164351/9800capacity-1354/7
backlog-2-2419/140capacity-2368/7
backlog-3-249/14capacity-3382/7
backlog-4-128/7capacity-4396/7
전체25개 상태·행동 비교
처리 전에 알려진 대기로 선택하는 Q
상태행동즉시 기대 보상최적 Q
backlog-0capacity-0-2/7340/7
backlog-0capacity-1-9/7333/7
backlog-0capacity-2-16/7326/7
backlog-0capacity-3-23/7319/7
backlog-0capacity-4-30/7312/7
backlog-1capacity-0-31/703497/70
backlog-1capacity-112/7354/7
backlog-1capacity-25/7347/7
backlog-1capacity-3-2/7340/7
backlog-1capacity-4-9/7333/7
backlog-2capacity-0-31/351742/35
backlog-2capacity-1109/703637/70
backlog-2capacity-226/7368/7
backlog-2capacity-319/7361/7
backlog-2capacity-412/7354/7
backlog-3capacity-0-93/703471/70
backlog-3capacity-139/351812/35
backlog-3capacity-2249/703777/70
backlog-3capacity-340/7382/7
backlog-3capacity-433/7375/7
backlog-4capacity-0-64/351718/35
backlog-4capacity-147/703611/70
backlog-4capacity-2109/351882/35
backlog-4capacity-3389/703917/70
backlog-4capacity-454/7396/7

직접 해보기: backlog 4에서 capacity 2를 고르면 도착 1·3·4에 따른 다음 대기는 3·4·4, 초과는 0·1·2입니다. 즉시 보상 3.7·3.1·2.6을 1:5:1로 평균하면 109/35입니다. 능력 비용을 20으로 올려 최적 선택이 어떻게 바뀌는지 살펴보되, 실제 인력 운영 권고로 읽지 않습니다.

원자료와 독립 재현

재현 순서: 먼저 공개 CSV를 내려받아 원자료 행 수와 조건부 도수의 분모를 확인하세요. 같은 폴더에서 Python 또는 R 코드를 실행하고, 전체 상태의 정책·가치와 모든 행동의 Q를 표와 대조합니다. Python은 정확한 분수, R은 유한 정밀도 수치 계산이므로 마지막 자릿수에는 작은 차이가 생길 수 있습니다. 비용을 바꾸었다면 같은 설정으로 다시 계산하세요. 수치가 일치해도 가정한 지원 효과·조회 목표·도착 법칙이 현실에서 입증되는 것은 아닙니다.

전체 CSV actual7-invoice536365-original-fields-and-workload.csv

독립 Python · 독립 baseR · 전체 분수 결과 · R 수치 결과 · R 환경 기록 · 전체17상태 · 전체126행동 · 전체401수치

Country · Actual growth and assumed support

We recomputed 25 growth rates from 26 retained original Korean real GDP-per-capita tokens. Every selected level and growth rate appears below. 1999 is the baseline for the first growth observation and has no within-selection prior-year growth. Retained originals were freshly read; this does not claim a repeated HTTP download.

All 26 selected years and 25 derived growth rates; display rounding is separate from exact token-ratio calculations
YearGDP/person · constant 2015 USDGrowth% · displayBand
199916402.9168341094——
200017763.13534172978.292540fast
200118460.42881938293.925509fast
200219775.38006551397.123081fast
200320278.04064211782.541850fast
200421244.81368005284.767586fast
200522123.76130668514.137234fast
200623162.18601112974.693708fast
200724391.76510134485.308562fast
200824934.53963676912.225237fast
200925009.91483119990.302292slow
201026623.04871229276.449978fast
201127393.4553572722.893758fast
201227944.05641900452.009973fast
201328732.7111520332.822263fast
201429470.67329916552.568369fast
201530171.79065452222.379034fast
201631005.40728763882.762901fast
201731979.90273024673.142985fast
201832852.88874889422.729796fast
201933496.31138156431.958496slow
202033215.9298928108-0.837052slow
202134792.93972145984.747752fast
202235809.01381051442.920346fast
202336347.70363925531.504341slow
202437048.42640014961.927832slow
24 observed adjacent band pairs; the final year has no outgoing observation
DepartureSlow count/denominatorFast count/denominator
slow2/42/4
fast3/2017/20

Fast means the chosen threshold of at least 2% growth. Twenty fast and five slow observations differ from the 24 outgoing-pair denominators. Reward proxies are destination-band mean growth rounded once to 0.971 and 3.922 with explicit half-away-from-zero rounding, followed by exact rational decision arithmetic.

Decision conditions beyond the descriptive transition table
ComponentValueEvidence/assumption
γ9/10Chosen
support shift1/5 of slow destination massAssumed effect
support cost1/2Chosen score
reward slow/fast971/1000 ;1961/500Rounded observed aggregate

Support hypothetically redirects one-fifth of baseline slow-destination mass to fast. No actual intervention was observed. The 24 pairs do not establish stationarity or a Markov law. Baseline is optimal in both states under default assumptions; this does not establish real support’s ineffectiveness.

Independent Python Fraction solutions at γ=9/10
StateBaseline valueAll optimal actionsOptimal value
slow428127/13700baseline428127/13700
fast112196/3425baseline112196/3425
All 4 action values for optimality checking
StateActionImmediate expected rewardOptimal Q
slowbaseline4893/2000428127/13700
slowhypothetical-support1401/625427179/13700
fastbaseline69587/20000112196/3425
fasthypothetical-support76697/250002218523/68500

Try it: the slow baseline fast probability 1/2 becomes 3/5 under the support rule. Lower the cost to zero in the live lab and inspect policy changes. Separate modeled preference changes from causal identification.

Records and standalone reproduction

Reproduce the case: download the public CSVs and first check source-row counts and conditional-count denominators. Run the Python or R program from the same folder, then compare every state value, policy and action Q value with the tables. Python uses exact fractions, whereas R uses finite-precision arithmetic, so the final digits may differ slightly. If you change a cost, rerun with that setting. Matching calculations do not establish the assumed support effect, inspection objective or arrival law as facts about the world.

Full CSV actual26-KOR-GDP-percapita-1999-2024-original.csv · Full CSV derived25-KOR-growth-and-chosen-bands.csv

Standalone Python · Standalone base R · Full exact results · R numeric results · R environment · All 17 states · All 126 actions · All 401 metrics

Individual record · Sequential reveals of actual pixels

All 1,797 provided-test records supply actual labels and pixels 18/45, annotated ink at intensity at least 8. These are zero-based indices into the 64 inputs: the 19th and 46th input columns. The finite task uniformly draws a retained record and reveals fields sequentially. Inspection cost 1/50, discount 9/10 and correct/wrong rewards 1/0 are assumed objectives. Using inspected test labels is not an evaluation on new writers or new data.

Label counts across all 1,797 rows
Actual labelRecord count
0178
1182
2177
3183
4181
5182
6181
7179
8174
9180
All 40 observed label/pixel joint counts; horizontal scrolling available
P18/P450123456789
pale/pale26468201391041410
pale/ink235712345018211814
ink/pale2548944447141325746
ink/ink14935836911081132285110

Four one-pixel states, four two-pixel states, unknown and terminal make ten states. Remembering every revealed field makes the retained conditional set identical whenever the state matches. Reveal transitions use conditional counts in that set. Among 757 both-ink rows, digit zero is most common with 149 rows.

All state solutions at the default inspection cost and discount
StateContext countAll optimal actionsOptimal value
unknown1797reveal-p18 | reveal-p4552069/299500
p18-pale578reveal-p459637/28900
p18-ink1219reveal-p454858/30475
p45-pale757reveal-p188153/37850
p45-ink1040reveal-p1814/65
both-0-0295predict-7104/295
both-0-1283predict-3123/283
both-1-0462predict-247/231
both-1-1757predict-0149/757
terminal—stop0

Immediate majority prediction from unknown succeeds on 183/1797. Committing to both pixels gives combined majority count 470/1797. Accounting for delay and both costs yields −1/50−(9/10)/50+(9/10)^2(470/1797)=52069/299500. The default optimal policy also reveals both fields; other costs can change that conclusion.

Expand all 97 action rewards and Q values
Compare reveals and every prediction 0–9
StateActionExpected rewardOptimal Q
unknownreveal-p18-1/5052069/299500
unknownreveal-p45-1/5052069/299500
unknownpredict-0178/1797178/1797
unknownpredict-1182/1797182/1797
unknownpredict-259/59959/599
unknownpredict-361/59961/599
unknownpredict-4181/1797181/1797
unknownpredict-5182/1797182/1797
unknownpredict-6181/1797181/1797
unknownpredict-7179/1797179/1797
unknownpredict-858/59958/599
unknownpredict-960/59960/599
p18-palereveal-p45-1/509637/28900
p18-palepredict-02/2892/289
p18-palepredict-199/57899/578
p18-palepredict-275/57875/578
p18-palepredict-3143/578143/578
p18-palepredict-423/28923/289
p18-palepredict-53/5783/578
p18-palepredict-627/57827/578
p18-palepredict-7125/578125/578
p18-palepredict-816/28916/289
p18-palepredict-912/28912/289
p18-inkreveal-p45-1/504858/30475
p18-inkpredict-0174/1219174/1219
p18-inkpredict-183/121983/1219
p18-inkpredict-2102/1219102/1219
p18-inkpredict-340/121940/1219
p18-inkpredict-4135/1219135/1219
p18-inkpredict-5179/1219179/1219
p18-inkpredict-6154/1219154/1219
p18-inkpredict-754/121954/1219
p18-inkpredict-8142/1219142/1219
p18-inkpredict-9156/1219156/1219
p45-palereveal-p18-1/508153/37850
p45-palepredict-027/75727/757
p45-palepredict-1112/757112/757
p45-palepredict-2162/757162/757
p45-palepredict-324/75724/757
p45-palepredict-445/75745/757
p45-palepredict-574/75774/757
p45-palepredict-650/75750/757
p45-palepredict-7136/757136/757
p45-palepredict-871/75771/757
p45-palepredict-956/75756/757
p45-inkreveal-p18-1/5014/65
p45-inkpredict-0151/1040151/1040
p45-inkpredict-17/1047/104
p45-inkpredict-23/2083/208
p45-inkpredict-3159/1040159/1040
p45-inkpredict-417/13017/130
p45-inkpredict-527/26027/260
p45-inkpredict-6131/1040131/1040
p45-inkpredict-743/104043/1040
p45-inkpredict-8103/1040103/1040
p45-inkpredict-931/26031/260
both-0-0predict-02/2952/295
both-0-0predict-164/29564/295
both-0-0predict-268/29568/295
both-0-0predict-34/594/59
both-0-0predict-41/2951/295
both-0-0predict-53/2953/295
both-0-0predict-69/2959/295
both-0-0predict-7104/295104/295
both-0-0predict-814/29514/295
both-0-0predict-92/592/59
both-0-1predict-02/2832/283
both-0-1predict-135/28335/283
both-0-1predict-27/2837/283
both-0-1predict-3123/283123/283
both-0-1predict-445/28345/283
both-0-1predict-500
both-0-1predict-618/28318/283
both-0-1predict-721/28321/283
both-0-1predict-818/28318/283
both-0-1predict-914/28314/283
both-1-0predict-025/46225/462
both-1-0predict-18/778/77
both-1-0predict-247/23147/231
both-1-0predict-32/2312/231
both-1-0predict-42/212/21
both-1-0predict-571/46271/462
both-1-0predict-641/46241/462
both-1-0predict-716/23116/231
both-1-0predict-819/15419/154
both-1-0predict-923/23123/231
both-1-1predict-0149/757149/757
both-1-1predict-135/75735/757
both-1-1predict-28/7578/757
both-1-1predict-336/75736/757
both-1-1predict-491/75791/757
both-1-1predict-5108/757108/757
both-1-1predict-6113/757113/757
both-1-1predict-722/75722/757
both-1-1predict-885/75785/757
both-1-1predict-9110/757110/757
terminalstop00

Try it: P45 ink after observing P18 ink has probability 757/1219, not the unconditional 1040/1797. At inspection cost 1/5 the committed two-query strategy has negative value while immediate prediction stays positive. Explain the change using information access and cost timing.

Records and standalone reproduction

Reproduce the case: download the public CSVs and first check source-row counts and conditional-count denominators. Run the Python or R program from the same folder, then compare every state value, policy and action Q value with the tables. Python uses exact fractions, whereas R uses finite-precision arithmetic, so the final digits may differ slightly. If you change a cost, rerun with that setting. Matching calculations do not establish the assumed support effect, inspection objective or arrival law as facts about the world.

Full CSV actual1797-label-two-pixels-for-feature-acquisition.csv · Full CSV derived40-pixel-label-joint-counts.csv

Standalone Python · Standalone base R · Full exact results · R numeric results · R environment · All 17 states · All 126 actions · All 401 metrics

Company · Actual orders and an assumed queue

We reread the seven original XLSX lines of invoice 536365. Heterogeneous products are not pooled as fungible inventory; two items per equivalent labor batch is chosen. IID uniform arrival draws from these seven lines are assumed, not estimated daily arrivals. Original sterling product prices are separate from the labor-capacity score.

All 7 selected rows; all 8 original fields remain in CSV
Worksheet rowProduct codeActual quantityChosen batches
285123A63
37105363
484406B84
584029G63
684029E63
72275221
82173063
Distinguish observed line counts from an assumed repeated IID arrival law
BatchesObserved line countAssumed arrival probability
111/7
355/7
411/7

Serve from current backlog before the next arrival. Work above retained capacity four is overflow. Reward=3·served−selected capacity−(1/2)·overflow−(1/10)·next backlog, in teaching credits. The baseline policy selects zero capacity everywhere; the optimal default policy clears current backlog.

Policies and values across all 5 states under default scores
StateBaseline valueAll optimal actionsOptimal value
backlog-0-11131459/686000capacity-0340/7
backlog-1-164351/9800capacity-1354/7
backlog-2-2419/140capacity-2368/7
backlog-3-249/14capacity-3382/7
backlog-4-128/7capacity-4396/7
All 25 state-action comparisons
Choose using backlog known before service and arrivals
StateActionExpected rewardOptimal Q
backlog-0capacity-0-2/7340/7
backlog-0capacity-1-9/7333/7
backlog-0capacity-2-16/7326/7
backlog-0capacity-3-23/7319/7
backlog-0capacity-4-30/7312/7
backlog-1capacity-0-31/703497/70
backlog-1capacity-112/7354/7
backlog-1capacity-25/7347/7
backlog-1capacity-3-2/7340/7
backlog-1capacity-4-9/7333/7
backlog-2capacity-0-31/351742/35
backlog-2capacity-1109/703637/70
backlog-2capacity-226/7368/7
backlog-2capacity-319/7361/7
backlog-2capacity-412/7354/7
backlog-3capacity-0-93/703471/70
backlog-3capacity-139/351812/35
backlog-3capacity-2249/703777/70
backlog-3capacity-340/7382/7
backlog-3capacity-433/7375/7
backlog-4capacity-0-64/351718/35
backlog-4capacity-147/703611/70
backlog-4capacity-2109/351882/35
backlog-4capacity-3389/703917/70
backlog-4capacity-454/7396/7

Try it: backlog 4 and capacity 2 produce next backlogs 3,4,4 and overflows 0,1,2 under arrivals 1,3,4. Reward outcomes 3.7,3.1,2.6 weighted 1:5:1 give 109/35. Raise capacity cost to 20 to inspect sensitivity, without treating this assumed exercise as staffing advice.

Records and standalone reproduction

Reproduce the case: download the public CSVs and first check source-row counts and conditional-count denominators. Run the Python or R program from the same folder, then compare every state value, policy and action Q value with the tables. Python uses exact fractions, whereas R uses finite-precision arithmetic, so the final digits may differ slightly. If you change a cost, rerun with that setting. Matching calculations do not establish the assumed support effect, inspection objective or arrival law as facts about the world.

Full CSV actual7-invoice536365-original-fields-and-workload.csv

Standalone Python · Standalone base R · Full exact results · R numeric results · R environment · All 17 states · All 126 actions · All 401 metrics

기초Foundations

48. Bellman과 공식 강의를 함께 읽기48. Read Bellman alongside official lectures

Richard Ernest Bellman의 The Theory of Dynamic Programming은 RAND의 공식 P-550 소개에서 1954년 학회 연설문으로 확인할 수 있습니다. 인물 이름을 암기하기보다 큰 시간 문제를 현재 선택과 남은 문제로 나누는 생각을 자신의 예로 설명하세요. 저작물은 공식 소개 페이지로 연결하며 원문을 무단 재게시하지 않습니다.

David Silver의 공식 강의 목록에서 MDP와 동적 계획법 자료를 읽고, 본문 영상에서는 보상의 시점과 Bellman 기대 식·최적 식을 구분해 보세요. 영상 재생 뒤 잠시 멈추고 ready의 두 행동 Q를 손으로 써 보는 활동이 중요합니다. Berkeley의 세 공식 읽기 자료는 모형 정의, 가치 반복의 축약 증명, 정책 평가와 개선 순서에 대응합니다. 영상의 재생 가능 여부는 플레이어 상태로 확인하며 외부 서버의 재생을 계산 검증과 혼동하지 않습니다.

Python · R · 원자료·단위·가공·출처

RAND’s official P-550 page identifies Richard Ernest Bellman’s The Theory of Dynamic Programming as a 1954 meeting address. Rather than memorizing a name, explain how a long temporal problem separates into a current decision and a remaining problem. We link the official landing page rather than reposting the copyrighted document.

Use David Silver’s official MDP and dynamic-programming materials to distinguish reward timing, Bellman expectation equations and optimality equations. Pause the embedded lecture and calculate both ready-state Q values. Three official Berkeley readings cover model definition, contraction and policy evaluation/improvement. Check playback through the actual player; external video availability is separate from numerical verification.

Python · R · Inputs, units, transformations and sources

Python·R 코드 실행 방법Run the Python/R companions

자료 묶음을 풀고 코드와 실제데이터 폴더를 함께 두세요. 터미널에서 코드 파일이 있는 폴더로 이동해 아래 명령을 실행합니다. 코딩이 처음이라면 손계산과 웹 실습을 먼저 하고, 데이터 사이언스 입문에서 코드를 배운 뒤 돌아와도 됩니다.Extract the bundle, keeping the scripts beside the data folder. In a terminal, enter the script folder and run the commands below. Beginners can complete hand calculations and browser labs first, returning to code after studying introductory data science.

python ai05-reproduce.py
Rscript --vanilla --encoding=UTF-8 ai05-reproduce.R

결과 파일은 각 코드에 지정된 결과 폴더에 저장됩니다. CSV 원자료는 덮어쓰지 않습니다.Result files are saved in the result directory specified by each script; the input CSVs are not overwritten.

영상·학자·함께 읽기Videos, thinkers and guided reading

본문의 질문을 넓히는 선택 학습입니다. 영상을 보기 전 질문을 먼저 읽고, 자신의 답을 쓴 뒤 해설과 비교하세요. 자료의 언어·선수 지식은 각 항목에 표시했습니다.Optional extensions to the chapter. Read the question first, write your answer, then compare with the explanation. Language and prerequisites are indicated below.

MDP에서 보상과 Bellman 식 이해하기Understand rewards and Bellman equations in MDPs

David Silver · Google DeepMind official uploader

공식MDP강의의상태·전이·보상·정책을교실의두상태표와대응하세요. 첫보상이언제인지적고기대식과최적식을구분합니다.Map the official MDP lecture’s states, transitions, rewards and policies to the classroom table. Identify first-reward timing and distinguish expectation from optimality.

교재 안의 YouTube 플레이어에서 재생합니다. 원영상에서 제공하는 자막은 플레이어의 CC·설정에서 선택할 수 있습니다.Playback stays in this chapter’s YouTube player. Available captions can be selected through CC/settings.

보고 읽은 뒤 답하기Respond after watching/reading 정책평가에서왜max가없나요?Why is there no maximum in fixed-policy evaluation?

생각을 점검하는 해설Check your reasoning

정한정책의행동또는혼합확률이이미주어졌으므로그규칙아래결과를평균합니다. 최적화는다른질문입니다.The policy already specifies actions or mixing probabilities. Evaluate outcomes under that rule; optimization asks a different question.

Richard Ernest Bellman · 남은 문제를 다시 푼다Richard Ernest Bellman · Reuse the remaining problem

RAND · P-550 official publication landing

공식소개는The Theory of Dynamic Programming을1954년학회연설문으로설명합니다. 현재선택과나머지문제로분해하는생각을자기예로쓰세요.The official page identifies The Theory of Dynamic Programming as a 1954 meeting address. Explain current choice and remaining subproblem using your own example.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 동적계획은모든미래경로를독립계산하나요?Does dynamic programming independently recompute every future path?

생각을 점검하는 해설Check your reasoning

같은상태·남은조건의부분문제답을재사용합니다. 상태의충분성과목표조건을먼저명시해야합니다.It reuses solutions of matching state/subproblem conditions. Specify state sufficiency and the objective first.

MDP의 상태·행동·보상 시점MDP states, actions and reward timing

UC Berkeley CS188 official textbook

결정전상태와행동뒤결과를나누고할인의시간지수를읽습니다.Separate pre-decision state from post-action outcome and read the discount timing.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 종료뒤보상은?What happens after termination?

생각을 점검하는 해설Check your reasoning

이장API는0보상흡수stop을명시합니다.Our API explicitly uses an absorbing stop with zero reward.

가치 반복과 축약 증명Value iteration and contraction

UC Berkeley CS188 official textbook

방정식과한번갱신을구별하고최대값부등식으로축약을다시증명합니다.Distinguish a fixed-point equation from an update and rederive contraction using the maximum inequality.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading γ=1도같은정리인가요?Does the same theorem cover γ=1?

생각을 점검하는 해설Check your reasoning

축약계수1미만조건이깨져추가조건없이는아닙니다.No; the strict contraction condition fails without further assumptions.

정책 평가와 개선Policy evaluation and improvement

UC Berkeley CS188 official textbook

정책식의선형해와개선후보를따로기록하고동률규칙을점검합니다.Record the evaluated linear solution separately from an improved candidate and examine ties.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 한번제한이면새후보도평가됐나요?Has a new candidate been evaluated at cap one?

생각을 점검하는 해설Check your reasoning

아직아닙니다. 기존값은평가한정책에속합니다.No; the values still belong to the evaluated policy.

연습문제 · 계산에서 설명과 증명까지Exercises: calculation, explanation and proof

먼저 혼자 풀고 풀이를 여세요. 숫자와 함께 단위·포함 기준·계산 이유를 확인하세요.Attempt each problem before opening its solution. Check units, inclusion rules and the reason for the calculation.

1. 결과별 평균 점수Weighted outcome scores

가정한 한 행동이 확률3/4로2점, 확률1/4로−2점을 준다. 기대 보상과 한 번의 실제 점수 후보를 구하라.

An assumed action pays 2 with probability 3/4 and −2 with probability 1/4. Find its expectation and possible realized scores.

풀이와 확인할 이유Solution and explanation

(3/4)2+(1/4)(−2)=1점이다. 한 번의 결과는2 또는−2이며1이 반드시 나오는 것은 아니다. 확률이 서로 달라 두 점수를 단순 평균한0은 이 실험의 기대값이 아니다.

The expectation is (3/4)2+(1/4)(−2)=1. A single realization is 2 or −2, not necessarily 1. An unweighted mean of zero ignores unequal probabilities.

2. 합이 맞지 않는 전이An unnormalized transition row

한 행동의 세 결과 확률을0.2,0.3,0.6으로 입력했다. 합을 구하고 실습이 몰래 정규화하면 무엇이 달라지는지 설명하라.

An action has outcome probabilities 0.2, 0.3, 0.6. Check their total and explain what silent normalization would change.

풀이와 확인할 이유Solution and explanation

합은1.1이다. 각 수가0~1 사이여도 행 전체는 확률분포가 아니다. 1.1로 나누면2/11,3/11,6/11이라는 새 모형이 된다. 실습 계약은 사용자가 의도한 수정을 결정하도록 원래 행을 거부한다.

The total is 1.1. Entries in [0,1] do not by themselves form a distribution. Dividing gives a different model, 2/11, 3/11, 6/11. The API rejects the original row instead of deciding the intended correction.

3. 같은 다음 상태의 두 보상Two rewards for the same successor

한 행동은 같은 다음 상태j로 확률1/3에서−2점, 확률2/3에서4점을 준다. V(j)=3, γ=1/2일 때 Q를 구하라.

An action reaches the same successor j, paying −2 with probability 1/3 and 4 with probability 2/3. With V(j)=3 and γ=1/2, find Q.

풀이와 확인할 이유Solution and explanation

기대 보상은−2/3+8/3=2이다. j로 갈 합은1이므로 미래 부분은3/2다. 따라서 Q=7/2이다. 같은 다음 상태라는 이유로 첫 보상−2만 남기면 잘못된 값이 된다.

Expected reward is −2/3+8/3=2. Total transition probability to j is one, giving continuation 3/2. Thus Q=7/2. Keeping only the first reward because the successor matches would be incorrect.

4. 한 번 남은 교실 선택One classroom decision remaining

ready에서 rest는1점, practice는3점이다. tired에서 rest는1점, practice는0점이다. 한 번 선택 뒤 끝날 때 두 상태의 최적 값과 행동은?

In ready, rest pays 1 and practice 3; in tired, rest pays 1 and practice 0. With termination after one decision, find both optimal values and actions.

풀이와 확인할 이유Solution and explanation

미래 보상은 없으므로 ready는3점의 practice, tired는1점의 rest이다. 값은(3,1)이다. 다음 상태 전이가 주어져도 종료 뒤 가치0에 곱해져 마지막 단계의 선택에는 영향을 주지 않는다.

There is no continuation reward. Choose practice for value 3 in ready and rest for value 1 in tired, giving (3,1). Any successor transitions multiply terminal value zero and do not change this final-stage choice.

5. 유한 두 단계와 할인율1Two finite stages at discount one

ready/rest는1점 뒤 ready, ready/practice는3점 뒤 ready·tired각1/2이다. tired/rest는1점 뒤 두 상태각1/2, tired/practice는0점 뒤 tired다. 정확히2번 선택하고 종료하며 γ=1이다. 시작별 최적 값은?

Ready/rest pays 1 then ready; ready/practice pays 3 then either state equally. Tired/rest pays 1 then either state equally; tired/practice pays 0 then tired. Exactly two decisions remain at γ=1. Find optimal starting values.

풀이와 확인할 이유Solution and explanation

마지막 값은(3,1)이다. ready에서 rest=1+3=4, practice=3+(3+1)/2=5다. tired에서는 rest=1+2=3, practice=1이다. 답은(5,3)이며 유한 종료 문제라 할인율1도 잘 정의된다.

Final-stage values are (3,1). Ready/rest gives 4 and practice gives 3+(3+1)/2=5. Tired/rest gives 3 and practice 1. Thus values are (5,3). Discount one is valid here because the horizon is finite.

6. 같은 표를 절반 할인하면Discounting the same two-stage task

직전 문제에 의존하지 말고 다음 표를 사용한다. ready의 rest는1점 뒤 ready, practice는3점 뒤 두 상태각1/2이다. tired의 rest는1점 뒤 두 상태각1/2, practice는0점 뒤 tired이다. 2단계, γ=1/2의 최적 값은?

Use this complete table: ready/rest pays 1 then ready; ready/practice pays 3 then either state equally; tired/rest pays 1 then either state equally; tired/practice pays 0 then tired. For two stages and γ=1/2, find optimal values.

풀이와 확인할 이유Solution and explanation

마지막 값(3,1)을 사용한다. ready/rest=5/2, practice=3+(1/2)2=4다. tired/rest=1+(1/2)2=2, practice=(1/2)1=1/2다. 따라서(4,2)다. γ=1의 두 단계 답과 우연히 비슷해 보여도 할인 위치를 생략하면 안 된다.

Use final values (3,1). Ready/rest gives 5/2 and practice 4. Tired/rest gives 2 and practice 1/2. Values are (4,2); the continuation term alone is discounted.

7. 보상 시점과 할인 지수Reward timing and discount powers

세 번의 보상이 순서대로1,2,4이고 γ=1/2다. 첫 결정 직전 할인합을 구하라.

Three successive rewards are 1, 2, 4 with γ=1/2. Find the return immediately before the first decision.

풀이와 확인할 이유Solution and explanation

첫 보상 지수는0이다. 1+(1/2)2+(1/4)4=3이다. 처음부터 모든 항에γ를 한 번 더 곱한3/2는 한 시점 더 이전에서 같은 보상들을 평가하는 다른 시간 기준이다.

The first exponent is zero: 1+(1/2)2+(1/4)4=3. Multiplying once more by γ would value the same rewards one step earlier, changing the time reference.

8. 절댓값 보상 상한An absolute reward bound

모든 결과 보상이−3~3이고 γ=1/2다. 모든 정책과 경로의 할인합 절댓값 상한을 구하라. 정확한 최적 값이기도 한가?

All rewards lie between −3 and 3, with γ=1/2. Bound the absolute discounted return of every policy and path. Is the bound necessarily the optimum?

풀이와 확인할 이유Solution and explanation

각 보상의 절댓값을3으로 바꾸어 더하면3/(1−1/2)=6이다. 실제로 매번3을 받을 수 있는지는 전이와 행동에 달려 있어 최적 값이6이라고 단정할 수 없다. 음수 보상의 상쇄에 기대지 않은 공통 상한이다.

Summing absolute bounds gives 3/(1−1/2)=6. Whether reward 3 can be collected forever depends on the model, so the optimum need not be six. The bound does not rely on cancellation of negative rewards.

9. 음수 보상의 자기 순환A negative-reward self-loop

상태 하나·행동 하나이며 매번−3점 뒤 같은 상태다. γ=1/2일 때 가치를 구하고 방정식에 대입하라.

One state and one action pay −3 and self-loop. Find the value at γ=1/2 and verify the equation.

풀이와 확인할 이유Solution and explanation

V=−3+V/2이므로 V/2=−3, V=−6이다. 대입하면−3−3=−6이다. 유한 음수 보상도 정상적인 할인 문제이며, 확률이 음수인 입력과 혼동하면 안 된다.

V=−3+V/2 gives V=−6; substitution yields −3−3=−6. Finite negative rewards are valid in a discounted MDP and differ from invalid negative probabilities.

10. 종료 보상을 반복하는 오류Repeating a terminal reward

완료 때10점을 한 번 받는 게임이다. terminal 자기 순환의 보상을 실수로10으로 정하면 γ=1/2에서 terminal 값은? 원래 종료 규약은?

A game pays a completion bonus 10 once. If a terminal self-loop is mistakenly assigned reward 10, what is terminal value at γ=1/2? What convention represents actual termination?

풀이와 확인할 이유Solution and explanation

잘못된 반복 상태는V=10+V/2로20이다. 원래는 terminal 도착 전 결과에10을 한 번 주고 도착 뒤 stop 보상을0으로 둔다. 그때 terminal 가치는0이다. 보상 위치를 두 군데에 중복 입력하지 않는다.

The repeating state has V=10+V/2=20. Pay the completion bonus once on the arrival outcome and assign terminal/stop reward zero thereafter. Terminal value is then zero; do not duplicate the bonus.

11. 한 상태의 무작위 정책A one-state randomized policy

한 상태에서 a는0점, b는2점 뒤 모두 자기 순환한다. 매 방문 a확률1/4, b확률3/4이고 γ=1/2다. 이 정책의 가치와 항상 b의 가치를 구하라.

In one state, a pays zero and b two, both self-looping. Each visit chooses a with probability 1/4 and b with 3/4. At γ=1/2 compare this policy with always b.

풀이와 확인할 이유Solution and explanation

평균 보상은3/2이므로 혼합 정책 값은(3/2)/(1/2)=3이다. 항상 b는2/(1/2)=4다. 정책에 주어진 무작위 비율을 평가하는 것과 행동을 최적화하는 계산이 다르다.

The mixture’s mean reward is 3/2, so its value is 3. Always b has value 4. Evaluating specified mixing probabilities differs from optimizing the action.

12. 정책 평균 백업A policy-weighted backup

V(ready)=4,V(tired)=2, γ=1/2이다. ready/rest는1점 뒤 ready, ready/practice는3점 뒤 두 상태각1/2다. ready에서 rest확률1/3, practice확률2/3인 정책의 한 번 백업은?

Let V(ready)=4, V(tired)=2 and γ=1/2. Ready/rest pays 1 then ready; ready/practice pays 3 then either state equally. A policy mixes rest 1/3 and practice 2/3. Find its ready backup.

풀이와 확인할 이유Solution and explanation

Qrest=1+2=3, Qpractice=3+(1/2)(4+2)/2=9/2다. 정책 평균은(1/3)3+(2/3)(9/2)=4다. 최적 백업이라면 최대9/2를 쓰지만 이 문제는 지정한 혼합 정책을 평가한다.

Qrest=3 and Qpractice=9/2. The policy backup is (1/3)3+(2/3)(9/2)=4. An optimality backup would take 9/2; that is a different operator.

13. 날씨를 알기 전과 안 뒤Before and after knowing weather

맑음·비 각1/2이다. 야외는맑음4·비0점, 실내는항상1점이다. 결과를 보기 전 최대 기대값과 결과를 본 뒤 선택할 수 있을 때 기대값은?

Dry and rain each have probability 1/2. Outdoors pays 4 if dry and 0 if rainy; indoors always pays 1. Compare choosing before weather is known with choosing after observing it.

풀이와 확인할 이유Solution and explanation

사전에는 야외 평균2가 실내1보다 커 최선2다. 사후 선택은맑음4·비1이라 평균5/2다. 차이1/2는 이 예의 완전 정보 이익이며 같은 정보 조건에서 두 알고리즘이 다른 답을 낸 것이 아니다.

Before observation, outdoor expectation two beats one indoors. With advance observation choose scores four and one, averaging 5/2. The half-point difference reflects information access, not inconsistent answers to the same task.

14. 상태에 빠진 기억Missing memory in the state

같은 tired 표시라도 어제 수면3시간인 날과8시간인 날의 다음 상태 확률이 다르다. tired만 상태로 둔 정상 Markov 모형의 어떤 전제를 점검해야 하는가?

Days labeled tired have different successor probabilities depending on whether previous sleep was three or eight hours. What assumption needs checking if the state stores only tired?

풀이와 확인할 이유Solution and explanation

현재 상태·행동을 조건으로 해도 오래된 정보가 추가 예측력을 가지므로 상태의 Markov 충분성이 의심된다. 수면 정보 등을 상태에 포함하거나 다른 모형을 고려한다. 표를 날짜순으로 정렬하는 것만으로 이 문제를 해결하지 못한다.

Older information still predicts outcomes conditional on the current state and action, questioning Markov sufficiency. Add relevant sleep information or use another model. Chronological sorting alone does not repair the state representation.

15. 확률 행과 보상 열의 역할Probability rows and reward columns

한 행동의 두 결과 확률이1/4,3/4이고 보상이−5,9이다. 확률과 보상에 각각 어떤 범위·합 조건을 적용하며 기대 보상은?

An action’s probabilities are 1/4, 3/4 and rewards −5, 9. State the different validation rules and compute expected reward.

풀이와 확인할 이유Solution and explanation

확률은비음수·합1이다. 보상은유한이면−5와9처럼0~1 밖도 가능하며 합1일 필요가 없다. 평균은−5/4+27/4=11/2다. 기대 보상 자체도 확률이 아니므로1을 넘을 수 있다.

Probabilities must be nonnegative and sum to one. Finite rewards may lie outside [0,1] and need not sum to one. Expected reward is −5/4+27/4=11/2, which is not itself a probability.

16. 할인율0의 최적 가치Optimal values at discount zero

ready에서 두 행동의 기대 보상이1과3, tired에서는1과0이다. 모든 전이는 정상이며 γ=0이다. 최적 값과 임의 초기값에서 필요한 백업 횟수는?

Expected action rewards are 1 and 3 in ready, and 1 and 0 in tired. Transitions are valid and γ=0. Find optimal values and the backups needed from an arbitrary finite starting vector.

풀이와 확인할 이유Solution and explanation

미래 항이0이므로 값은(3,1)이다. 어느 초기표에서도 한 번의 최적 백업으로 이 표가 된다. 시작표가 이미(3,1)이면 잔차0이므로 갱신0회로도 정답을 확인할 수 있다.

Continuation vanishes, giving (3,1). One optimal backup reaches this from any finite vector. If the starting vector already equals it, a zero residual certifies the answer without an update.

17. 행동 화살표의 인과적 의미Causal meaning of an action arrow

한국 성장 밴드의 관측 인접 쌍으로 전이를 만들고 지원 행동이 fast확률을 올린다고 임의로 정했다. 이 모형의 최적 지원 여부가 실제 정책 효과를 식별하는가?

A model uses observed Korean growth-band transitions and assumes a support action raises fast probability. Does its optimal support choice identify a real policy effect?

풀이와 확인할 이유Solution and explanation

아니다. 관측 전이와 가정한 개입 효과는 다른 입력이다. 계산은 정한 행동 효과와 비용 아래의 최적 선택만 준다. 실제 효과를 논하려면 정책 배정·비교대상·교란·식별 전략 등 추가 근거가 필요하다.

No. Observed transitions and assumed interventions are distinct inputs. Optimization answers only the declared effect-and-cost model. Real causal claims need evidence about assignment, comparisons, confounding and identification.

18. 관측하지 않은 픽셀 문맥An unobserved pixel context

유한 픽셀 기록에서 특정 두밴드 조합의 도수가0이다. 그 상태에서 임의의 stop·0점 행을 추가한 경우 이를 관측된 조건부 확률이라고 불러도 되는가?

A two-pixel context has count zero in a finite record table. The model adds a stop action with zero reward there. Is this an observed conditional law?

풀이와 확인할 이유Solution and explanation

조건부 도수의 분모가0이라 관측 표가 그 조건부를 정하지 않는다. stop은 완전한 MDP 입력을 위한 공개된 규약이다. 양의 무게인 공개 경로에서 그 문맥이 도달 불가능한지도 확인해야 하며 규약을 실측이라고 표현하지 않는다.

The conditional count denominator is zero, so the records do not determine that law. Stop is an explicit completion convention. Check whether positive-mass reveal paths can reach the context and never label the convention observed.

19. 아주 작은 값의 표시Displaying a very small value

한 상태에서 즉시 보상0, γ=10의−200승, 입력 가치10의−200승이다. 한 번 백업 값이 화면에서0으로 보여도 정확한 값은?

One state has reward zero, discount 10⁻²⁰⁰ and input value 10⁻²⁰⁰. What is its backup even if the display shows zero?

풀이와 확인할 이유Solution and explanation

곱은10의−400승으로 양수다. binary64 표시에서 언더플로가 생겨0처럼 보일 수 있지만 정확 분수와 displayUnderflow를 유지한다. exactZero는false여야 하며 실제 보상이0인 고정점 문제와 현재 입력점의 한 번 계산을 구분한다.

The product is positive 10⁻⁴⁰⁰. Binary64 may underflow to zero, but the exact fraction and displayUnderflow remain. exactZero is false. Distinguish this current-vector backup from the zero-reward fixed point.

20. 보상 단위의 변환Transforming reward units

γ=1/2의 어떤 모형에서 정책 값이(5,3)이다. 모든 무한 단계의 보상을2배하면 값은? 모든 단계에1을 더하면 값은? 종료 뒤도 같은 변환을 적용한다.

A policy has values (5,3) at γ=1/2. What happens when every infinite-step reward doubles, or when one is added at every step including post-termination steps?

풀이와 확인할 이유Solution and explanation

2배이면 선형성으로(10,6)이다. 상수1을 더하면 각 시작에서1/(1−1/2)=2가 더해져(7,5)다. 종료 뒤 보상을0으로 남긴 별도 변환에는 두 번째 규칙을 그대로 적용할 수 없다.

Doubling gives (10,6). Adding one at every step adds 1/(1−1/2)=2, yielding (7,5). The second identity does not apply unchanged if terminal rewards are exempted and remain zero.

21. 항상 rest의 연립방정식Equations for always rest

두 상태에서 항상 rest를 고른다. ready는1점 뒤 ready, tired는1점 뒤 두 상태각1/2다. γ=1/2에서 Vready=x,Vtired=y를 풀어라.

Always rest: ready pays 1 then ready; tired pays 1 then either state equally. At γ=1/2 solve for x=Vready and y=Vtired.

풀이와 확인할 이유Solution and explanation

x=1+x/2에서x=2다. y=1+(x+y)/4에 넣으면3y/4=3/2이므로y=2다. 원래 두 식에 대입해 양변이2임을 확인한다. 정확한 정책 가치(2,2)가 나왔다고 최적성이 자동 확인되지는 않는다.

From x=1+x/2 obtain x=2. Substituting into y=1+(x+y)/4 gives y=2. Both equations verify by substitution. These are exact policy values, not yet an optimality certificate.

22. practice·rest의 해Solving practice and rest

ready에서는3점 뒤 두 상태각1/2, tired에서는1점 뒤 두 상태각1/2를 선택한다. γ=1/2의 두 정책 가치를 풀어라.

Choose an action paying 3 then either state equally in ready, and one paying 1 then either state equally in tired. Solve both policy values at γ=1/2.

풀이와 확인할 이유Solution and explanation

x=3+(x+y)/4,y=1+(x+y)/4이다. 빼면x−y=2, 더하면x+y=4+(x+y)/2=8이다. 합과 차를 풀어x=5,y=3을 얻는다. 이 정책의 가치는(5,3)이다.

Equations x=3+(x+y)/4 and y=1+(x+y)/4 imply difference two and sum eight. Hence x=5 and y=3. These values belong to this specified policy.

23. 다른 행동까지 최적성 확인Check all alternative actions

γ=1/2, V=(5,3)이다. ready의 후보 rest는1점 뒤 ready, practice는3점 뒤 두 상태각1/2다. tired의 rest는1점 뒤 두 상태각1/2, practice는0점 뒤 tired다. 모든Q와 최적성 잔차를 구하라.

At γ=1/2 use V=(5,3). Ready/rest pays 1 then ready; ready/practice 3 then either state equally. Tired/rest pays 1 then either state equally; tired/practice 0 then tired. Find all Q values and the optimality residual.

풀이와 확인할 이유Solution and explanation

ready Q는7/2와5, tired Q는3과3/2다. 최대값은원래V=(5,3)이므로잔차0이다. practice·rest가 고정점의 최대 행동이며 유한 할인 모형에서 최적 정책이다.

Ready Q values are 7/2 and 5; tired Q values are 3 and 3/2. Their maxima reproduce (5,3), giving residual zero and certifying practice/rest as optimal in this finite discounted model.

24. 전이 행렬의 방향Direction of the transition matrix

출발 상태가 행인 P=[[1,0],[1/2,1/2]], 가치 열벡터 V=(5,3)이다. PV를 구하고 두 번째 성분을 말로 설명하라.

Rows are departure states in P=[[1,0],[1/2,1/2]], and V=(5,3) is a column vector. Compute PV and explain its second entry.

풀이와 확인할 이유Solution and explanation

첫 행은5, 두 번째는(5+3)/2=4이므로(5,4)다. 현재 두 번째 상태에서 다음 두 상태 가치의 기대값이다. 전치하면 출발·도착 의미가 바뀌고 이 예에서는 행의 합도1이 아니게 된다.

The product is (5,4): the second entry averages successor values as (5+3)/2. Transposing swaps departure and arrival roles and, here, also destroys row normalization.

25. 정책 혼합의 보상과 전이Rewards and transitions under mixing

한 상태에서 a는보상0·다음x확률1, b는보상2·다음x와y각1/2다. 정책 a확률1/4,b확률3/4의 기대 보상과 다음 분포를 구하라.

From a current state, action a pays zero and goes to x surely; b pays two and goes to x or y equally. A policy chooses a with probability 1/4 and b with 3/4. Find mean reward and next-state probabilities.

풀이와 확인할 이유Solution and explanation

보상은(1/4)0+(3/4)2=3/2다. Px=(1/4)1+(3/4)(1/2)=5/8, Py=3/8로합1이다. 보상 혼합과 전이 혼합에 같은 행동 확률을 쓰되, 서로 다른 결과 열을 따로 계산한다.

Mean reward is 3/2. Px=1/4+3/8=5/8 and Py=3/8, totaling one. The same action weights average rewards and transitions, but each quantity has its own calculation.

26. I−γP를 직접 쓰기Write I minus gamma P

P=[[1,0],[1/2,1/2]], r=(1,1), γ=1/2다. 정책 평가 행렬 A=I−γP를 적고 AV=r의 해를 확인하라.

Let P=[[1,0],[1/2,1/2]], r=(1,1), γ=1/2. Write A=I−γP and check a solution of AV=r.

풀이와 확인할 이유Solution and explanation

A=[[1/2,0],[−1/4,3/4]]다. V=(2,2)를 곱하면 첫 성분1, 둘째−1/2+3/2=1이다. 행렬식3/8이0이 아니며 이 식에서는 해가 유일하다.

A=[[1/2,0],[−1/4,3/4]]. Multiplying by (2,2) yields (1,1). Its determinant is 3/8, nonzero, confirming uniqueness in this example.

27. 정책 잔차0과 최적성 잔차Zero policy residual versus optimality residual

교실에서 항상rest의 값이(2,2), γ=1/2다. ready의 practice는3점 뒤 두 상태각1/2다. tired의 practice는0점 뒤tired이며 rest는두상태각1/2로1점을 준다. 정책 잔차0인데 최적성 최대노름 잔차는?

Always-rest classroom values are (2,2) at γ=1/2. Ready/practice pays 3 then either state equally; tired/practice pays zero then tired, while tired/rest pays one then either state equally. What is the optimality sup-norm residual despite zero policy residual?

풀이와 확인할 이유Solution and explanation

ready의 최적 백업은practice의4, tired는rest의2다. 원래(2,2)와차는(2,0)이어서잔차2다. 선택한 정책 식을 푼 것만으로 다른 행동의 개선 가능성이 사라지지는 않는다.

The optimal backup is (4,2), so its difference from (2,2) is (2,0), with sup-norm residual two. Solving the current policy equation does not remove improvements from other actions.

28. 최대노름과 오차 상쇄Sup norm avoids cancellation

U=(5,3),V=(4.8,3.4)다. 최대노름 차이와 부호 있는 차이의 합을 비교하라.

Let U=(5,3), V=(4.8,3.4). Compare the sup-norm difference with the sum of signed entry differences.

풀이와 확인할 이유Solution and explanation

차이는(0.2,−0.4)다. 최대절댓값은0.4이며 부호합은−0.2다. 후자는 상쇄로 최대 오차를 숨기고 음수도 될 수 있어 오차 크기의 노름이 아니다.

Differences are (0.2,−0.4). The largest absolute entry is 0.4; the signed sum is −0.2. Cancellation and a possible negative result prevent that sum from being an error norm.

29. 최대 행동이 달라도 부등식A bound with different maximizers

행동별 u=(3,1),v=(2,4)다. |maxu−maxv|와 max|u−v|를 계산하고 최대값 부등식을 확인하라.

Action tables are u=(3,1), v=(2,4). Compute |maxu−maxv| and max|u−v|.

풀이와 확인할 이유Solution and explanation

왼쪽은|3−4|=1, 오른쪽은max(1,3)=3이므로1≤3이다. 두 최대 행동은 서로 다르지만 부등식은 성립한다. 최대 행동이 고정된다고 가정하지 않는 축약 증명에 쓰인다.

The left side is one; the right side is max(1,3)=3. Thus the inequality holds although maximizing actions differ, as required for the contraction proof.

30. 축약계수로 차이를 묶기Bounding a contracted difference

같은 유한 MDP에서 ||U−V||∞=4, γ=1/2다. 최적 Bellman 백업 뒤 차이의 상한은? 반드시 그 상한과 같은가?

For one finite MDP, ||U−V||∞=4 and γ=1/2. Bound the difference after optimal Bellman backups. Must equality hold?

풀이와 확인할 이유Solution and explanation

축약성으로||T*U−T*V||∞≤2다. 특정 전이의 평균이나 최대 행동의 구조 때문에 더 작을 수 있다. 공통 상한이지 모든 입력이 정확히 절반 차이가 된다는 등식은 아니다.

Contraction gives ||T*U−T*V||∞≤2. Averaging or action structure may make it smaller. This is a bound, not equality for every pair of vectors.

31. 네 단계 뒤 꼬리 상한A tail bound after four stages

V0=0, 모든 보상절댓값≤3, γ=1/2다. 네 번 가치 반복 뒤 V*와의 공통 최대노름 오차 상한은?

Start V0=0 with absolute rewards at most three and γ=1/2. Bound value error after four optimal backups.

풀이와 확인할 이유Solution and explanation

γ의4승은1/16이다. 꼬리상한은(1/16)3/(1/2)=3/8이다. 다른 초기값을 쓰면0초기의 유한기간 꼬리 식을 그대로 적용하지 않고 초기 가치 오차나 말단 보상을 고려한다.

The tail bound is (1/16)·3/(1/2)=3/8. A different initial vector requires an initial-error or terminal-payoff argument rather than copying this zero-initialized bound.

32. 잔차와 가치 오차를 나누기Convert residual into a value-error bound

γ=0.9이고 현재 최적성 잔차δ=0.01이다. 현재 가치표의 최대노름 오차 상한을 구하라.

At γ=0.9, the current optimality residual is δ=0.01. Bound the current value-vector error.

풀이와 확인할 이유Solution and explanation

δ/(1−γ)=0.01/0.1=0.1이다. 잔차0.01 자체를 가치 오차 상한이라고 쓰면10배 작게 주장한다. 이 상한은 정한 유한 할인 모형의 V*에 대한 것이며 원자료 오류까지 묶지 않는다.

The bound is δ/(1−γ)=0.1. Calling the residual itself the value-error bound understates it tenfold. This bounds error relative to the declared model’s V*, not errors in its source assumptions.

33. 보고하는 표의 잔차Residual of the reported vector

교실 γ=1/2에서 동기식 반복이(3,1)→(4,2)→(4.5,2.5)이고 최적 값은(5,3)이다. (4,2)를 보고할 때 잔차와 상한·실제오차는?

At γ=1/2 the classroom iteration goes (3,1)→(4,2)→(4.5,2.5), with optimum (5,3). When reporting (4,2), give its residual, bound and actual error.

풀이와 확인할 이유Solution and explanation

보고표의 다음 백업과 차이는(0.5,0.5)여서잔차1/2다. 상한은(1/2)/(1/2)=1이며 실제최대오차도1이다. 앞 표(3,1)의 잔차1을 새 표에 붙이면 수치의 소유 시점이 섞인다.

The next backup differs by (0.5,0.5), giving residual 1/2. The error bound is one, equal to actual error against (5,3). Reusing residual one from the preceding vector mixes time references.

34. 정지 기준의 반복 횟수Iterations needed for a tolerance

교실 γ=1/2의 k≥1번째 값은 (5−2^(2−k),3−2^(2−k))이다. 오차 상한 2^(2−k)≤1/1000을 처음 만족하는 정수 k는?

For classroom γ=1/2, the kth vector for k≥1 is (5−2^(2−k),3−2^(2−k)). Find the first integer k with error bound 2^(2−k)≤1/1000.

풀이와 확인할 이유Solution and explanation

k=11이면 2^(2−11)=1/512로 아직 1/1000보다 크다. k=12에서 1/1024가 처음 충족한다. 반복식의 지수와 실제 프로그램의 완료 갱신 수를 함께 대조한다.

At k=11, exponent 2−11=−9 gives 1/512, still too large. At k=12, 1/1024 first satisfies the tolerance. Check the exponent and the implementation’s update count together.

35. 두 고정점의 거리는0Two fixed points must coincide

T가 γ=0.9 축약이고 U,V가 둘 다 고정점이다. 거리 d=||U−V||∞가 왜 0인지 보이라.

T is a contraction with γ=0.9 and both U and V are fixed points. Show their distance d is zero.

풀이와 확인할 이유Solution and explanation

d=||TU−TV||∞≤0.9d이므로 0.1d≤0이다. 거리는 비음수이므로 d=0이고 모든 상태값이 같다. 이 논리는 유일성을 보이며 존재는 완비성과 반복열 수렴을 따로 사용한다.

d=||TU−TV||∞≤0.9d implies 0.1d≤0. Since distance is nonnegative, d=0 and every entry agrees. This proves uniqueness; existence additionally uses completeness and convergence of iterates.

36. 1에 가까운 할인율A discount close to one

현재 잔차가 같은 0.01일 때 γ=0.5와 0.99의 가치 오차 상한을 비교하라.

For residual 0.01, compare value-error bounds at γ=0.5 and 0.99.

풀이와 확인할 이유Solution and explanation

각각 0.01/0.5=0.02,0.01/0.01=1이다. 잔차가 같아도 후자는 상한이 50배 크다. 할인율 1 근처에서는 작은 잔차·많은 반복이 필요할 수 있고 표시 그래프의 평평함만으로 정확도를 판단하지 않는다.

Bounds are 0.02 and one, a factor of fifty. A near-unit discount may require a much smaller residual and more iterations. Visual flatness alone does not establish accuracy.

37. 정상 결정론 정책 수Count stationary deterministic policies

세 상태의 가능한 행동 수가 2,3,2다. 정상 결정론 정책은 몇 개이며 이 수가 작용소를 한 번 계산하는 비용과 같은가?

Three states have 2, 3 and 2 available actions. Count stationary deterministic policies. Is that also one backup’s computational cost?

풀이와 확인할 이유Solution and explanation

상태마다 하나를 고르므로 2×3×2=12개다. 한 백업은 상태·행동·결과의 표를 읽는 계산이고 12정책을 모두 평가하는 계산과 다르다. 정책 반복은 후보를 개선하며 평가하는 알고리즘이다.

There are 2·3·2=12 policies. A backup traverses state-action-outcome entries; it does not evaluate all twelve policies. Policy iteration evaluates and improves selected candidates.

38. 한 번 평가 제한의 소유 관계Association at a one-evaluation cap

시작 정책 (rest,rest)의 정확한 값은 (2,2)이고 개선 후보는 (practice,rest)이다. 평가 제한 1에서 새 후보 값을 (2,2)라고 표시해도 되는가?

The initial policy (rest,rest) evaluates to (2,2), then improves to candidate (practice,rest). At evaluation cap one, may the new candidate be assigned values (2,2)?

풀이와 확인할 이유Solution and explanation

아니다. (2,2)는 평가한 rest·rest의 값이다. 새 후보는 미평가로 따로 표시한다. 다음 평가에서 그 후보의 (5,3)을 계산할 수 있다. 값·정책·완료 상태를 같은 평가 시점에 맞춰야 한다.

No. Values (2,2) belong to the evaluated rest/rest policy. Report the new candidate as unevaluated; its values (5,3) require the next evaluation. Keep values and status tied to the policy actually evaluated.

39. 평가0회에서 없는 값Values absent at zero evaluations

정책 반복의 평가 제한을 0으로 정했다. 초기 정책은 있다. 평가 정책·가치·최적성 인증을 어떻게 보고해야 하는가?

Policy iteration has evaluation cap zero and a starting candidate. How should evaluated policy, values and optimality certification be reported?

풀이와 확인할 이유Solution and explanation

평가 정책과 가치는 null이다. 최적성 인증은 false이며 초기 정책은 다음 후보로 남는다. 계산하지 않은 값을 0벡터로 채우면 초기 추정치와 정확 평가 결과가 혼동된다.

Evaluated policy and values are null, with certification false. The initial policy remains the next candidate. Filling absent values with zeros would confuse an arbitrary estimate with an exact evaluation.

40. 동률에서 현재 행동 유지Keep the current action on ties

한 상태 두 행동 a,b가 모두 0보상 자기 순환이고 γ=1/2다. 현재 정책 b에서 정책 반복의 정해진 동률 규칙은 어떻게 작동하며 최적 정책은 유일한가?

Two actions a,b both self-loop with zero reward, γ=1/2. Starting from b, what does the keep-current tie rule do? Is the optimal policy unique?

풀이와 확인할 이유Solution and explanation

가치 0에서 Qa=Qb=0이므로 b를 유지하고 안정 최적 정책으로 끝난다. a도 최적이다. 유일한 것은 고정점 가치 0이며 정책은 유일하지 않다. 선언 순서 첫 행동으로 불필요하게 바꿀 필요가 없다.

Both Q values are zero, so b is retained and stability certifies optimality. Action a is also optimal. The value fixed point is unique; the optimal policy need not be.

41. 국가 값·성장률·쌍의 수Counts of GDP values, growth rates and pairs

한국 1999~2024년 GDP값 26개에서 인접 성장률과 그 성장 밴드 인접 쌍을 만든다. 빠진 연도가 없을 때 각각 몇 개인가?

Twenty-six Korean GDP values cover 1999–2024 without gaps. How many adjacent annual growth rates and adjacent growth-band pairs result?

풀이와 확인할 이유Solution and explanation

성장률은 이웃 GDP 두 개가 필요해 26−1=25개다. 성장 밴드 25개의 인접 쌍은 25−1=24개다. GDP값 26개를 전이 행 분모로 사용하면 변환 단계가 뒤섞인다.

Adjacent GDP pairs give 25 growth rates; adjacent pairs among their bands give 24 transitions. Using 26 as a transition denominator confuses different transformation stages.

42. 전이 행의 올바른 분모Correct denominators for transitions

관측 성장 밴드 쌍은 slow→slow 2,slow→fast 2,fast→slow 3,fast→fast 17이다. 두 출발 행 전이 확률과 분모를 구하라.

Observed band pairs have counts slow→slow 2, slow→fast 2, fast→slow 3, fast→fast 17. Normalize each departure row.

풀이와 확인할 이유Solution and explanation

slow 행 분모 4에서 (1/2,1/2),fast 행 분모 20에서 (3/20,17/20)다. 전체 24로 나누면 결합 쌍의 비중이며 조건부 전이 행이 아니다. 전체 밴드 횟수 slow 5,fast 20과도 출발 분모는 같지 않을 수 있다.

The slow row has denominator four and probabilities (1/2,1/2); the fast row has denominator twenty and (3/20,17/20). Dividing by all 24 gives joint-pair shares, not conditional transition rows. Band totals can differ from outgoing counts.

43. 가정한 지원의 확률 이동A hypothetical support probability shift

기준 fast 확률이 slow 출발 1/2,fast 출발 17/20이다. 남은 slow 목적지 질량의 1/5을 fast로 옮긴다고 가정하면 새 fast 확률은?

Baseline fast-destination probabilities are 1/2 from slow and 17/20 from fast. Assume support shifts one-fifth of remaining slow mass to fast. Compute the new probabilities.

풀이와 확인할 이유Solution and explanation

첫 행은 1/2+(1/5)(1/2)=3/5다. 둘째는 17/20+(1/5)(3/20)=88/100=22/25다. 기준 확률 자체를 1/5 증가시키거나 무조건 0.2를 더하는 다른 규칙과 구분한다. 이 변화는 관측된 정책 효과가 아니다.

The new probabilities are 1/2+(1/5)(1/2)=3/5 and 17/20+(1/5)(3/20)=22/25. This differs from increasing the original probability by 20% or adding 0.2. The shift is assumed, not measured policy impact.

44. 관측 평균을 보상으로 쓰는 범위Scope of an observed-mean reward proxy

slow·fast 밴드 평균 성장률을 한 번 소수 3자리로 반올림해 0.971,3.922라는 보상 대용 점수를 만들었다. 원본 GDP토큰과 이 점수는 같은 자료인가?

Slow and fast mean growth rates are rounded once to three decimals, giving reward proxies 0.971 and 3.922. Are these identical to original GDP tokens?

풀이와 확인할 이유Solution and explanation

아니다. 원본은 연도별 실질 GDP수준이고 성장률은 비율 변환,밴드 평균은 집계,반올림 점수는 추가 전처리다. 모든 단계를 공개해야 재현할 수 있다. 이 대용 점수를 국민 후생이나 실제 지원 성과라고 바꿔 부를 수 없다.

No. Original records are GDP levels; growth is a ratio transformation, band means are aggregates, and rounding adds preprocessing. Publish every step for reproducibility. The proxy is neither national welfare nor observed support impact.

45. 기준 국가 정책의 두 식Two equations for the baseline country policy

γ=9/10,전이는 [[1/2,1/2],[3/20,17/20]],도착 slow 보상 971/1000,fast 보상 1961/500이다. 항상 baseline 정책의 연립식을 쓰고 값을 확인하라.

At γ=9/10, transitions are [[1/2,1/2],[3/20,17/20]], with destination rewards 971/1000 for slow and 1961/500 for fast. Write and solve the always-baseline equations.

풀이와 확인할 이유Solution and explanation

기대 보상은 4893/2000과 69587/20000이다. x=4893/2000+(9/20)(x+y),y=69587/20000+(27/200)x+(153/200)y다. 소거하면 x=428127/13700,y=112196/3425다. 원식 대입으로 확인하며 지원 행동의 최적성은 따로 Q 비교를 해야 한다.

Expected rewards are 4893/2000 and 69587/20000. Equations are x=4893/2000+(9/20)(x+y) and y=69587/20000+(27/200)x+(153/200)y. Elimination gives x=428127/13700 and y=112196/3425. Checking support optimality requires separate Q comparisons.

46. 픽셀 관측의 조건부 도수Conditional pixel counts

두 픽셀 밴드 도수가 pale/pale 295,pale/ink 283,ink/pale 462,ink/ink 757이다. P45가 ink일 비중과 P18이 ink인 조건의 비중을 각각 구하라.

Joint pixel counts are pale/pale 295, pale/ink 283, ink/pale 462 and ink/ink 757. Find the P45-ink share unconditionally and conditional on P18 ink.

풀이와 확인할 이유Solution and explanation

전체 1797 중 P45 ink는 283+757=1040이므로 1040/1797이다. P18 ink인 조건은 462+757=1219행만 남겨 757/1219다. 같은 분자·분모 질문이 아니며 공개 행동 후 조건부 전이는 후자를 쓴다.

P45 ink has 1040 of 1797 rows. Conditioning on P18 ink retains 1219 rows and gives 757/1219. The reveal transition after observing P18 uses the conditional fraction.

47. 두 픽셀을 본 뒤 예측Prediction after both pixels are revealed

두 픽셀 ink인 757행에서 숫자 0이 149행으로 최다이다. 즉시 0예측의 기대 보상은? 그 상태에서 할인율을 곱하는가?

Among 757 both-ink records, digit zero is most frequent with 149 rows. What is the immediate reward expectation for predicting zero, and is it discounted at that decision?

풀이와 확인할 이유Solution and explanation

현재 예측 보상 기대값은 149/757이다. 예측 뒤 terminal 가치는 0이므로 Q=149/757+γ·0이다. 이전 단계에서 이 상태로 오기를 평가할 때 그 미래 값에 γ를 곱한다. 보상 시점을 두 번 할인하지 않는다.

Immediate expectation is 149/757. Prediction reaches terminal, so Q=149/757+γ·0. A preceding decision discounts this state’s continuation value; do not discount the same timing twice.

48. 확인한 test 자료의 성능 주장Claims about inspected test records

이미 확인한 1797개 제공 test 라벨에서 가장 많은 숫자 3이 183개다. 아무 픽셀 없이 3을 예측하는 적중 비중을 구하고 새 개인 성능으로 일반화 가능한지 설명하라.

Among 1,797 inspected provided-test labels, digit three occurs 183 times. Find the hit fraction from always predicting three without pixels. Can it be reported as new-person performance?

풀이와 확인할 이유Solution and explanation

비중은 183/1797=61/599다. 이는 이 보관 표 내 경험 비중이다. 라벨을 보고 규칙을 정했고 새 자료 평가를 하지 않았으므로 미지의 새 작성자 성능을 입증하지 않는다. 실제 작성자 신원도 이 행 번호만으로 알 수 없다.

The fraction is 183/1797=61/599. It describes the inspected retained table. Choosing the rule after seeing labels does not evaluate new records or unseen writers, and row numbers do not identify individual writers.

49. 두 번 조회하는 전략의 순가치Net value of two inspections

두 픽셀 조합별 최다 라벨 도수 합이 470이고 전체 1797행이다. 반드시 두 픽셀을 조회한 뒤 최다 라벨을 예측한다. 조회당 비용 1/50,γ=9/10일 때 처음 가치는?

Most-common-label counts across the four two-pixel contexts sum to 470 of 1,797 records. Commit to revealing both pixels before predicting. With inspection cost 1/50 and γ=9/10, find initial value.

풀이와 확인할 이유Solution and explanation

첫 비용은 −1/50,둘째는 −(9/10)(1/50),예측 보상은 (9/10)^2(470/1797)이다. 합은 52069/299500이다. 두 번 지연한 예측과 서로 다른 시점의 비용을 구분한다. 이 계산만으로 다른 모든 전략보다 좋다는 증명은 아니다.

Value is −1/50−(9/10)(1/50)+(9/10)^2(470/1797)=52069/299500. Separate the two cost timings from the twice-delayed prediction. This evaluates the committed strategy; comparing all alternatives is a separate optimization.

50. 조회 비용을 크게 올리면Increasing inspection cost

두 픽셀 후 성공 비중 470/1797,즉시 최다 예측 성공 비중 183/1797,γ=9/10이다. 조회 비용을 매번 1/5로 올리면 두 번 조회 고정 전략과 즉시 예측 중 어느 것이 더 큰가?

Two-pixel prediction succeeds on 470/1797, immediate majority prediction on 183/1797, and γ=9/10. At inspection cost 1/5 each time, compare the committed two-inspection strategy with immediate prediction.

풀이와 확인할 이유Solution and explanation

조회 전략은 (81/100)(470/1797)−(1/5)(1+9/10)=1269/5990−19/50로 음수다. 즉시 예측 61/599는 양수여서 더 크다. 이 비교는 두 전략 사이의 결론이며 한 번만 조회하는 모든 전략의 최적성을 대신 판정하지 않는다.

The inspection strategy gives 1269/5990−19/50, which is negative. Immediate prediction gives positive 61/599 and is better. This compares these two strategies, not every possible one-inspection strategy.

51. 실제 송장의 배치 수Batches in an actual invoice

일곱 실제 주문 수량은 6,6,8,6,6,2,6이다. 교육 가정 2개당 노동 1배치로 변환해 배치 목록·합·균등 추출 평균을 구하라.

Seven actual order quantities are 6,6,8,6,6,2,6. Under a chosen two-items-per-labor-batch equivalence, find batches, their total and the uniform-line mean.

풀이와 확인할 이유Solution and explanation

배치는 3,3,4,3,3,1,3이며 합 20,평균 20/7이다. 원상품 수량 합은 40이다. 다른 상품이 같은 재고라는 뜻은 아니며 노동 부하 환산과 균등 선택은 실습 가정이다.

Batches are 3,3,4,3,3,1,3, totaling twenty and averaging 20/7. Original item count totals forty. Labor equivalence and uniform-line sampling are assumptions, not a claim of fungible inventory.

52. 대기열의 한 행동 전이One queue action transition

대기 4에서 능력 2를 사면 2를 먼저 처리한다. 도착 배치 1,3,4의 확률은 1/7,5/7,1/7이다. 다음 대기는 4로 상한 처리하고 초과를 기록한다. 다음 분포·기대 초과는?

At backlog four choose capacity two and serve two first. Arrival batches 1,3,4 have probabilities 1/7,5/7,1/7. Cap retained backlog at four and record overflow. Find next-state probabilities and expected overflow.

풀이와 확인할 이유Solution and explanation

잔여 2에 도착을 더하면 3,5,6이다. 다음 대기는 3,4,4여서 P3=1/7,P4=6/7이다. 초과는 0,1,2여서 기대값 (5+2)/7=1이다. 상한 처리 전에 초과를 계산해야 잃은 작업량이 보존된다.

Pending totals are three, five and six. Retained backlog becomes three, four and four, giving probabilities 1/7 and 6/7. Overflow is zero, one and two, averaging one. Compute overflow before truncation.

53. 기업 점수의 기대 보상Expected company teaching reward

대기 4·능력 2에서 처리 2,능력 비용은 개당 1,처리 점수 개당 3,초과 벌점 1/2,다음 대기 비용 1/10이다. 도착 1,3,4 확률 1/7,5/7,1/7일 때 기대 보상은?

At backlog four/capacity two, serve two. Rewards use three per served batch, cost one per selected capacity, overflow penalty 1/2 and next-backlog charge 1/10. Arrivals 1,3,4 have probabilities 1/7,5/7,1/7. Find expected reward.

풀이와 확인할 이유Solution and explanation

기본 처리 순점수는 6−2=4다. 도착별 보상은 4−0−0.3=3.7,4−0.5−0.4=3.1,4−1−0.4=2.6이다. 평균은 (3.7+5×3.1+2.6)/7=109/35다. 이는 파운드 이윤이 아닌 가정한 점수다.

Base score is 6−2=4. Outcome rewards are 3.7, 3.1 and 2.6. Their weighted mean is (3.7+5·3.1+2.6)/7=109/35, in assumed teaching credits rather than sterling profit.

54. 전량 처리 정책의 가치Value of the clear-all-backlog policy

기업 대기열에서 능력=현재 대기 s로 매번 전량 처리한다. γ=9/10,도착 평균 20/7,도착은 0~4범위다. 처리 점수 3·능력 비용 1·대기 비용 1/10이고 초과는 없다. V(s)=2s+K의 K를 구하라.

Always choose capacity equal to backlog s and clear all. Discount is 9/10, mean arrivals 20/7 and arrivals lie in 0–4. Scores are three per served batch, capacity cost one and next-backlog charge 1/10, with no overflow. Solve V(s)=2s+K.

풀이와 확인할 이유Solution and explanation

즉시 평균은 2s−2/7이다. 다음 가치 평균은 40/7+K이므로 K=−2/7+(9/10)(40/7+K)=34/7+(9/10)K다. 따라서 K=340/7이고 값은 s=0~4에서 340/7,354/7,368/7,382/7,396/7이다. 이 정책의 평가이며 다른 행동 Q 비교로 최적성을 따로 확인한다.

Mean immediate reward is 2s−2/7; mean continuation value is 40/7+K. Thus K=34/7+(9/10)K, giving K=340/7. Values for s=0…4 are 340/7,354/7,368/7,382/7,396/7. Compare other action Q values separately to establish optimality.

55. 대기0에서 능력을 사는 이유가 있는가Buying capacity with no backlog

처리 후 작업이 도착하는 대기열이다. 현재 대기 0에서 능력 a를 사도 처리량 0이며 도착 법칙은 a와 무관하다. 능력 비용은 a점이다. 다른 조건이 같을 때 a=0과 a=4의 Q 차이는?

In a queue, arrivals occur after service. With backlog zero, buying capacity a serves zero and does not change arrivals, but costs a points. Compare Q for capacities zero and four.

풀이와 확인할 이유Solution and explanation

다음 상태와 다른 보상은 같고 능력 4만 4점 더 지불하므로 Q0−Q4=4다. 따라서 0이 더 좋다. 능력을 사면 현재 이후 도착도 처리할 수 있다는 다른 시점 규칙을 몰래 넣으면 다른 문제가 된다.

Successors and other rewards match; capacity four merely costs four more. Hence Q0−Q4=4 and zero is preferable. Allowing the purchased capacity to process later arrivals would change the task’s timing.

56. 할인1의 두 반례Two counterexamples at discount one

한 상태 자기 순환 γ=1에서 보상 1인 경우와 보상 0인 경우를 비교하라. 유한 할인 정리의 어떤 결론이 깨지는가?

Compare one-state self-loops at γ=1 with reward one and reward zero. Which discounted-theorem conclusions fail?

풀이와 확인할 이유Solution and explanation

보상 1이면 합 1+1+…가 발산해 유한 가치가 없다. 보상 0이면 V=V를 모든 상수가 만족해 고정점 유일성이 없다. 그렇다고 유한 기간이나 적절한 종료 조건을 갖춘 다른 무할인 문제까지 불가능하다는 뜻은 아니다.

Reward one gives a divergent return, so finite value fails. Reward zero makes every constant a fixed point, so uniqueness fails. This does not rule out finite-horizon or properly terminating undiscounted problems.

57. 자원 제한의 정직한 결과Honest reporting of a resource cap

정확 분수 반복이 작업량 제한에 걸려 끝나지 않았다. 마지막 일부 값을 최적 값 0으로 대체해 반환해도 되는가?

An exact-rational computation exceeds its work cap. May unfinished values be replaced by zero and returned as optimal?

풀이와 확인할 이유Solution and explanation

아니다. 자원 거부를 원자적으로 보고해야 한다. 정상적으로 완료한 횟수 제한 결과는 현재 값·현재 잔차·미완료 상태를 가질 수 있지만 예외 중 일부 값을 완료 최적 값으로 꾸미면 안 된다. 계산상 0과 계산하지 않음은 다르다.

No. Report an atomic resource rejection. A successfully completed capped algorithm may report its current vector, residual and incomplete status, but an exception’s partial values are not finished optima. Zero differs from uncomputed.

58. 라이브 계산과 보관 실행Live calculation and archived execution

웹에서 비용을 바꾸면 JavaScript 결과가 바뀐다. 옆의 Python/R 보관 실행은 기본 설정의 기록이다. 비용을 바꿀 때마다 Python/R도 실행되었다고 말해도 되는가?

Changing a web cost updates JavaScript results, while adjacent archived Python/R runs use fixed default settings. Can each control change be described as a new Python/R execution?

풀이와 확인할 이유Solution and explanation

아니다. 라이브 계산은 브라우저 JS이며 보관 출력은 적힌 코드·입력·환경에서 별도로 실행한 것이다. 새 설정을 Python/R로 검증하려면 다운로드한 독립 코드에 같은 설정을 주어 새 로그를 남겨야 한다. 실행 언어와 검증 범위를 분리한다.

No. The live calculation is browser JavaScript; archived outputs document separate fixed-code/input/environment runs. Verifying a new setting in Python/R requires running the standalone program with that setting and retaining new logs.

59. 원자료 가격과 가정한 비용Original prices versus assumed costs

실제 송장에는 파운드 단가가 있지만 대기열 능력 비용을 1점으로 정했다. 표에서 이 1을 실제 인건비라고 설명해도 되는가?

Original invoice rows contain sterling unit prices, but the queue model chooses capacity cost one credit. May this be labeled observed labor cost?

풀이와 확인할 이유Solution and explanation

아니다. 상품 단가와 처리 능력 비용은 다른 개념이고 자료에 인건비가 없다. 원본 단가 토큰은 보존하되 학습용 비용 1점과 단위·출처를 분리한다. 실제 운영 적용에는 작업 시간·인건비·도착 기록 등 별도 자료가 필요하다.

No. Product prices and processing-capacity costs are different quantities; the invoice supplies no labor-cost measure. Preserve original price tokens while labeling the one-credit cost assumed. Operational application needs workload-time, staffing and arrival records.

60. 학자와 영상을 비판적으로 읽기Read scholars and lectures critically

Bellman 소개와 MDP 공식 강의를 본 뒤 교실 예제로 설명문을 쓴다. 이름·연도 외에 어떤 식·가정·계산을 포함해야 이해를 보일 수 있는가?

After reading Bellman’s introduction and an official MDP lecture, explain the classroom example. Beyond names and dates, what equation, assumptions and calculation demonstrate understanding?

풀이와 확인할 이유Solution and explanation

첫 보상과 미래를 G=R+γGnext로 분리하고 조건부 평균으로 정책 Bellman식을 쓴다. 유한 상태·유계 보상·0≤γ<1과 행동 전 선택 시점을 명시한다. 예를 들어 항상 rest의 (2,2)와 개선 정책의 (5,3)을 직접 대입하고 정책 평가·최적화의 차이를 설명한다. 영상 플레이 성공이나 유명 학자 이름이 그 자체로 모형의 현실 타당성을 보증하지 않는다.

Separate first reward and continuation as G=R+γGnext, then use conditional expectation for the policy equation. State finite states, bounded rewards, 0≤γ<1 and action-before-outcome timing. Verify always-rest values (2,2) and improved values (5,3), distinguishing evaluation from optimization. Successful playback or a famous name does not establish real-world validity.

자료와 출처Data and sources

실습에 추가한 실제 입력과 출처Additional observed lab inputs and provenance

실제 자료 사례Actual-data cases · 원자료·단위·결측·변환·출처Inputs, units, missingness, transformations and sources

자료별 확보일·원행 식별·단위·이용 조건은 출처 기록을 확인하세요. 학습 사본은 제공처의 현재 최신 자료와 다를 수 있습니다.Consult each source record for retrieval dates, row identifiers, units and terms. Teaching copies can differ from current provider releases.

자료사전·출처·이용 조건Data dictionary, sources and terms