강화학습·탐험·오프폴리시의 한계RL, exploration and off-policy limitations
경험 한 줄의 갱신부터 탐험·중요도 가중치의 조건까지From a single experience update to the conditions for exploration and importance weighting
실습 6종 · 풀이 포함 연습문제 60개6 labs · 60 exercises with solutions
기초Foundations
1. 선택의 규칙표를 가리면 무엇이 달라질까1. What changes when the rule table is hidden?
피아노 연습을 계속하면 바로 성취 점수를 얻지만 다음에는 피곤할 수 있습니다. 전 장에서는 준비됨 ready와 피곤함 tired, 연습 practice와 휴식 rest의 결과 확률을 모두 알고 계산했습니다. 이제 결과 확률표를 가립니다. 오늘 ready에서 practice를 골라 3점을 받고 tired가 되었다는 경험 한 줄만 보입니다. 이 한 번으로 항상 피곤해진다거나 평균 보상이 정확히 3이라고 결론내릴 수는 없습니다.
그래도 아무것도 못 배우는 것은 아닙니다. 예상했던 값과 실제 받은 점수를 비교하고, 다음 상태에서의 전망을 더해 추정을 조금 바꿀 수 있습니다. 강화학습은 이렇게 선택하고 결과를 받은 경험으로 이후 선택을 개선하는 문제입니다. 이 장의 교실과 점수는 설명을 위한 가정입니다. 뒤의 실제 통계·손글씨·주문 자료와 같은 종류의 관측이라고 부르지 않습니다.
In the previous chapter, the ready/tired piano problem came with a complete table of transition probabilities and rewards. Hide that table now. One recorded experience says: in ready, choose practice, receive 3, then arrive in tired. A single experience does not establish that practice always causes tiredness or that its expected reward is exactly 3.
Learning is still possible. Compare the observation with an earlier estimate, add an estimate of what may follow, and change the estimate by a controlled amount. Reinforcement learning studies improvements to decisions from such feedback. The classroom and its scores are assumed teaching examples; they are not additional observations in the actual economic, handwriting or order datasets.
기초Foundations
2. 한 줄의 경험을 시간순으로 읽자2. Read one experience in its time order
경험은 현재 상태 S_t, 선택 A_t, 받은 보상 R_{t+1}, 다음 상태 S_{t+1}의 순서입니다. 아래첨자 t+1은 선택 뒤 처음 받은 보상을 뜻합니다. 오늘 선택에 대한 첫 보상인데도 할인율을 한 번 곱하는 실수가 흔합니다. 현재 시점에서 첫 보상의 가중치는 1입니다. 보상과 다음 상태는 한 결과로 함께 관측되며, 다음 상태에 도착한 뒤 다시 행동을 정합니다.
St⟶At⟶(Rt+1,St+1)⟶At+1
실습 기록은 행동을 고르기 전에 알고 있던 상태를 적어야 합니다. 정답을 보고 난 뒤 정답을 상태에 넣으면 쉬운 예측처럼 보여도 실제로 선택할 수 없는 규칙이 됩니다. 관측된 보상만 적힌 로그에서는 고르지 않은 행동의 결과를 일반적으로 알 수 없습니다. 손글씨처럼 원래 정답이 보존된 자료는 교육용으로 양쪽 예측의 정오를 계산할 수 있지만, 실제 클릭·치료·인사 의사결정에서도 늘 그런 것은 아닙니다.
An experience is current state S_t, chosen action A_t, received reward R_{t+1}, and successor state S_{t+1}. The index t+1 means the first reward arrives after the action. It does not mean that this first reward should already be discounted. Its weight at time t is one. Reward and successor are observed together before choosing the next action.
St⟶At⟶(Rt+1,St+1)⟶At+1
A logged state must contain information available before the decision. Adding the answer after seeing the outcome creates leakage. Ordinary feedback usually reveals only the chosen action’s result. A retained digit label lets us derive correctness for either prediction in a teaching exercise, but real hiring, treatment or advertising data do not generally reveal every unchosen action’s outcome.
기초Foundations
3. 잘한 행동의 기준부터 분명히 하자3. Make the objective explicit before learning
연습 점수 3은 학생의 행복을 발견한 숫자가 아닙니다. 우리가 연습용으로 정한 평가 단위입니다. 점수를 잘 올리는 규칙이 실제 교육 목표에도 좋은지는 별도로 검토해야 합니다. 즉시 보상은 지금 받은 숫자이고, 가치는 특정 규칙을 앞으로 따를 때 누적 보상에 대한 기대입니다. 이번에 운 좋게 10점을 얻었다고 그 상태의 가치가 정확히 10이 되는 것은 아닙니다.
예측 실습에서는 맞으면 1, 틀리면 0이라는 기준을 씁니다. 기업 작업 실습에서는 처리한 일에 점수를 주고 인력 용량·미처리량에 비용 점수를 붙입니다. 뒤의 비용은 실제 회사의 원가 장부에서 추정한 수치가 아닙니다. 목적을 바꾸면 좋은 정책도 바뀝니다. 정확도만 높은 규칙이 공정성·안전·지연 시간을 만족한다고 저절로 보장되지 않습니다.
A practice score of 3 is a declared teaching unit, not a discovered measure of student happiness. A rule that maximizes it needs a separate argument before becoming an educational recommendation. Reward is the number just received; value is an expected accumulated return under a specified future rule. One lucky reward of 10 does not establish a true state value of 10.
Prediction exercises score a correct answer as 1 and an incorrect answer as 0. The work-game case gives credit for service and deducts chosen capacity and backlog charges. Those charges were not estimated from the company’s accounting records. Changing the objective can change the preferred policy. Accuracy or reward maximization alone does not establish fairness, safety or acceptable delay.
기초Foundations
4. 행동 규칙과 경험 기록을 구별하자4. A decision rule is not its realized log
정책은 각 상태에서 어느 행동을 어떤 확률로 고르는지 나타내는 규칙입니다. ready에서 practice를 확률 1/2로 고르는 정책이라도 열 번의 선택이 정확히 다섯 번씩 나와야 하는 것은 아닙니다. 기록은 정책으로 생성된 한 결과이고, 정책표는 결과를 생성하는 규칙입니다. 아예 고르지 않은 행동이 로그에 없다는 사실만으로 그 행동의 진짜 확률이 0이라고 결론낼 수 없습니다.
b(a∣s)=P(At=a∣St=s)
b는 데이터를 모으는 행동 정책, π는 평가하려는 목표 정책으로 씁니다. 둘이 같으면 온폴리시 평가이고 다르면 오프폴리시 문제입니다. 사람이 모은 자료를 쓴다는 사실만으로 b를 알 수 있는 것은 아닙니다. 특히 정책이 시간이나 과거 이력에 따라 변하면 그 정보를 확률 계산에 포함해야 합니다. 실습은 상태별로 고정된 표를 받는 좁고 명확한 경우부터 다룹니다.
A policy specifies action probabilities in each state. Choosing practice with probability one half need not yield exactly five practice actions in ten trials. The log is a realized sequence; the policy table is the rule generating it. An action absent from a finite log need not have true probability zero.
b(a∣s)=P(At=a∣St=s)
We write b for the behavior policy collecting data and π for the target being evaluated. Equal policies give on-policy evaluation; different policies create an off-policy problem. Human-generated data do not automatically reveal b. A changing policy may require time or history in its probability calculation. Our labs start with fully declared, stationary state-specific tables so the algebra has a precise scope.
기초Foundations
5. 예측·제어·모형 학습은 다른 질문이다5. Prediction, control and model learning ask different questions
경험을 쓰더라도 목표는 구별한다
질문
알아내려는 것
예
정책 예측
지금 정책의 가치
매번 쉬는 규칙의 장기 점수
제어
더 좋은 행동 규칙
언제 연습하고 언제 쉴까
모형 학습
전이·보상 법칙
휴식 뒤 ready가 될 확률
정책 예측은 정해진 규칙을 평가합니다. 규칙을 고정하지 않고 서로 다른 행동의 보상을 그냥 섞으면 무엇의 가치를 구했는지 불분명해집니다. 제어는 규칙 자체를 바꾸려는 문제입니다. 모형 기반 방법은 경험으로 전이·보상표를 추정한 뒤 전 장의 계획 계산을 할 수 있습니다. 모형 없는 방법은 그런 표 전체를 먼저 만들지 않고 가치나 행동 가치를 갱신합니다.
모형이 없다는 말은 가정도 없다는 뜻이 아닙니다. 상태가 충분한지, 환경이 안정적인지, 행동별 경험이 충분한지 여전히 중요합니다. 이 장의 Q-learning 실습은 주어진 로그에 대한 정확한 유한 갱신을 보여 줍니다. 환경의 참된 최적 정책을 유한 기록만으로 증명하는 도구는 아닙니다.
Different aims despite using experience
Question
Object to learn
Example
Policy prediction
Value of a given rule
Long-run score from always resting
Control
A better rule
When to practice or rest
Model learning
Transition/reward law
Chance of ready after rest
Prediction evaluates a given policy. Mixing rewards from changing policies without specifying the target makes the estimand unclear. Control improves the rule itself. A model-based method estimates transition and reward tables before planning. A model-free method updates values or action values without first constructing the complete transition table.
Model-free does not mean assumption-free. State sufficiency, environmental stability and action coverage remain important. Our Q-learning lab computes exact finite updates on supplied experiences. It does not prove that a finite log identifies the true optimal policy of the world.
기초Foundations
6. 진짜 종료와 기록 중단은 다르다6. True termination differs from a recording cutoff
게임에서 목적지에 도착해 정말 끝나면 이후 받을 보상은 없습니다. 반면 10분이 되어 기록을 멈춰도 배송 업무는 계속될 수 있습니다. 전자는 terminated, 후자는 truncated로 구분합니다. 진짜 종료 뒤의 이어지는 가치는 0입니다. 기록 중단 뒤의 가치는 일반적으로 0이 아닙니다. 0으로 놓으면 계속되는 업무를 다른 유한 게임으로 바꾼 셈입니다.
실습은 두 표시를 명시하고 동시에 참으로 넣는 입력을 거절합니다. 진짜 종료의 next는 null입니다. 중단에는 다음 상태를 적습니다. 완료 수익률 계산에서 중단된 꼬리를 쓰려면 별도의 이어지는 가치 추정값을 요구하며, 결과를 완전 관측 수익률이라고 부르지 않습니다. TD와 Q-learning은 중단에서도 현재의 다음 상태 추정값을 사용합니다. 실제 제한 시간이 문제의 일부인 유한 게임은 남은 시간을 상태에 넣고 마지막에 진짜 종료하도록 정의할 수 있습니다.
Reaching a game’s final goal leaves no future rewards. Stopping a delivery recording after ten minutes does not necessarily end the delivery task. We distinguish terminated from truncated. Continuation is zero after true termination; it is generally nonzero after a recording cutoff. Replacing it with zero changes the objective to a different finite game.
The lab requires both flags and rejects their simultaneous use. A true terminal transition has next=null; a truncated transition names its successor. Return calculations require an explicit tail estimate after truncation and label the result as bootstrapped. TD and Q-learning use their current successor estimates there. If the time limit belongs to the actual finite task, include time in the state and terminate genuinely at its end.
기초Foundations
7. 받은 보상을 한 줄씩 더해 보자7. Add received rewards one step at a time
보상 2를 받고, 다음 선택 뒤 4를 받고 게임이 끝났다고 합시다. 할인율 γ=1/2는 한 단계 뒤 점수를 현재의 절반으로 평가한다는 약속입니다. 첫 상태에서의 수익률은 2+(1/2)×4=4이고, 두 번째 상태에서는 4입니다. 평균을 낸 3이나 모든 항을 한 번 더 할인한 2와는 다른 계산입니다.
Gt=k=0∑T−t−1γkRt+k+1,Gt=Rt+1+γGt+1,GT=0
뒤에서부터 계산하면 긴 기록도 실수 없이 더할 수 있습니다. 마지막 보상 4를 적고 한 칸 앞으로 가서 2+γ×4를 계산합니다. 유한하게 끝나는 기록에는 γ=1도 계산할 수 있습니다. 이 사실이 종료를 보장하지 않는 무한 문제에서도 γ=1이 안전하다는 뜻은 아닙니다. 아래 실습에서 보상·할인율·종료 표시를 하나씩 바꿔, 어떤 항이 달라졌는지 확인합니다.
Suppose you receive 2, then receive 4 after the next action, and the game ends. With γ=1/2, the initial return is 2+(1/2)×4=4; the return at the second state is 4. Neither the reward average 3 nor the extra-discounted number 2 is the requested return.
Gt=k=0∑T−t−1γkRt+k+1,Gt=Rt+1+γGt+1,GT=0
Work backward: write the last reward 4, then move one step earlier and compute 2+γ×4. A finite terminal record permits γ=1. That does not make γ=1 safe in an infinite nonterminating problem. In the lab, change rewards, discount and boundary flags separately and identify exactly which term changes.
기초Foundations
8. 행 번호 대신 필요한 정보를 상태에 넣자8. Use relevant information, not just a row number
같은 미처리량 3이어도 오늘이 사흘 게임의 첫날인지 마지막 날인지에 따라 남은 보상이 다릅니다. 그래서 기업 사례 상태는 (회차, 미처리량)입니다. 미처리량만 쓰고 마지막 날의 종료를 숨기면 같은 상태·행동에 서로 다른 시간 규칙을 섞게 됩니다. 관측 기록을 정리하는 일과 Markov 모형을 정당화하는 일은 구별해야 합니다.
국가 예측에서는 작년까지 알 수 있는 성장률 구간을 상태로 사용하지만, 그것이 거시경제의 모든 정보를 담는다고 주장하지 않습니다. 손글씨에서는 예측 전에 보이는 특정 픽셀을 상태로 사용하며 실제 정답은 보상 계산 때만 봅니다. 정책·상태가 단순하다고 현실도 단순한 것은 아닙니다. 어떤 정보를 일부러 버렸는지 적으면 모형의 한계와 다음 개선 과제가 분명해집니다.
A backlog of 3 means different future rewards on the first and final days of a three-day game. The company state therefore includes both round and backlog. Hiding the round while terminating on the final day mixes time-dependent rules in an apparently identical state. Organizing records does not by itself justify a Markov model.
Country prediction uses a growth band available from the prior year without claiming that it captures all macroeconomic information. Digit prediction uses a pixel visible before the action and consults the actual label only to score feedback. A small policy or state does not make reality simple. Naming the information deliberately excluded helps identify limits and useful extensions.
기초Foundations
9. 고르지 않은 선택에 대해서는 무엇을 아는가9. What do we know about actions never tried?
두 식당 중 처음 간 곳에서 7점을 받았다고 매번 그곳만 가면, 아직 가 보지 않은 곳이 9점일 가능성을 배울 기회가 없습니다. 지금까지 가장 좋아 보이는 행동을 쓰는 것은 활용, 정보를 얻으려고 다른 행동도 시도하는 것은 탐험입니다. 탐험 자체에도 기회비용이 있습니다. 새 선택을 해 본 오늘의 점수가 낮아질 수 있기 때문입니다.
이 문제를 “언제나 무작위로 고르자”로 해결하지는 않습니다. 목표는 정보를 얻는 과정과 보상을 얻는 과정을 함께 설계하는 것입니다. 또한 식당마다 결과가 날마다 바뀌거나 혼잡이 내 선택에 반응한다면 단순한 고정 평균 모형부터 의심해야 합니다. 불확실성을 무시해도 안 되고, 현실의 모든 선택을 같은 확률 실험으로 취급해도 안 됩니다.
If the first restaurant earns 7 and you always return, you never learn whether the other would earn 9. Exploitation uses the action currently judged best; exploration tries alternatives to acquire information. Exploration has an opportunity cost because today’s reward may be lower.
The answer is not to choose randomly forever. Design information gathering together with reward seeking. If restaurant outcomes change over time or congestion responds to your actions, a fixed-mean model itself needs scrutiny. Neither ignoring uncertainty nor treating every real decision as the same randomized experiment is adequate.
기초Foundations
10. ε-탐욕은 두 규칙을 섞는 것이다10. Epsilon-greedy mixes two rules
ε-탐욕 정책은 확률 1−ε로 현재 최고 행동을 고르고, 확률 ε로 가능한 모든 행동 중 균등하게 고릅니다. 무작위 가지에서도 최고 행동이 다시 나올 수 있습니다. 행동이 두 개, 최고 행동이 하나, ε=1/5이면 최고 행동의 최종 확률은 4/5+1/10=9/10입니다. 따라서 ε는 실제로 비최고 행동을 고른 비율과 같지 않습니다.
b(a∣s)=m(s)ε+(1−ε)g(a∣s)
m(s)는 그 상태에서 가능한 행동 수, g는 최고 행동에만 확률을 주는 규칙입니다. 확률은 음수가 아니고 전체 합이 1이어야 합니다. ε=0은 현재 추정에 대한 탐욕, ε=1은 모든 가능한 행동의 균등 선택입니다. 최고라는 말은 참된 미래 가치가 아니라 현재 Q 추정표에서 가장 크다는 뜻입니다.
With probability 1−ε, epsilon-greedy chooses a currently best action; with probability ε, it chooses uniformly among all available actions. The random branch can choose the best action again. With two actions, one greedy action and ε=1/5, the final greedy probability is 4/5+1/10=9/10. Thus ε is not the observed proportion of nongreedy choices.
b(a∣s)=m(s)ε+(1−ε)g(a∣s)
Here m(s) counts available actions and g places probability only on greedy actions. Probabilities must be nonnegative and sum to one. Epsilon zero exploits the current estimate; epsilon one chooses uniformly. “Best” refers to the current Q table, not an oracle revealing true future values.
기초Foundations
11. 공동 1등이면 확률을 어떻게 나눌까11. How should probability be shared across tied best actions?
행동 가치가 [5,5,1]이고 ε=1/5라고 합시다. 공동 1등 두 개에 활용 확률을 균등하게 나누면 각각 (4/5)/2+1/15=7/15를 받고, 마지막 행동은 1/15를 받습니다. 첫 번째 최고 행동만 활용하도록 정하면 확률은 13/15,1/15,1/15가 됩니다. 둘 다 선언 가능한 규칙이지만 같은 정책은 아닙니다.
소수 표시에서 둘 다 0.500으로 보여도 정확한 값이 다르면 참된 동률이 아닐 수 있습니다. 실습은 입력된 유리수를 정확히 비교하며, 공동 최고 행동 목록과 선택한 동률 처리 규칙을 함께 보여 줍니다. 실제 측정 오차까지 정확히 안다는 뜻은 아닙니다. Q가 추정값이라는 불확실성과 계산기의 숫자 비교 규약은 구별해야 합니다.
Let Q=[5,5,1] and ε=1/5. Sharing exploitation uniformly across the two tied best actions gives each (4/5)/2+1/15=7/15, leaving 1/15 for the third. Exploiting only the first tied action gives 13/15,1/15,1/15. Both can be declared, but they are different policies.
Two displayed decimals such as 0.500 need not be an exact tie. The lab compares supplied rational values exactly and shows every greedy action together with the tie convention. This does not eliminate measurement uncertainty. Uncertainty about the estimated Q values is separate from the arithmetic rule used to compare them.
기초Foundations
12. 없는 행동까지 탐험하면 안 된다12. Explore only actions that are available
재고가 0이면 배송 1개가 불가능할 수 있습니다. 이때 탐험 확률을 불가능한 행동에 나눠 준 뒤 실행 시 몰래 다른 행동으로 바꾸면, 선언한 정책과 실제 행동 확률이 달라집니다. 중요한 것은 고른 행동의 이름만이 아니라 그때 가능한 행동 집합입니다. 실습에서는 상태별 행동 목록에 없는 로그 행동을 거절합니다.
Q-learning이 다음 상태의 최댓값을 계산할 때도 가능한 다음 행동만 비교합니다. 불가능한 행동에 오래된 높은 숫자가 남아 있다고 그 값으로 현재 행동을 좋게 평가하면 안 됩니다. 정책 평가에 쓰는 확률표와 학습에 쓰는 행동 목록은 같은 규약을 따라야 합니다. 안전이나 자원 제약이 바뀌면 모형의 행동 목록과 기록 방식도 함께 바꿔야 합니다.
Shipping one item may be impossible when stock is zero. Assigning exploration mass to that action and silently replacing it at execution changes the actual behavior probabilities. The available-action set matters along with the chosen label. The lab rejects logged actions absent from their state’s action list.
Q-learning also maximizes only over available successor actions. A stale high number for an impossible action must not inflate the target. Probability tables used for evaluation and action masks used for learning need the same convention. Changed safety or resource constraints require corresponding changes to both model and logging.
기초Foundations
13. 해 본 횟수와 할 수 있는 확률을 구별하자13. Separate observed counts from possible-action support
동전을 세 번 던져 모두 앞면이 나왔다고 뒷면 확률이 0인 것은 아닙니다. 마찬가지로 행동 로그에 right가 없어도 선언한 행동 정책이 right에 확률 1/10을 주었다면 이론적 지원은 있습니다. 다만 지금 기록에는 right의 결과에 관한 직접 정보가 부족합니다. 지원 조건과 유한 표본의 정보량은 서로 다른 문제입니다.
반대로 right의 실제 확률이 0인데 목표 정책이 right를 고른다면, 관측 데이터만으로 그 결과를 평가할 수 없습니다. 실습은 이 지원 공백을 입력 오류로 알립니다. 한 번도 관측되지 않았다는 이유만으로 b를 0으로 추정한 뒤 이론적 불가능이라고 단정하지도 않습니다. 실제 행동 확률을 모를 때는 추정·가정·민감도 분석이 추가로 필요합니다.
Three heads do not establish a zero probability of tails. Likewise, a finite log may contain no right action even when the declared behavior assigns it probability 1/10. Theoretical support exists, but direct information in this particular log is limited. Support and finite-sample information are different issues.
If the true behavior probability of right is zero while the target chooses it, the observed log cannot reveal that action’s outcome. The lab reports this support gap. It also avoids equating an unobserved empirical count with a known zero propensity. Unknown behavior probabilities require further estimation, assumptions and sensitivity analysis.
기초Foundations
14. ε가 줄어든다고 모든 행동을 배우는 것은 아니다14. A decaying epsilon does not ensure every action is learned
처음에는 많이 탐험하고 나중에는 줄이는 생각은 자연스럽습니다. 하지만 ε_t가 양수라는 사실만으로 모든 상태·행동을 충분히 방문한다고 보장할 수 없습니다. 어떤 방에 가려면 드문 행동 두 번을 연달아 골라야 한다고 합시다. 각 행동의 확률이 대략 1/t이면 그 경로 확률은 대략 1/t²가 됩니다. 탐험 횟수의 합에 관한 조건과 깊은 상태를 실제로 방문하는 조건은 같지 않습니다.
GLIE라는 표현은 무한히 탐험하면서 극한에서는 탐욕적으로 되는 성질을 함께 요구합니다. ε=1/t라는 일정 하나를 적었다고 임의의 환경에서 GLIE가 증명되지는 않습니다. 초기 상태, 도달 가능성, 에피소드 재시작, 행동 확률을 함께 보아야 합니다. 유한한 실습에서 방문 횟수를 보여 주는 것은 현재의 부족한 경험을 발견하는 방법이지 무한 방문을 인증하는 방법이 아닙니다.
Exploring more early and less later is sensible, but positive ε_t alone does not ensure adequate visits to every state-action pair. Reaching a room may require two rare actions in sequence. If each has probability roughly 1/t, that route can have probability roughly 1/t². A condition on total exploration is not the same as one on reaching deeper states.
GLIE requires both infinite exploration and greediness in the limit. Writing ε=1/t does not prove GLIE in an arbitrary environment. Initial states, reachability, restarts and action probabilities all matter. A finite visit-count display helps discover missing experience; it cannot certify infinitely many visits.
기초Foundations
15. 낙관적인 초기값과 신뢰상한의 용도15. What optimism and confidence bonuses can do
처음 모든 행동의 값을 높게 적으면, 한 행동을 실제로 시도해 낮아진 뒤 다른 행동이 상대적으로 매력적으로 보일 수 있습니다. 이것이 낙관적 초기값의 직관입니다. 그러나 어떤 행동을 계속 고르게 하는 동률 처리나 잘못된 학습률이 있으면 낙관만으로 충분한 탐험을 보장하지 못합니다. 초기값은 관측 보상과 구별해 적어야 합니다.
bonust(a)∝Nt(a)logt
신뢰상한 방식은 덜 시도한 행동에 보너스를 주어 탐험합니다. 위 식은 이해를 위한 대표적인 모양이며, N=0의 처리와 상수는 구체 알고리즘에서 정합니다. 독립·정상·유계 보상의 단순 밴딧에서 나온 보장을 상태 전이가 있는 모든 강화학습 문제에 그대로 옮길 수는 없습니다. 이 장의 실시간 실습은 ε-탐욕을 구현하며 모든 신뢰상한 알고리즘을 구현했다고 부르지 않습니다.
High initial action values can encourage exploration: after trying one action and reducing its estimate, an untried alternative looks attractive. That is the intuition behind optimistic initialization. But tie rules, learning rates and access to states can still prevent sufficient exploration. Initial assumptions should remain distinguishable from observed rewards.
bonust(a)∝Nt(a)logt
Confidence-bound methods add bonuses for rarely tried actions. This is a representative shape; a specific algorithm must define constants and the zero-count case. Guarantees for an independent, stationary bounded-reward bandit do not automatically apply to every sequential state-transition problem. Our live exploration lab implements epsilon-greedy, not every confidence-bound algorithm.
기초Foundations
16. 탐험할 수 있다는 것과 해도 된다는 것16. Possible exploration is not permission to experiment
게임에서 낮은 점수를 받아 보는 일과 사람에게 불이익을 줄 수 있는 실제 실험은 다릅니다. 탐험은 정보가 부족하다는 수학적 문제를 다루지만, 허용 가능한 행동·동의·피해의 한계를 스스로 정해 주지 않습니다. 비용이나 위험을 모르는 상황에서 무작위로 시도하면 배울 수 있다는 말만으로 실행을 정당화할 수 없습니다.
교육 실습에서는 실제 사람의 행동을 바꾸지 않고 이미 공개된 손글씨 정답과 통계에서 가상 예측 선택을 만듭니다. 기업 사례도 관측 주문을 입력으로 한 가정한 작업 게임입니다. 이 구분을 지키면 안전하게 알고리즘의 차이를 비교하면서도 실제 의사결정으로 옮길 때 무엇이 더 필요한지 생각할 수 있습니다. 다음 절에서는 같은 기록을 두고 “끝까지 받은 점수”와 “다음 추정값”으로 배우는 방법을 비교합니다.
Trying a low-scoring move in a game differs from an experiment that may harm a person. Exploration addresses missing information mathematically; it does not supply consent, acceptable-action constraints or harm limits. A chance to learn does not by itself justify a real intervention with unknown risks.
Our exercises change no person’s treatment or behavior. They construct prediction choices from retained public labels and economic observations. The company example is an assumed work game driven by observed order quantities. This separation allows algorithm comparisons while making clear what further evidence and safeguards real decisions require. Next, compare learning from complete returns with learning from successor estimates.
기초Foundations
17. 끝난 게임의 점수로 가치를 추정하기17. Estimate value from completed games
같은 상태에서 시작해 같은 정책을 따르는 게임을 여러 번 끝냈다고 합시다. 첫 게임의 수익률이 4, 다음이 8, 세 번째가 0이면 관측 평균은 (4+8+0)/3=4입니다. Monte Carlo 정책 평가는 이런 완료 수익률로 상태 가치를 추정합니다. 각 수익률이 꼭 같을 필요는 없고 운에 따른 차이를 평균으로 모읍니다.
V(s)=N(s)1i=1∑N(s)Gi(s)
무엇을 평균내는지 중요합니다. 서로 다른 정책을 섞은 값은 하나의 고정 정책 가치와 같지 않을 수 있습니다. 기록이 끝났다고 과제가 진짜 종료된 것도 아닙니다. 실제 종료 전에 잘린 자료에서 꼬리를 0으로 대체하면 완전한 수익률을 평균낸 것이 아닙니다. 실습의 first-visit-MC는 완료 게임을 기본으로 하고, 중단된 꼬리를 명시적으로 보충한 경우에는 그 사실을 별도로 표시합니다.
Suppose complete games start from a given state under a fixed policy. Returns of 4, 8 and 0 have observed mean (4+8+0)/3=4. Monte Carlo policy evaluation estimates values from such completed returns. Outcomes can differ through chance; averaging combines those experiences.
V(s)=N(s)1i=1∑N(s)Gi(s)
The object being averaged matters. Mixing policies need not estimate one fixed policy’s value. A stopped recording is not necessarily a completed task. Filling an unobserved tail with zero is not averaging complete returns. The first-visit-MC lab defaults to terminal episodes and explicitly identifies any supplied bootstrap tail.
기초Foundations
18. 한 게임에서 같은 상태를 두 번 만나면18. When the same state appears twice in one game
기록이 A에서 보상 1을 받고 다시 A, 보상 2를 받고 B, 보상 4를 받고 종료라고 합시다. γ=1/2이면 마지막부터 수익률은 4, 2+4/2=4, 1+4/2=3입니다. A를 처음 만난 순간의 수익률은 3, 두 번째 A에서는 4입니다. first-visit 방식은 이 게임에서 A의 첫 3만 한 번 사용합니다.
반복 방문과 에피소드 경계를 먼저 확인한다
방식
이번 게임 A에 쓸 값
A 갱신 횟수
First visit
3
1
Every visit
3과 4
2
every-visit 방식이라면 두 수익률을 모두 사용할 수 있고 이 게임만의 A 평균은 7/2입니다. 두 방식이 같은 알고리즘은 아닙니다. 같은 게임 안의 방문은 서로 의존할 수 있으므로 관측 개수만 세어 독립 표본 수라고 부르면 안 됩니다. 실습은 first visit을 구현하고 매 게임마다 “이미 방문했는가” 표시를 새로 시작합니다.
Consider A, reward 1, A again, reward 2, B, reward 4, then termination. At γ=1/2 the backward returns are 4, then 2+4/2=4, then 1+4/2=3. The first A has return 3 and the second has return 4. First-visit MC uses only the first 3 for A in this episode.
Check repeated visits and episode boundaries first
Method
Values used for A in this episode
A updates
First visit
3
1
Every visit
3 and 4
2
Every-visit MC could use both, giving an A average of 7/2 in this one episode. These are different algorithms. Within-episode visits may be dependent, so a count of visits is not automatically an independent sample size. The lab implements first visit and resets its seen-state set at each new episode.
기초Foundations
19. 지난 값을 모두 보관하지 않고 평균 갱신하기19. Update a mean without storing all past returns
이미 n−1개의 평균이 V_old라면 그때까지 합은 (n−1)V_old입니다. 새 값 G를 더하고 n으로 나누면 V_new=V_old+(G−V_old)/n입니다. 새 값과 기존 평균의 차이 중 1/n만 이동한다고 읽을 수 있습니다. 수익률 4,8,0을 순서대로 받으면 V는 4,6,4가 됩니다. 마지막에 한꺼번에 평균낸 값과 같습니다.
Vn=Vn−1+n1(Gn−Vn−1)
여기의 n은 그 상태에 실제 사용한 갱신 횟수입니다. 다른 상태를 방문했다고 이 상태의 분모가 증가하지 않습니다. first-visit MC에서는 같은 에피소드의 두 번째 방문도 분모를 늘리지 않습니다. 실습의 sample-mean은 이 규칙을 쓰며 첫 관측의 학습률은 1입니다. 초기값이 100이었어도 첫 표본평균은 첫 관측값이 됩니다.
If the mean of n−1 observations is V_old, their sum is (n−1)V_old. Add the new return G and divide by n to obtain V_new=V_old+(G−V_old)/n. Move one nth of the gap toward the new observation. For returns 4,8,0 the estimates are 4,6,4, matching the final batch mean.
Vn=Vn−1+n1(Gn−Vn−1)
The count n belongs to updates actually used for this state. Visits elsewhere do not increase its denominator. In first-visit MC, another occurrence in the same episode does not increase it either. The lab’s sample-mean rule starts with step size one, so even an initial estimate of 100 is replaced by the first observation.
기초Foundations
20. 학습률은 새 경험을 얼마나 믿는지 정한다20. A step size controls movement toward new experience
학습률 α=1/2를 고정하면 기존 값과 새 목표값의 중간으로 이동합니다. 초기값 0에서 목표 4,8,0을 받으면 2,5,5/2가 됩니다. 최종 표본평균 4와 다릅니다. 최근 관측의 영향이 더 크기 때문입니다. 변하는 환경을 따라가려는 데 쓸 수 있지만, 같은 참된 평균으로 정확히 수렴하는 보장을 그대로 적용할 수는 없습니다.
Vn=(1−α)nV0+αi=1∑n(1−α)n−iGi
위 전개에는 초기값 항이 남아 있습니다. 유한 n에서 이를 빼면 다른 계산이 됩니다. α=0이면 아무것도 바꾸지 않고, α=1이면 마지막 목표만 남깁니다. 이 장의 입력은 0≤α≤1을 허용하여 이런 끝점도 살펴보게 하지만, 계산 가능한 입력 범위와 무한 시간 수렴 정리의 조건은 같은 것이 아닙니다.
A constant α=1/2 moves halfway from the old value to the new target. Starting at zero, targets 4,8,0 yield 2,5,5/2 rather than the sample mean 4. Recent observations matter more. This can track change, but does not inherit a guarantee of exact convergence to a fixed mean.
Vn=(1−α)nV0+αi=1∑n(1−α)n−iGi
The expansion retains the initial-value term. Dropping it at a finite n changes the computation. Step size zero makes no update; step size one retains only the latest target. The input permits 0≤α≤1 to examine these endpoints, but an allowed finite calculation is not automatically covered by an asymptotic convergence theorem.
기초Foundations
21. 결말을 기다리지 않고 다음 추정값으로 배우기21. Learn from a successor estimate before the ending
A의 추정값이 2, B의 추정값이 6이라고 합시다. A에서 보상 1을 받고 B로 갔으며 γ=1/2라면 TD 목표는 1+(1/2)×6=4입니다. 목표와 기존 값의 차이 δ는 2입니다. α=1/4이면 A의 새 값은 2+(1/4)×2=5/2입니다. B에서 나중에 실제로 몇 점을 받는지 기다리지 않고 갱신했습니다.
δt=Rt+1+γV(St+1)−V(St),V(St)←V(St)+αtδt
이것이 TD(0)입니다. 이어지는 부분을 현재 추정으로 보충하는 것을 부트스트래핑이라 부릅니다. 여기서 bootstrap은 자료를 다시 뽑는 통계 부트스트랩과 다른 용례입니다. 다음 상태의 값도 틀릴 수 있으므로 목표 자체가 참값은 아닙니다. 실습에서는 before, target, error, step size, after를 함께 보며 한 줄의 계산을 손으로 확인합니다.
Let V(A)=2 and V(B)=6. After reward 1 from A to B with γ=1/2, the TD target is 1+(1/2)×6=4. The error δ is 2. With α=1/4, the new A value is 2+(1/4)×2=5/2. We updated without waiting for the eventual rewards after reaching B.
δt=Rt+1+γV(St+1)−V(St),V(St)←V(St)+αtδt
This is TD(0). Filling continuation with a current estimate is called bootstrapping, a different use of the word from statistical resampling. The successor estimate may itself be wrong, so the target is not an oracle. The lab exposes before, target, error, step size and after to support a hand calculation.
기초Foundations
22. 온라인 갱신의 순서는 결과를 바꿀 수 있다22. Online update order can change finite results
처음 A와 B의 값을 모두 0으로 놓고, A→B 보상 0, B→종료 보상 8인 게임을 봅시다. γ=1, α=1로 시간순 갱신하면 A는 당시 B 값 0을 사용하므로 0, B는 8이 됩니다. 같은 게임을 두 번째 보면 A도 이제 B의 8을 사용하여 8이 됩니다. 첫 게임의 A 값을 뒤늦게 자동으로 8로 고친 것은 아닙니다.
MC는 첫 게임이 끝난 뒤 A의 완성 수익률 8을 바로 사용할 수 있습니다. TD가 언제나 더 빠르거나 더 정확하다는 결론은 이 예에서 나오지 않습니다. 경험이 전달되는 경로, 초기값, 방문 순서, 학습률에 따라 차이가 납니다. 실습의 trace는 갱신 바로 직전의 값을 기록합니다. 화면 마지막의 B 값을 처음 갱신의 target에 소급해 넣으면 실제로 실행한 알고리즘과 달라집니다.
Start with V(A)=V(B)=0 and observe A to B with reward 0, then B to termination with reward 8. At γ=1 and α=1, chronological TD updates A to zero because B is still zero, then B to 8. On the second identical episode, A can use B’s new estimate and becomes 8. The first A update was not automatically revised afterward.
MC can use the complete return 8 for A after the first episode. This example establishes no universal speed or accuracy ordering between MC and TD. Information paths, initialization, visit order and step sizes matter. The trace records pre-update values; substituting the final B value retroactively into the first target describes a different algorithm.
기초Foundations
23. 목표값의 편향과 변동성을 함께 보자23. Examine both bias and variability of targets
완전한 에피소드를 올바른 정책으로 뽑았다면 수익률 G는 해당 시작 상태의 정책 가치에 대한 표본입니다. 다만 여러 미래 행동·전이·보상에 흔들릴 수 있습니다. TD 목표는 한 단계의 관측만 사용하지만 뒤를 현재 V로 메우므로 V가 틀린 만큼 편향될 수 있습니다. 실제 참값 vπ를 뒤에 넣은 목표와 추정값 V를 넣은 목표는 다릅니다.
“MC는 변동성이 크고 TD는 작다”는 말은 흔한 직관이지 모든 환경·초기값·학습률에 대한 엄밀한 대소 비교가 아닙니다. 같은 평가용 기록에서 여러 반복 실험을 비교하고 편향과 분산을 구별해야 합니다. 또 TD의 sample-mean 학습률은 움직이는 목표들을 평균내므로 완료 수익률의 단순 평균과 일반적으로 같지 않습니다. 갱신 식의 모양이 비슷하다고 추정 대상이 같아지지는 않습니다.
A complete episode sampled under the relevant policy supplies a return for that state’s policy value, but it may vary with many future actions and transitions. A TD target uses one observed step while filling the tail with V; error in V can bias the target. Using the true vπ as continuation differs from using an estimate.
“MC has more variance and TD less” is a common intuition, not a universal inequality over all environments, initial values and step sizes. Compare repeated evaluations and distinguish bias from variance. TD with a sample-mean step size averages changing targets, not generally complete returns. Similar update syntax does not make the estimands identical.
기초Foundations
24. 예측한 값이 누구의 정책 값인지 확인하기24. Identify whose policy value is being predicted
상태 A를 방문한 뒤 어떤 행동을 했는지에 따라 이후 보상 분포가 달라집니다. 정책 예측의 Vπ는 앞으로 π를 따른다는 조건의 기대입니다. 그런데 데이터를 b로 모으고 보정 없이 완료 수익률을 평균내면 보통 b의 값을 배우게 됩니다. 실습의 predict 함수는 입력 로그를 순서대로 갱신하는 계산기이며, 그 로그가 원하는 정책으로 생성되었다는 사실까지 입증하지는 않습니다.
온폴리시 표형 TD 수렴을 논할 때도 유한 상태, 알맞은 반복 방문, 학습률, 보상과 Markov 과정의 조건을 함께 보아야 합니다. 표를 숫자로 채웠다는 이유만으로 참된 가치가 식별되지는 않습니다. 다음 부분에서는 정책을 평가하는 데서 더 나아가, 행동별 값을 배우고 더 좋은 행동을 고르는 제어 문제를 다룹니다.
The distribution of later rewards depends on actions taken after visiting a state. Vπ assumes policy π is followed in the future. If data follow b and completed returns are averaged without adjustment, they ordinarily describe b instead. The predict API performs ordered finite-log updates; it does not certify that the log was collected under a desired policy.
Even on-policy tabular TD convergence requires suitable finite-state, visitation, step-size, reward and Markov-process conditions. Filling a table with numbers does not identify the true value. Next we move beyond evaluation to control: learning separate action values and choosing better actions.
기초Foundations
25. 상태의 점수에서 행동별 점수로25. From a state value to separate action values
ready에서 얻을 평균 점수 V만 알아서는 rest와 practice 중 무엇이 더 좋은지 바로 비교하기 어렵습니다. Q(s,a)는 지금 s에서 a를 한 번 고른 뒤 특정 규칙을 따를 때의 기대 수익률입니다. 그러면 같은 상태의 행동 두 개를 같은 단위로 비교할 수 있습니다. Q*는 그 뒤에도 가장 좋은 선택을 한다는 목표의 값입니다.
전이·보상표를 알면 이 기대를 표 전체에서 계산할 수 있습니다. 모르면 실제로 받은 보상과 다음 상태 한 줄로 표본 목표를 만듭니다. 한 번의 큰 보상이 해당 행동의 참된 가치를 뜻하지 않으므로 여러 경험을 조절해서 합칩니다. 현재 Q가 큰 행동이 현재 탐욕 행동이라는 뜻이지, 이미 Q*를 찾았다는 뜻은 아닙니다.
Knowing only V(ready) does not directly compare rest with practice. Q(s,a) is expected return from choosing a once in s and then following a specified rule. Action values put alternatives in the same unit. Q* uses optimal future choices after that first action.
A known transition/reward table gives the full expectation. Without it, one observed reward and successor supply a sample target. A lucky reward does not reveal a true action value, so experiences are combined with controlled updates. Being greedy for the current Q estimate is not proof that Q* has been found.
기초Foundations
26. Q-learning 한 줄을 직접 계산하자26. Calculate one Q-learning update by hand
현재 Q(A,left)=2이고, left 뒤 보상 1을 받고 B로 갔다고 합시다. B에서 가능한 행동의 Q가 6과 4이면 최댓값은 6입니다. γ=1/2일 때 목표는 1+6/2=4입니다. α=1/4이면 새 Q(A,left)는 2+(4−2)/4=5/2입니다. 선택하지 않은 A의 다른 행동 값은 이 한 줄에서 바뀌지 않습니다.
종료면 대괄호 안 이어지는 최댓값은 0으로 둡니다. 중단이면 현재 다음 상태의 최댓값을 사용합니다. 업데이트 직전의 표에서 target을 만든 뒤 해당 칸 하나를 바꾸는 순서를 지킵니다. 같은 상태로 돌아와도 갱신 뒤 값을 target에 다시 넣는 고정점 풀이와는 다릅니다. 실습에서 각 갱신의 이전 값·목표·학습률·이후 값을 비교합니다.
Suppose Q(A,left)=2 and left receives reward 1 before reaching B. Available B actions have values 6 and 4. With γ=1/2 the target is 1+6/2=4. With α=1/4, the new Q(A,left) is 2+(4−2)/4=5/2. The unchosen action at A is unchanged by this experience.
True termination sets continuation to zero; truncation retains the current successor maximum. Form the target from the pre-update table, then change one entry. Even a self-loop does not become an implicit fixed-point solve using the just-updated value. The lab shows before, target, step size and after for each displayed update.
기초Foundations
27. 실제로 한 다음 행동과 가장 큰 다음 행동27. The actual next action versus the greedy next action
B의 행동 가치가 6과 4인데 탐험으로 4짜리 행동을 실제로 골랐다고 합시다. 보상 1, γ=1/2라면 SARSA 목표는 1+4/2=3이고 Q-learning 목표는 1+6/2=4입니다. 앞의 같은 Q=2, α=1/4를 적용하면 새 값은 각각 9/4와 5/2입니다. 두 알고리즘은 같은 경험을 보면서도 다른 미래 행동을 평가합니다.
SARSA는 다음에 실제로 따를 탐험 정책의 위험을 반영할 수 있고, Q-learning은 최댓값을 향한 목표를 사용합니다. 그래서 Q-learning을 오프폴리시 제어라고 부릅니다. 두 방식의 숫자를 섞으면 무엇을 배우는지 달라집니다. 여기의 control 실습은 Q-learning만 실행합니다. SARSA 예는 계산 비교이며 실행 결과를 바꿔 부르는 것이 아닙니다.
Let B action values be 6 and 4, while exploration actually chooses the value-4 action. With reward 1 and γ=1/2, SARSA targets 1+4/2=3, whereas Q-learning targets 1+6/2=4. Starting from Q=2 at α=1/4 gives 9/4 and 5/2 respectively. They use the same experience to evaluate different future action choices.
SARSA can reflect the risks of the exploratory policy actually followed next. Q-learning targets a successor maximum and is therefore off-policy control. Mixing their targets changes the learning objective. The control lab executes Q-learning only; SARSA here is an explicitly worked comparison.
기초Foundations
28. 왜 이 갱신에는 매번 중요도 비가 없는가28. Why does this update have no action importance ratio?
표형 Q-learning은 현재 (s,a)를 이미 조건으로 잡고, 그 행동 뒤의 보상·다음 상태 표본으로 Bellman 최적 목표를 갱신합니다. 환경이 주어진 상태·행동에 대해 같은 조건부 법칙을 제공한다면, a를 자주 골랐는지 드물게 골랐는지가 그 조건부 기대의 식 자체를 바꾸지는 않습니다. 이것이 전체 에피소드 수익률을 다른 정책의 값으로 바꾸는 중요도 가중과 다른 지점입니다.
그러나 아무 행동 로그나 충분하다는 뜻은 아닙니다. 필요한 상태·행동을 전혀 관측하지 못하면 그 칸을 배울 수 없습니다. 상태에 중요한 정보가 빠져 행동 선택과 결과가 함께 달라지거나 환경이 바뀌면 조건부 표본의 전제도 흔들립니다. 데이터가 다른 정책에서 왔어도 가능하다는 성질을, 지원 없는 오프라인 자료에서도 원하는 정책을 항상 복원한다는 주장으로 확대하면 안 됩니다.
Tabular Q-learning conditions on the current pair (s,a), then uses its reward/successor sample to update a Bellman optimality target. If the environment supplies the same conditional law for that pair, choosing a frequently or rarely does not change that conditional expectation. This differs from reweighting an entire return to evaluate another policy.
It does not mean that every log is sufficient. An unobserved pair cannot be learned from no feedback. Omitted state information that affects both selection and outcomes, or environmental change, can undermine the conditional-sampling premise. Learning from another behavior policy does not imply universal recovery of a desired policy from unsupported offline data.
학부 심화 · 선택Advanced undergraduate · optional
29. 수렴 정리를 한 조건씩 읽기29. Read the convergence conditions one at a time
대표적인 표형 Q-learning 수렴 결과는 유한 상태·행동의 정상 Markov 환경, 유계 보상, 0≤γ<1, 모든 필요한 상태·행동의 무한 방문, 적절한 학습률 조건 아래 참된 최적 행동 가치로 거의 확실하게 수렴한다고 말합니다. “거의 확실”은 확률 1의 극한 명제이지 정해진 천 번 안에 오차가 0이라는 뜻이 아닙니다.
n=1∑∞αn(s,a)=∞,n=1∑∞αn(s,a)2<∞
n은 각 (s,a)가 실제로 갱신된 횟수입니다. 1/n은 두 합의 조건을 만족하지만, 방문 자체가 유한하면 그것만으로 충분하지 않습니다. 상수 α는 제곱합이 발산하고, 너무 빨리 줄어드는 1/n²는 첫 합이 유한하여 다른 조건을 어깁니다. 초기의 유한 몇 번에 α=1을 쓰는 일은 이 무한 합 조건을 바꾸지 않습니다. γ=1의 적절한 종료 문제에는 별도의 정리가 필요합니다.
A standard tabular Q-learning theorem concerns a finite stationary Markov environment, bounded rewards, 0≤γ<1, infinitely many required pair visits, and suitable step sizes. Almost-sure convergence is a probability-one limiting statement, not zero error within a chosen thousand updates.
n=1∑∞αn(s,a)=∞,n=1∑∞αn(s,a)2<∞
Here n counts updates to each individual pair. A 1/n rule satisfies the two series conditions, but cannot compensate for only finitely many visits. A constant step violates square summability; 1/n² shrinks too quickly and violates the divergent first sum. A finite initial number of unit steps does not change these series. Suitable undiscounted terminating tasks require a separate theorem.
기초Foundations
30. 유한 표에서 확인할 수 있는 것과 없는 것30. What a finite table can and cannot establish
열 번의 갱신을 정확히 계산할 수는 있습니다. 각 target과 변화량, 상태·행동 방문 횟수, 현재 탐욕 행동도 확인할 수 있습니다. 하지만 경험하지 않은 결과 확률까지 그 표가 보증하지는 않습니다. 변화량이 작다는 것만으로 최적에 가깝다고 결론내리면, 학습률을 0으로 놓아 변화가 없는 실패도 성공으로 오해하게 됩니다.
새 정책을 평가하려면 학습에 쓴 데이터와 평가할 데이터를 구별해야 합니다. 같은 로그에서 가장 커 보이는 정책을 고르고 같은 로그로 성능을 보고하면 선택 편향이 생길 수 있습니다. 새로운 독립 평가, 정책을 미리 고정한 로그 평가, 시간 순 분할 등은 서로 다른 설계이며 각각 전제가 있습니다. 이 장의 출력은 유한 로그에 대한 추정과 갱신 결과로 명시합니다.
Ten updates can be computed exactly, exposing targets, changes, pair counts and current greedy choices. The resulting table does not certify unexperienced outcome probabilities. Small changes alone do not prove near-optimality: setting the step size to zero would otherwise look like success.
Evaluate a learned policy using a design distinct from the data that selected it. Choosing the most promising rule and reporting its value on the same log can introduce selection bias. Independent evaluation, a prespecified target evaluated from a log, and chronological splits are different designs with different assumptions. Outputs here are explicitly finite-log estimates and updates.
기초Foundations
31. 큰 신경망에도 같은 보장이 따라올까31. Does the same guarantee transfer to a large network?
표에서는 (s,a)마다 별도 칸을 바꾸지만 신경망에서는 하나의 가중치가 많은 상태·행동 값에 영향을 줄 수 있습니다. 따라서 한 칸의 증명을 그대로 옮길 수 없습니다. 함수 근사, 부트스트래핑, 오프폴리시 데이터가 함께 쓰일 때 불안정이나 발산이 생길 수 있다는 것이 중요한 경계입니다. 딥러닝 모형이 크다는 이유만으로 표형 수렴 정리가 강해지는 것은 아닙니다.
최댓값을 취하는 일도 주의해야 합니다. 여러 행동의 추정 오차 중 우연히 큰 값을 고르면 최대 추정이 낙관적으로 치우칠 수 있습니다. Double Q 같은 방법은 이 문제를 다루지만 모든 분포 변화나 오프라인 지원 공백을 해결하는 만능 도구는 아닙니다. 다음 장의 신경망·역전파는 표현과 미분을 배우는 단계이며, 그 자체가 딥 강화학습의 수렴 증명은 아닙니다.
A tabular update changes one pair’s entry. A neural-network parameter can change predictions for many pairs simultaneously, so the one-entry proof does not transfer automatically. Function approximation, bootstrapping and off-policy data together can produce instability or divergence. A larger network does not strengthen a tabular convergence theorem.
Maximization also selects among estimation errors and can favor an accidentally high estimate. Methods such as Double Q address this issue but do not solve every distribution shift or offline support gap. The next chapter’s neural networks and backpropagation teach representation and differentiation; they do not themselves establish deep-RL convergence.
기초Foundations
32. Watkins와 Dayan: 알고리즘 뒤의 정리 읽기32. Watkins and Dayan: read the theorem behind the algorithm
Christopher Watkins와 Peter Dayan의 1992년 논문 「Q-Learning」은 점진적 갱신과 수렴 조건을 연결한 대표적인 원문입니다. 이 장에서는 논문의 표형 표현, 반복 표본, 학습률, 할인 조건을 읽습니다. 연구자의 이름을 외우는 것보다 “어떤 환경에서 어떤 의미로 보장하는가”를 문장에서 찾아내는 연습이 중요합니다.
읽기 활동으로 논문의 문제 설정과 정리 부분을 먼저 보고 조건 목록을 작성해 보세요. 본 실습의 유한 로그에서 실제로 관측 가능한 조건과, 무한 반복이나 참된 환경 법칙처럼 로그만으로 검증할 수 없는 조건을 나눕니다. 강의 영상은 Monte Carlo·TD·Q-learning의 서로 다른 목표를 설명할 때 함께 보되, 영상의 간단한 슬라이드 문장을 모든 조건을 포함한 정리로 확대하지 않습니다.
Christopher Watkins and Peter Dayan’s 1992 paper “Q-Learning” connects incremental updates with explicit convergence conditions. Read its tabular representation, repeated-sampling, step-size and discount premises. Finding the environment and meaning of a guarantee matters more than memorizing researchers’ names.
As a reading activity, list the premises in the problem setting and theorem. Separate conditions observable in a finite log from those involving infinite repetition or the true environmental law. The lectures help compare MC, TD and Q-learning targets, but a short slide statement should not be expanded into an unconditional theorem.
기초Foundations
33. 다른 규칙의 경험으로 무엇을 평가할까33. What can another policy’s experience evaluate?
b는 경험을 모은 규칙, π는 평가할 규칙입니다. 예를 들어 b가 휴식·연습을 반씩 골랐지만 π는 준비 상태에서 연습을 더 자주 고를 수 있습니다. b의 수익률을 그대로 평균내면 보통 b가 만든 행동 혼합의 값입니다. π가 자주 고를 경로를 더 크게, 덜 고를 경로를 작게 세려는 것이 중요도 가중의 생각입니다.
여기서는 같은 환경의 보상·전이 법칙, 같은 초기 상태 분포를 유지하고 행동 정책만 바꿉니다. 국가가 다르거나 가격 제도가 바뀌어 환경 자체가 달라지면 행동 확률 비만으로 모두 보정되지 않습니다. 실제 자료의 정책 확률을 모르면 b를 선언하는 것 자체가 추가 가정입니다. 이 장의 실제 자료 사례에는 원래 행동 정책 로그가 없으므로 교육용으로 만든 b라는 표시를 유지합니다.
Behavior b collected experience; target π is the rule to evaluate. Behavior might choose rest and practice equally while the target practices more often in ready. Unweighted behavior returns ordinarily describe that behavior mixture. Importance weighting gives more weight to paths favored by π and less to those it disfavors.
We hold the environment’s reward/transition laws and initial-state distribution fixed while changing action policies. Different countries or changed market rules cannot generally be corrected by action ratios alone. Unknown original propensities make specifying b an additional assumption. Our real-source examples have no original RL policy log, so their b remains explicitly constructed.
기초Foundations
34. 경로의 모든 선택 확률을 곱해야 한다34. Multiply ratios for every action along the path
각 단계에서 실제 선택한 행동의 목표 확률을 행동 확률로 나눈 뒤 모두 곱합니다. 두 번 모두 b 확률 1/2, π 확률 3/4인 행동을 골랐다면 가중치는 (3/2)²=9/4입니다. 보상 2,4와 γ=1/2의 수익률은 4이므로 가중 수익률은 9입니다. 첫 행동의 비만 곱한 6은 전체 경로 중요도 가중이 아닙니다.
ρ0:T−1=t=0∏T−1b(At∣St)π(At∣St)
같은 환경과 초기 분포라는 전제 아래 경로 확률의 비를 쓰면 환경 전이 확률이 상쇄되어 행동 확률의 곱이 남습니다. 정책이 이력이나 시간에 의존하면 확률도 그 조건으로 적어야 합니다. 실습은 완전한 종료 에피소드와 상태별 선언 정책을 받습니다. 중단된 꼬리를 임의 추정한 기록을 완전 경로로 받아들이지 않습니다.
Divide the target probability of each logged action by its behavior probability, then multiply across the episode. Two actions each having b=1/2 and π=3/4 give weight (3/2)²=9/4. Rewards 2,4 at γ=1/2 yield return 4, so the weighted return is 9. Applying only the first ratio would give 6, not trajectory importance weighting.
ρ0:T−1=t=0∏T−1b(At∣St)π(At∣St)
With common environmental laws and initial distribution, environment terms cancel from the trajectory likelihood ratio. History- or time-dependent policies require corresponding conditioning. The lab uses complete terminal episodes and declared state-specific policies; an arbitrarily estimated truncated tail is not accepted as a complete trajectory.
기초Foundations
35. 일반 중요도 추정은 에피소드 수로 나눈다35. Ordinary importance sampling divides by episode count
일반 중요도 추정은 각 가중 수익률을 더하고 에피소드 수 N으로 나눕니다. 가중치 합으로 나누는 식과 구별하세요. 상태 하나의 행동이 세 개이고 b=[1/2,1/4,1/4], π=[1/2,0,1/2]라고 합시다. 관측 두 번이 첫 행동 보상 8, 둘째 행동 보상 0이면 가중치는 1,0입니다. 일반 추정은 (1×8+0×0)/2=4입니다.
vOIS=N1i=1∑NρiGi
이 두 번에는 목표 정책이 확률 1/2로 고르는 셋째 행동이 없습니다. 따라서 숫자 4가 정확한 목표 가치라는 결론은 나오지 않습니다. 올바른 확률과 지원·공통 환경·적절한 표본 조건 아래 일반 중요도 추정의 기대가 목표 기대와 일치한다는 명제와, 이 유한 기록이 정확하다는 주장은 다릅니다. 불편향 추정도 한 번의 결과는 크게 틀릴 수 있습니다.
Ordinary IS sums weighted returns and divides by episode count N, not by total weight. In one state with three actions, let b=[1/2,1/4,1/4] and π=[1/2,0,1/2]. Two observed episodes choose the first action for reward 8 and the second for reward 0. Their weights are 1 and 0, giving ordinary estimate (1×8+0×0)/2=4.
vOIS=N1i=1∑NρiGi
Neither episode shows the third action, which the target chooses with probability one half. The number 4 therefore is not certified as the true target value. An expectation identity under valid propensities, support, common environment and suitable sampling differs from exactness of one finite estimate. Even an unbiased estimator can be far wrong on one realization.
기초Foundations
36. 자기정규화하면 분모와 성질이 달라진다36. Self-normalization changes the denominator and properties
가중 중요도 추정은 가중 수익률 합을 가중치 합으로 나눕니다. 앞 절의 b=[1/2,1/4,1/4], π=[1/2,0,1/2], 두 기록의 가중치 [1,0], 수익률 [8,0]이면 결과는 8/(1+0)=8입니다. 4와 8 중 더 큰 숫자가 정답이라는 뜻은 아닙니다. 같은 기록을 다르게 정규화한 추정입니다.
vWIS=∑iρi∑iρiGi
분모가 양수이면 비음수 가중 평균이므로 사용된 수익률의 최솟값과 최댓값 사이에 있습니다. 하지만 보통 유한 표본 편향이 있습니다. 모든 가중치가 0이면 분모도 0이므로 이 실습은 undefined로 표시합니다. 0이라는 값을 관측한 것으로 바꾸지 않습니다. 일반 중요도 추정은 같은 기록에서 0을 계산할 수 있어도, 그 0이 목표 가치가 0이라는 증거가 되지는 않습니다.
Weighted IS divides the weighted-return sum by the weight sum. For the preceding b=[1/2,1/4,1/4], π=[1/2,0,1/2], weights [1,0] and returns [8,0], it gives 8/(1+0)=8. The larger of 4 and 8 is not automatically correct; these are differently normalized estimators.
vWIS=∑iρi∑iρiGi
With a positive denominator, nonnegative normalized weights keep the result within the included returns’ range. Weighted IS is generally biased at finite sample sizes. If every weight is zero, this lab displays undefined instead of fabricating an observed zero. Ordinary IS can compute zero on that same log without establishing a true target value of zero.
기초Foundations
37. 나눌 확률이 0이면 계산 문제가 아니다37. A zero denominator can be an identification problem
b가 어떤 행동을 확률 0으로 고르는데 π는 그 행동에 양의 확률을 주면, 목표가 중요하게 여기는 결과가 행동 데이터에 없습니다. 0으로 나누는 계산기를 더 정교하게 만든다고 그 정보를 얻을 수는 없습니다. 지원 조건은 목표 경로를 행동 분포가 덮어야 한다는 요구입니다. 경험이 적다는 문제보다 더 근본적일 수 있습니다.
실습은 보수적으로 선언된 모든 상태·행동에서 π>0, b=0인 칸을 검사해 거절합니다. 도달 불가능 상태까지 포함하는 이 전역 검사는 목표로 실제 도달하는 경로만의 최소 조건보다 강할 수 있습니다. 반대로 로그에 없는 행동이라고 b=0이라고 단정하지 않습니다. 경험 빈도표, 알려진 설계 확률표, 추정한 성향 점수는 증거의 종류가 서로 다릅니다.
If b assigns zero probability to an action that π uses, its outcome is missing from behavior data. More sophisticated arithmetic cannot recover that information by dividing by zero. Support requires behavior trajectories to cover relevant target trajectories, which can be more fundamental than a small sample.
The lab conservatively rejects every declared state-action cell with π>0 and b=0. This global gate can be stronger than the minimal condition restricted to reachable target paths. Conversely, absence from a finite log does not establish b=0. Empirical counts, known design probabilities and estimated propensity scores are distinct kinds of evidence.
기초Foundations
38. 큰 가중치 몇 개가 전체를 지배할 때38. When a few large weights dominate
행동과 목표가 조금 다르더라도 긴 경로에서 비를 계속 곱하면 가중치 차이가 커질 수 있습니다. 단계별 비가 2인 경로 열 단계의 가중치는 1024입니다. 이런 경로 한 개가 추정 전체를 움직일 수 있습니다. 단순히 로그 행이 많다는 것만으로 안정적인 평가라고 판단하면 안 됩니다.
ESS=∑iρi2(∑iρi)2
ESS는 가중치 집중을 요약하는 한 진단입니다. 같은 양의 가중치 N개면 N이고, 양수 가중치가 한 개뿐이면 1입니다. 독립 표본 수나 실제 추정 분산을 그대로 측정하는 값은 아닙니다. 모두 0이면 역시 정의되지 않습니다. 기업 사례는 24게임인데 고정 목표와 완전히 맞는 경로가 세 개뿐이어서 ESS가 3입니다. 무엇 때문에 이런 차이가 생겼는지 경로별 가중치를 살펴봅니다.
Even modest per-step policy differences can produce widely spread trajectory weights. A ratio of 2 repeated for ten steps gives weight 1024. One such path may dominate an estimate, so a large raw row count does not establish stable evaluation.
ESS=∑iρi2(∑iρi)2
ESS is one diagnostic of weight concentration. Equal positive weights give N; a single positive weight gives 1. It is neither a literal independent-sample count nor the estimator’s variance. All-zero weights leave it undefined. The company example has 24 games but only three complete paths matching the fixed target, giving ESS=3. Examine the path weights to understand why.
기초Foundations
39. 가중치를 자르거나 정책을 고르면 대상도 달라진다39. Clipping weights or selecting policies changes the analysis
가중치가 너무 크다고 임계값으로 잘라 버리면 숫자는 안정되어 보일 수 있습니다. 그러나 원래 중요도 항등식이 달라져 편향과 다른 추정 대상 문제가 생길 수 있습니다. 자른 값을 원래 일반 중요도 추정이라고 부르면 안 됩니다. 이 실습은 가중치를 몰래 자르지 않고, 정확한 비와 표시용 요약을 구별합니다.
같은 로그에서 가장 잘 나온 목표 정책을 선택하고 그 로그로 성과를 보고하면 정책 선택에 의한 낙관이 생길 수 있습니다. 목표를 미리 고정하거나 별도 데이터로 평가하는 설계가 필요합니다. 사용자가 버튼을 바꾸어 여러 목표를 탐색하는 교육 활동은 가능하지만, 그중 최대치를 새로운 독립 성과라고 해석하면 안 됩니다. 여러 시도와 선택 과정을 기록해야 합니다.
Capping large weights may make a display look stable, but changes the original importance identity and can introduce bias or a different estimand. Clipped values must not be labeled ordinary IS. Our lab does not silently clip weights; compact displays remain distinguishable from their exact full values.
Selecting the best-looking target on a log and reporting its value on the same log can create selection optimism. Prespecifying the target or evaluating on separate data addresses a different design. Exploring targets with buttons is useful for learning, but the largest explored number is not a newly validated independent performance result. Record the selection process.
기초Foundations
40. 확률 비를 안다고 현실의 개입 효과를 아는가40. Does knowing action ratios identify a real intervention?
지원이 있고 확률 비를 계산할 수 있다는 조건만으로 모든 현실의 인과효과가 식별되지는 않습니다. 행동에 영향을 준 숨은 정보가 결과에도 영향을 주거나, 행동을 바꾸면 환경 자체가 달라지면 단순한 상태별 확률표가 충분하지 않을 수 있습니다. 동일한 정책 이름이 실제로 같은 행동을 뜻하는지도 확인해야 합니다.
이 장의 국가 예측 행동은 “빠른 성장이라고 답하기”이지 실제 정부 정책을 바꾸는 행동이 아닙니다. 기업의 인력 용량과 점수는 가정한 게임 안에서만 결과를 바꿉니다. 실제 경제효과나 인사 정책을 평가하려면 관측 설계, 상태 정보, 실제 성향 확률, 일관성, 분포 변화 등을 추가로 검토해야 합니다. 다음 부분에서는 원자료에서 확인한 값과 계산을 위해 만든 부분을 표로 나누어 보여 줍니다.
Support and computable ratios do not identify every real causal effect. Hidden information can affect both action selection and outcomes; changing actions can also change the environment. A simple state-specific propensity table may then be insufficient. Identical policy labels must also correspond to consistent actions.
The country action is “predict fast growth,” not a government intervention. Company capacity and reward effects belong to an assumed game. Real economic or staffing evaluations need further scrutiny of observation design, state information, actual propensities, consistency and distribution change. Next, the source cases explicitly separate observed inputs from constructed decisions.
기초Foundations
41. 국가 사례: GDP를 맞히는 행동은 GDP를 바꾸지 않는다41. Country case: predicting GDP does not change GDP
보존한 World Bank 원자료에서 한국의 1980~2024년 실질 1인당 GDP 45개를 다시 읽었습니다. 단위는 2015년 기준 미국 달러입니다. 인접 두 수준으로 44개 성장률을 계산하고, 2% 이상을 fast라고 구분합니다. 이 경계는 교육용 선택이며 공식적인 경기 판정이 아닙니다. 1981년의 상태는 unknown, 이후 상태는 예측 연도 직전 성장률의 구간만 사용합니다. 여기서 이전 연도는 보존한 2026-10-08 빈티지 안의 연도 순서입니다. 발표 시차와 당시의 수정 전 수치를 복원하지 않았으므로 이 결과는 회고적 교육 계산이며 실시간 예측 검증은 아닙니다.
gy=100(GDPy−1GDPy−1)
선택은 slow 또는 fast라고 예측하기입니다. 맞으면 1, 틀리면 0이며 GDP 경로를 변화시키지 않습니다. 목표는 미리 고정한 “항상 fast”입니다. 모형을 맞추거나 목표를 고르는 기간과 평가 기간을 섞지 않도록 2010년까지와 2011~2024년을 구별합니다. 이미 여러 장에서 살펴본 자료이므로 뒤 기간을 전혀 보지 않은 새 검증이라고 과장하지 않습니다.
The retained World Bank original contains 45 Korean real GDP-per-capita levels for 1980–2024 in constant-2015 USD. Adjacent levels give 44 growth rates. We choose fast for growth at least 2%, a teaching threshold rather than an official recession classification. The first forecast state is unknown; later states use the preceding growth band from the retained 2026-10-08 vintage. Release lags and historical unrevised vintages have not been reconstructed. This is a retrospective teaching calculation, not a real-time forecasting validation.
gy=100(GDPy−1GDPy−1)
Actions predict slow or fast. Correctness earns 1 or 0 without changing GDP. The target is the fixed “always fast” rule. We distinguish outcomes through 2010 from 2011–2024 rather than mixing policy selection and evaluation periods. These retained data were examined in earlier chapters, so the later period is not advertised as a never-inspected new test.
기초Foundations
42. 국가 사례: 관측 성장률과 만든 행동 기록 나누기42. Country case: separate observed growth from simulated actions
원자료에는 우리 예측기의 선택이나 행동 확률이 없습니다. 따라서 각 예측을 반씩 고르는 가상 행동 규칙과 고정 난수 시드로 로그를 만듭니다. 실제 GDP와 성장률 구간은 관측·파생 자료이고, 선택·확률·정오 점수 기록은 교육용 구성입니다. 고정 시드는 재현을 위한 것이며 진짜 독립 확률 표본이라는 증명은 아닙니다.
44개 전체 연도의 실제 구간을 알고 계산한 항상 fast 정답률은 19/22입니다. 같은 연도에 만든 가상 로그의 일반 IS는 15/22, 가중 IS는 15/17입니다. 이 차이는 서로 다른 숫자가 나올 수 있음을 보여 줍니다. 평균을 더 예쁘게 맞추려고 시드를 골라 바꾸지 않습니다. 전체 정답을 아는 이 작은 예측 사례의 기준값이 일반적인 실제 개입 로그에서도 항상 관측되는 것은 아닙니다.
The source has no action or propensity field for our predictor. We construct a half-and-half behavior rule and a fixed-seed teaching log. GDP and derived growth bands are observed/derived inputs; actions, probabilities and correctness-feedback records are constructed. A fixed seed provides reproducibility, not proof of independent stochastic sampling.
With all 44 actual outcome bands available, the always-fast rule’s full-information accuracy is 19/22. On the constructed log, ordinary IS is 15/22 and weighted IS is 15/17. Different finite estimates are the lesson; we do not pick a more flattering seed. The full-information reference available for this prediction exercise is not generally observed in real intervention logs.
기초Foundations
43. 개인 사례: 손글씨의 정답과 먼저 볼 수 있는 픽셀43. Individual case: digit labels and a pre-action pixel
UCI 손글씨 자료의 제공 훈련 자료 3,823개와 제공 시험 자료 1,797개를 원 ZIP에서 다시 읽었습니다. 각 행의 8×8 픽셀 64개와 정답 한 개를 모두 공개 CSV에 보존합니다. 픽셀은 0부터 63까지 세며 p18은 0부터 센 18번, 즉 세 번째 행 세 번째 열입니다. 강도 0~16 중 8 이상인지 예측 전에 봅니다.
행동은 정답 숫자의 짝수·홀수를 예측하는 것입니다. 픽셀 상태를 쓸 수 있지만 목표는 단순 비교를 위해 “항상 짝수”로 고정합니다. 정답은 선택 뒤 점수를 계산할 때만 사용합니다. 훈련 자료의 원래 정답 분포에서 짝수는 1,900개이므로 기준 정답률은 1900/3823입니다. 이 분류 정확도를 사람의 능력·의도·민감한 특성에 대한 평가로 확대하지 않습니다.
We freshly reread 3,823 provided-training and 1,797 provided-test digit records from the original UCI ZIP. Public CSVs retain every one of the 64 pixels and the label. Zero-based pixel 18 is the third row, third column of the 8×8 image. Its recorded 0–16 intensity is thresholded at 8 and is visible before prediction.
Actions predict even or odd. Although a pixel context is available, the target remains “always even” for a simple comparison. The true label scores feedback only after the choice. There are 1,900 even labels in training, giving full-information accuracy 1900/3823. This classification exercise makes no inference about a person’s ability, intentions or sensitive attributes.
기초Foundations
44. 개인 사례: 모의 피드백과 이미 본 시험 자료44. Individual case: simulated feedback and an already-inspected test
훈련 행마다 한 번씩 가상 행동을 고르고, 고른 쪽이 맞았는지만 로그 보상으로 남깁니다. 짝수 행동이 선택된 1,845개만 목표와 맞으므로 그 경로의 가중치는 2이고 다른 경로는 0입니다. 일반 IS는 1808/3823, 가중 IS는 904/1845입니다. 원 정답을 모두 보는 기준값과 부분 피드백 로그에서 계산한 추정을 구별합니다.
제공 시험 자료는 앞 장에서도 살펴본 것이므로 이미 관찰한 외부 자료 묶음으로 표시합니다. 여기서도 목표를 바꾸지 않고 비교하면 기준 정답률은 297/599입니다. 많은 규칙을 여기서 시험한 뒤 가장 큰 결과를 새 성능이라고 발표하면 평가 역할을 훼손합니다. 전체 원 픽셀, 각 선택의 출처 행, 시드와 정해진 행동 규칙을 함께 보존하여 차이를 다시 계산할 수 있게 했습니다.
For each training row, one simulated action receives correctness feedback. The target matches the 1,845 logged even actions, each with weight 2; other paths get zero. Ordinary IS is 1808/3823 and weighted IS is 904/1845. Keep the complete-label reference distinct from estimates calculated using only selected-action feedback.
The provided test was inspected in earlier chapters, so it is labeled a previously examined external roster. Keeping the same target gives reference accuracy 297/599. Trying many rules there and publishing the largest result as new performance would compromise evaluation. Full pixels, source-row links, seed and the fixed behavior rule allow every difference to be reproduced.
기초Foundations
45. 기업 사례: 원주문을 사흘 작업 게임으로 바꾸기45. Company case: turn original orders into a three-round work game
원 주문서의 송장 536365에는 일곱 품목 행이 있고 수량은 6,6,8,6,6,2,6입니다. 상품·수량·가격은 실제 원행에서 왔습니다. 서로 다른 상품 두 개를 같은 노동 묶음 하나로 취급한다는 것은 별도 가정입니다. 이에 따라 도착량을 3,3,4,3,3,1,3 묶음으로 변환하고, 매 회차 이 일곱 행 중 하나를 균등 재추출한다고 가정합니다.
현재 미처리량에서 용량 a만큼 처리한 뒤 새 일이 도착합니다. 미처리 상한은 4이며 넘친 양은 overflow입니다. 보상은 3×처리량−용량−overflow/2−다음 미처리량/10입니다. 단위는 학습 점수이고 실제 파운드 매출이나 이익이 아닙니다. 세 회차 뒤 끝나는 게임으로 정의하여 상태에 회차도 넣습니다. 관측 주문 일곱 줄이 실제 독립 일별 수요나 인력 개입 효과를 보여 준다고 주장하지 않습니다.
Original invoice 536365 has seven product lines with quantities 6,6,8,6,6,2,6. Products, quantities and prices are observed. Treating two heterogeneous items as one equivalent labor batch is an additional assumption. It yields arrivals 3,3,4,3,3,1,3, then assumes uniform independent resampling of a retained line each round.
Serve existing backlog up to capacity a, then receive new work. Cap next backlog at 4 and count excess as overflow. Reward is 3×served−capacity−overflow/2−nextBacklog/10 in teaching credits, not GBP profit. The game truly ends after three rounds and includes the round in its state. Seven observed order lines do not establish independent daily demand or real causal staffing effects.
기초Foundations
46. 기업 사례: 24게임의 정보가 세 경로에 몰리다46. Company case: 24 games can concentrate on three paths
목표는 매 회차 용량 3입니다. 가상 행동 정책은 용량 3에 3/5, 나머지 네 행동에 각각 1/10을 줍니다. 세 번 모두 목표 행동을 고른 경로만 양의 가중치를 가지며 그 값은 (5/3)³=125/27입니다. 고정 시드의 24게임 중 이런 경로가 세 개이므로 가중치 합은 125/9, ESS는 3입니다. 72단계가 있다는 이유로 독립 표본 72개라고 부르지 않습니다.
일반 IS는 13699/5184, 가중 IS는 13699/3000입니다. 가정한 도착 게임에서는 일곱 도착을 세 번 전부 열거할 수 있어 목표 기대값 215156/42875도 정확히 계산할 수 있습니다. 이는 원회사의 참된 운영 가치가 아니라 명시한 유한 게임의 기준입니다. 로그 추정과 전수 열거 결과가 다른 이유를 표본·정책 겹침·정규화의 관점에서 설명해 봅시다.
The target always chooses capacity 3. Constructed behavior gives it probability 3/5 and each other action 1/10. Only paths matching the target in all three rounds have positive weight, (5/3)³=125/27. Three of the fixed-seed 24 games match, giving weight sum 125/9 and ESS 3. Seventy-two transitions are not automatically 72 independent episodes.
Ordinary IS is 13699/5184 and weighted IS is 13699/3000. In the declared arrival game, enumerating all seven arrivals over three rounds gives exact target value 215156/42875. That is a reference for the assumed finite game, not the source company’s true operational value. Explain the difference using sample variation, policy overlap and normalization.
기초Foundations
47. 실제 기록·가상 로그·추정 결과를 함께 실습하기47. Practice with observed records, constructed logs and estimates
아래 실습은 국가·손글씨·작업 게임을 고르고 시드나 계산 방법을 바꿔 비교합니다. 원래 관측값은 유지되고 가상 행동 기록만 달라집니다. seed를 바꾸어 추정이 흔들리는 모습을 보되, 유리한 결과만 골라 목표 정책 성과라고 발표하지 않습니다. Q-learning이나 MC·TD로 전환하면 동일한 로그를 다른 목표와 갱신 규칙으로 읽는 것입니다.
전체 CSV와 공개 Python·R 코드는 원자료 열을 읽어 가상 로그, 수익률, 경로 가중치와 요약을 다시 만듭니다. Python은 유리수로 정확히 계산하고 base R은 수치 근사로 대조합니다. 원본 픽셀·소수 토큰과 단위를 유지하므로 그림이 작아도 표와 파일에서 확인할 수 있습니다. 긴 정확 분수는 펼쳐 볼 수 있고 작은 화면의 요약과 혼동하지 않도록 표시합니다.
국가 · 성장 예측과 가상 피드백
한국 실질 1인당 GDP 45년의 원 소수 토큰을 보존했습니다. 성장률은 인접 수준의 정확한 비로 계산하며 아래 표의 성장률만 소수 여섯 자리로 표시합니다. 2%의 구간 경계, 예측 선택과 1/0 정오 점수는 우리가 정한 실습 조건입니다.
45개 원 수준과44개 파생 성장률 전체
연도
GDP/인·constant2015USD
성장률%·표시
선택 전 상태
기간
1980
4139.9606854608
—
—
baseline
1981
4377.64026742067
5.741107
unknown
training
1982
4675.53053701243
6.804814
fast
training
1983
5227.53893142287
11.806326
fast
training
1984
5712.63984757483
9.279719
fast
training
1985
6105.74268983951
6.881282
fast
training
1986
6740.69941617276
10.399336
fast
training
1987
7535.12660432782
11.785531
fast
training
1988
8367.04656522944
11.040557
fast
training
1989
8878.29655251462
6.110280
fast
training
1990
9672.57845182894
8.946332
fast
training
1991
10618.8431439122
9.782962
fast
training
1992
11176.560685871
5.252150
fast
training
1993
11837.4692053797
5.913344
fast
training
1994
12817.2447824958
8.276901
fast
training
1995
13924.3044000347
8.637267
fast
training
1996
14894.3278834104
6.966405
fast
training
1997
15682.2717905189
5.290228
fast
training
1998
14800.5091573641
-5.622672
fast
training
1999
16402.9168341094
10.826706
slow
training
2000
17763.1353417297
8.292540
fast
training
2001
18460.4288193829
3.925509
fast
training
2002
19775.3800655139
7.123081
fast
training
2003
20278.0406421178
2.541850
fast
training
2004
21244.8136800528
4.767586
fast
training
2005
22123.7613066851
4.137234
fast
training
2006
23162.1860111297
4.693708
fast
training
2007
24391.7651013448
5.308562
fast
training
2008
24934.5396367691
2.225237
fast
training
2009
25009.9148311999
0.302292
fast
training
2010
26623.0487122927
6.449978
slow
training
2011
27393.455357272
2.893758
fast
evaluation
2012
27944.0564190045
2.009973
fast
evaluation
2013
28732.711152033
2.822263
fast
evaluation
2014
29470.6732991655
2.568369
fast
evaluation
2015
30171.7906545222
2.379034
fast
evaluation
2016
31005.4072876388
2.762901
fast
evaluation
2017
31979.9027302467
3.142985
fast
evaluation
2018
32852.8887488942
2.729796
fast
evaluation
2019
33496.3113815643
1.958496
fast
evaluation
2020
33215.9298928108
-0.837052
slow
evaluation
2021
34792.9397214598
4.747752
slow
evaluation
2022
35809.0138105144
2.920346
fast
evaluation
2023
36347.7036392553
1.504341
fast
evaluation
2024
37048.4264001496
1.927832
slow
evaluation
1981년에는 선택표 안의 이전 성장률이 없어 unknown입니다. 1982년부터는 보존한 2026-10-08 빈티지에서 이전 연도의 구간을 상태로 사용합니다. 발표 시차와 당시 이용 가능했던 수정 전 빈티지는 복원하지 않았으므로 실시간 예측 성과를 검증한 결과는 아닙니다. 현재 정답을 미리 상태에 넣지 않습니다. 항상 fast인 목표는 자료에서 최적으로 골라낸 정부 정책이 아니라 미리 정한 예측 기준입니다. 2010년까지30개와2011~2024년14개를 나누고, 전체44개도 별도로 보여 줍니다.
가상 선택은 b=[1/2,1/2]이며 원자료에 없던 행동입니다. 고정 시드 로그는 재현 가능한 교육 경로이지 독립 무작위 표본의 인증이 아닙니다. 평가 기간의 기준값5/7과 로그 추정4/7·2/3도 서로 다릅니다. 이 경로에서 보기 좋은 결과가 나오는 시드를 골라 새 성과라고 주장하면 안 됩니다. GDP 예측은 GDP를 바꾸지 않으며 어느 정부 정책의 경제효과도 식별하지 않았습니다.
직접 해보기: 2009년과2020년의 실제 성장률을 표에서 찾고, 그 해 선택 전에 알 수 있던 상태와 구별하세요. 훈련과 평가를 합친 전체 정확도가 왜 평가 기간 정확도와 다른지도 설명합니다.
원자료 출처: World Bank,NY.GDP.PCAP.KD. 이 페이지는 보존한2026-10-08 자료를 재독한 결과이며 최신 발표값으로 자동 갱신된 표가 아닙니다.
원 ZIP의 훈련3,823개와 시험1,797개에서 모든64픽셀과 정답을 보존했습니다. 원래 제공 시험 자료는 이전 장에서 보았으므로 이미 관찰한 외부 묶음입니다. 아래 그림은 첫 여섯 훈련 행의 실제8×8 픽셀을 그대로 회색 사각형으로 다시 표시한 것입니다. 새로 생성한 손글씨가 아닙니다.
목표는 항상 짝수,행동은 짝수·홀수 예측을 반씩 고르는 가상 규칙입니다. 정답 라벨은 점수를 계산할 때만 사용합니다. 훈련 원행3,823개 중 짝수는1,900개입니다. 고른 행동의 피드백만 남긴 로그에서 짝수 선택1,845개는 가중치2,나머지1,978개는0입니다. 픽셀을 사용하지 않는 단순 목표라도 상태별 로그를 확인하는 예제가 됩니다.
목표를 그대로 고정한 묶음 비교
자료
전체 정답 기준
일반 IS
가중 IS
양의 가중치 경로/ESS
training
1900/3823
1808/3823
904/1845
1845
provided-test
297/599
292/599
146/293
879
실습 과제: 원 라벨별 훈련 도수를 더해3,823인지 확인하고,짝수 라벨의 도수만 더해1,900인지 확인하세요. 새로운 분류 규칙을 만들려면 여기서 이미 본 시험 자료의 성과를 새 독립 검증으로 포장하지 않는 평가 계획을 먼저 세웁니다.
실제 송장536365의 모든 일곱 행을 읽었습니다. 아래 표는 원 상품코드·수량·가격 토큰을 그대로 보존하며 원 엑셀 날짜 일련번호도 함께 보여 줍니다. 특정 행의 수량을 고를 확률,작업 용량,노동 환산,보상은 원 송장에 기록된 정책이 아닙니다.
원8개 열과 출처 행번호 · 원가는 추정하지 않음
원행
송장
상품코드
설명
수량
날짜·원일련값
GBP 단가·원토큰
고객코드
국가
1
536365
85123A
WHITE HANGING HEART T-LIGHT HOLDER
6
40513.351388888892
2.5499999999999998
17850
United Kingdom
2
536365
71053
WHITE METAL LANTERN
6
40513.351388888892
3.39
17850
United Kingdom
3
536365
84406B
CREAM CUPID HEARTS COAT HANGER
8
40513.351388888892
2.75
17850
United Kingdom
4
536365
84029G
KNITTED UNION FLAG HOT WATER BOTTLE
6
40513.351388888892
3.39
17850
United Kingdom
5
536365
84029E
RED WOOLLY HOTTIE WHITE HEART.
6
40513.351388888892
3.39
17850
United Kingdom
6
536365
22752
SET 7 BABUSHKA NESTING BOXES
2
40513.351388888892
7.65
17850
United Kingdom
7
536365
21730
GLASS STAR FROSTED T-LIGHT HOLDER
6
40513.351388888892
4.25
17850
United Kingdom
두 품목을 노동 한 묶음으로 보는 선택에서 도착 묶음은3,3,4,3,3,1,3입니다. 그중 하나를 매 회차 균등 재추출하며 실제 도착 순서라고 부르지 않습니다. backlog0~4,회차0~2로15상태를 선언합니다. 먼저 처리하고 새 일을 받은 뒤 상한을 적용하며,세 회차 뒤 정의한 게임이 진짜 끝납니다. 점수는3×처리−용량−넘침/2−다음 미처리/10입니다.
첫 가상 게임의 세 단계 전체
단계
선택 전 상태
가상 행동
참조 원행
실제 수량
가정 도착
점수
다음 상태
0
t0-backlog0
capacity-0
7
6
3
-3/10
t1-backlog3
1
t1-backlog3
capacity-3
4
6
3
57/10
t2-backlog3
2
t2-backlog3
capacity-1
5
6
3
11/10
terminal
24게임의 정확 경로 가중치·수익률 펼치기
γ=9/10 · 전체 경로에서 확률 비를 곱함
게임
경로 비
수익률
0
0
5721/1000
1
0
1119/250
2
0
3683/500
3
0
-3/125
4
0
1083/500
5
0
1347/1000
6
0
9447/1000
7
125/27
6447/1000
8
0
4971/1000
9
0
1389/250
10
0
9447/1000
11
0
2767/1000
12
0
-287/500
13
125/27
772/125
14
0
-2257/500
15
0
1963/500
16
0
-3/125
17
0
2247/1000
18
0
-7099/1000
19
0
199/250
20
0
4151/1000
21
125/27
269/250
22
0
-3849/1000
23
0
3373/500
원회사 실적이나 정책 효과로 해석하지 않는 결과
항목
값
해석
N
24
가상 게임 수
sum weights
125/9
세 목표 일치 경로
ESS
3
집중 진단
ordinary IS
13699/5184
유한 로그 추정
weighted IS
13699/3000
유한 로그 추정
enumerated reference
215156/42875
선언한 게임의 정확 기대
사례 토론: 물품마다 실제 처리시간이 다르면 두 개=한 묶음 가정은 어떻게 달라져야 할까요? 용량 비용과 넘침 손실의 실제 근거가 없다면 어떤 추가 자료가 필요할까요? 코드에서 값을 바꾼 결과와 실제 비용을 측정한 결과를 같은 종류의 증거로 제시하지 않습니다.
Choose the country, digit or work case, then change seed or calculation method. Original observations stay fixed while constructed actions change. Observe variability without cherry-picking a flattering seed as policy performance. Switching to Q-learning, MC or TD reads the same experiences with different targets and update rules.
Complete CSVs and public Python/R code rebuild the logs, returns, path weights and summaries from source columns. Python uses exact rational arithmetic; base R supplies an explicitly numerical comparison. Original pixel/decimal tokens and units remain available in tables and files. Long exact fractions can be expanded separately from compact mobile summaries.
Country · growth prediction and constructed feedback
All 45 original Korean real GDP-per-capita tokens are retained. Growth uses exact adjacent-level ratios; only the table display rounds growth to six decimal places. The 2% threshold, prediction actions and 1/0 correctness scores are declared exercise choices.
All 45 levels and 44 derived growth observations
Year
GDP/person·constant 2015 USD
Growth%·display
Pre-action context
Period
1980
4139.9606854608
—
—
baseline
1981
4377.64026742067
5.741107
unknown
training
1982
4675.53053701243
6.804814
fast
training
1983
5227.53893142287
11.806326
fast
training
1984
5712.63984757483
9.279719
fast
training
1985
6105.74268983951
6.881282
fast
training
1986
6740.69941617276
10.399336
fast
training
1987
7535.12660432782
11.785531
fast
training
1988
8367.04656522944
11.040557
fast
training
1989
8878.29655251462
6.110280
fast
training
1990
9672.57845182894
8.946332
fast
training
1991
10618.8431439122
9.782962
fast
training
1992
11176.560685871
5.252150
fast
training
1993
11837.4692053797
5.913344
fast
training
1994
12817.2447824958
8.276901
fast
training
1995
13924.3044000347
8.637267
fast
training
1996
14894.3278834104
6.966405
fast
training
1997
15682.2717905189
5.290228
fast
training
1998
14800.5091573641
-5.622672
fast
training
1999
16402.9168341094
10.826706
slow
training
2000
17763.1353417297
8.292540
fast
training
2001
18460.4288193829
3.925509
fast
training
2002
19775.3800655139
7.123081
fast
training
2003
20278.0406421178
2.541850
fast
training
2004
21244.8136800528
4.767586
fast
training
2005
22123.7613066851
4.137234
fast
training
2006
23162.1860111297
4.693708
fast
training
2007
24391.7651013448
5.308562
fast
training
2008
24934.5396367691
2.225237
fast
training
2009
25009.9148311999
0.302292
fast
training
2010
26623.0487122927
6.449978
slow
training
2011
27393.455357272
2.893758
fast
evaluation
2012
27944.0564190045
2.009973
fast
evaluation
2013
28732.711152033
2.822263
fast
evaluation
2014
29470.6732991655
2.568369
fast
evaluation
2015
30171.7906545222
2.379034
fast
evaluation
2016
31005.4072876388
2.762901
fast
evaluation
2017
31979.9027302467
3.142985
fast
evaluation
2018
32852.8887488942
2.729796
fast
evaluation
2019
33496.3113815643
1.958496
fast
evaluation
2020
33215.9298928108
-0.837052
slow
evaluation
2021
34792.9397214598
4.747752
slow
evaluation
2022
35809.0138105144
2.920346
fast
evaluation
2023
36347.7036392553
1.504341
fast
evaluation
2024
37048.4264001496
1.927832
slow
evaluation
The 1981 context is unknown because an earlier growth rate is unavailable here. From 1982 onward, the state uses the prior-year band in the retained 2026-10-08 vintage. Release lags and the unrevised vintages available at each historical date have not been reconstructed; this is not a real-time forecasting validation. The current answer never enters the pre-action state. Always-fast is a fixed prediction rule, not an optimized government intervention. We separate 30 outcomes through 2010 and 14 from 2011–2024, with an additional 44-year descriptive total.
Same fixed target; seed restarts for each selected year roster
Roster
Episodes
Full-label reference
Ordinary IS
Weighted IS
ESS
training
30
14/15
4/5
12/13
13
evaluation
14
5/7
4/7
2/3
6
all
44
19/22
15/22
15/17
17
Behavior b=[1/2,1/2] is constructed, not an original source action field. The fixed-seed log is a reproducible teaching path, not certified independent random sampling. Evaluation reference 5/7 differs from estimates 4/7 and 2/3. Selecting a flattering seed is not new performance evidence. A GDP forecast does not change GDP or identify a government intervention effect.
Try it:locate actual growth in 2009 and 2020, and distinguish each outcome from information available before that year’s prediction. Explain why all-year accuracy differs from evaluation-period accuracy.
Source:World Bank, NY.GDP.PCAP.KD, retained 2026-10-08 vintage. This table is a fresh reading of retained data, not an automatically updated latest release.
The original ZIP supplies 3,823 training and 1,797 provided-test records; every 64-pixel vector and label is retained. The provided test was inspected in earlier chapters. The images below reconstruct the first six training rows directly as 8×8 gray cells; they are not newly generated handwriting.
Label distribution across every original selected row
Actual label
Training count
Previously inspected test count
0
376
178
1
389
182
2
380
177
3
389
183
4
387
181
5
376
182
6
377
181
7
387
179
8
380
174
9
382
180
Zero-based pixel 18 is third row, third column
Source row
Original p18 token
Label
Pre-action context
1
16
0
p18-ink
2
16
0
p18-ink
3
0
7
p18-pale
4
15
4
p18-ink
5
14
6
p18-ink
6
16
2
p18-ink
The target always predicts even; constructed behavior chooses even/odd equally. Labels score feedback only after prediction. Of 3,823 training labels,1,900 are even. In the partial-feedback log,1,845 even choices receive weight 2 and 1,978 odd choices weight 0. This intentionally simple target does not use the pixel, while still allowing state-specific log inspection.
Compare rosters with the same prespecified target
Roster
Full-label reference
Ordinary IS
Weighted IS
Positive-weight paths/ESS
training
1900/3823
1808/3823
904/1845
1845
provided-test
297/599
292/599
146/293
879
Try it:sum training label counts to 3,823, then even-label counts to 1,900. Before developing another classifier, design evaluation that does not relabel this already inspected test as new independent validation.
All seven original lines of invoice 536365 are retained below, including product codes, quantities, price tokens and the original Excel date serial. Arrival probabilities, capacity choices, labor conversion and rewards are not policies recorded in the invoice.
All 8 original fields plus row link; no cost estimate
Source row
Invoice
Stock code
Description
Quantity
Original Excel date serial
GBP price original token
Account code
Country
1
536365
85123A
WHITE HANGING HEART T-LIGHT HOLDER
6
40513.351388888892
2.5499999999999998
17850
United Kingdom
2
536365
71053
WHITE METAL LANTERN
6
40513.351388888892
3.39
17850
United Kingdom
3
536365
84406B
CREAM CUPID HEARTS COAT HANGER
8
40513.351388888892
2.75
17850
United Kingdom
4
536365
84029G
KNITTED UNION FLAG HOT WATER BOTTLE
6
40513.351388888892
3.39
17850
United Kingdom
5
536365
84029E
RED WOOLLY HOTTIE WHITE HEART.
6
40513.351388888892
3.39
17850
United Kingdom
6
536365
22752
SET 7 BABUSHKA NESTING BOXES
2
40513.351388888892
7.65
17850
United Kingdom
7
536365
21730
GLASS STAR FROSTED T-LIGHT HOLDER
6
40513.351388888892
4.25
17850
United Kingdom
The chosen two-items-per-labor-batch rule yields 3,3,4,3,3,1,3. Uniform resampling each round is an assumed arrival process, not the observed order sequence. Five backlog levels across three rounds give 15 states. Serve first, then add arrivals and apply the cap; the defined game terminates after round 3. Teaching score is 3×served−capacity−overflow/2−nextBacklog/10.
All three steps of the first constructed game
Step
Pre-action state
Simulated action
Original row
Observed quantity
Assumed arrival
Score
Next state
0
t0-backlog0
capacity-0
7
6
3
-3/10
t1-backlog3
1
t1-backlog3
capacity-3
4
6
3
57/10
t2-backlog3
2
t2-backlog3
capacity-1
5
6
3
11/10
terminal
Expand exact weights and returns of all 24 games
γ=9/10; ratios cover the entire trajectory
Episode
Trajectory ratio
Return
0
0
5721/1000
1
0
1119/250
2
0
3683/500
3
0
-3/125
4
0
1083/500
5
0
1347/1000
6
0
9447/1000
7
125/27
6447/1000
8
0
4971/1000
9
0
1389/250
10
0
9447/1000
11
0
2767/1000
12
0
-287/500
13
125/27
772/125
14
0
-2257/500
15
0
1963/500
16
0
-3/125
17
0
2247/1000
18
0
-7099/1000
19
0
199/250
20
0
4151/1000
21
125/27
269/250
22
0
-3849/1000
23
0
3373/500
Not observed company performance or causal intervention effects
Quantity
Value
Meaning
N
24
Constructed games
sum weights
125/9
Three target-matching paths
ESS
3
Concentration diagnostic
ordinary IS
13699/5184
Finite-log estimate
weighted IS
13699/3000
Finite-log estimate
enumerated reference
215156/42875
Exact expectation in declared game
Case discussion:how should unequal product handling times change the two-item labor assumption? What additional data identify capacity costs and overflow losses? Changing parameters in code is different evidence from measuring real costs.
48. 한 줄의 경험에서 연구 설계까지48. From one experience to a research design
먼저 보상 2,4의 두 단계 게임에서 수익률을 손으로 계산하고, ε-탐욕의 두 확률 합이 1이 되는지 확인하세요. 같은 로그를 first-visit MC와 TD로 읽고 한 번의 Q-learning 목표를 계산합니다. 그 다음 다른 정책의 로그로 넘어가 모든 단계의 비를 곱한 뒤 일반·가중 추정의 분모를 비교합니다. 마지막으로 실제 사례에서 관측 열과 가정한 열을 직접 나눠 보세요.
심화 학습에서는 Bellman 연산자의 축약성과 확률 근사의 조건이 어떻게 다른지, 지원 공백이 있는 로그에서 왜 식별이 막히는지 설명할 수 있어야 합니다. 다음 장은 신경망과 연쇄법칙·역전파입니다. 작은 표의 의미와 조건을 이해한 뒤 표현을 확장하되, 미분 계산을 배웠다는 사실을 오프라인 정책의 성능이나 현실 인과효과 보장으로 바꾸어 말하지 않습니다.
First compute returns for the two-step rewards 2,4 and check that epsilon-greedy probabilities sum to one. Read one log through first-visit MC and TD, then calculate one Q-learning target. Next multiply every action ratio in an off-policy path and compare ordinary versus weighted denominators. Finally separate observed columns from assumed ones in the source cases.
At advanced level, distinguish Bellman contraction from stochastic-approximation conditions and explain why support gaps obstruct identification. The next chapter develops neural networks, chain rule and backpropagation. Extend representation after understanding the small table’s meaning, without turning differentiation into a guarantee about offline policy performance or real causal effects.
영상·학자·함께 읽기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.
완료 수익률과 TD 목표 비교Compare complete returns with TD targets
David Silver · Google DeepMind official uploader
Monte Carlo와 TD의 목표를 같은 두 단계 예에 대응하세요.Map MC and TD targets to the same two-step example.
교재 안의 YouTube 플레이어에서 재생합니다. 원영상에서 제공하는 자막은 플레이어의 CC·설정에서 선택할 수 있습니다.Playback stays in this chapter’s YouTube player. Available captions can be selected through CC/settings.
보고 읽은 뒤 답하기Respond after watching/reading왜 첫 보상은 γ 없이 더하나요?Why is the first reward undiscounted?
생각을 점검하는 해설Check your reasoning
현재 선택 뒤 첫 보상의 지수가0이기 때문입니다.Its return exponent is zero.
SARSA·Q-learning·다른 정책의 기록SARSA,Q-learning and another policy’s data
David Silver · Google DeepMind official uploader
실제 다음 행동과 최댓값 목표의 차이,전체 경로 확률 비의 조건을 비교하세요.Compare actual-successor-action and maximum targets,then the support conditions for trajectory ratios.
교재 안의 YouTube 플레이어에서 재생합니다. 원영상에서 제공하는 자막은 플레이어의 CC·설정에서 선택할 수 있습니다.Playback stays in this chapter’s YouTube player. Available captions can be selected through CC/settings.
보고 읽은 뒤 답하기Respond after watching/readingQ-learning과 경로 IS는 같은 계산인가요?Are Q-learning and trajectory IS the same calculation?
생각을 점검하는 해설Check your reasoning
아닙니다. 조건부 행동 가치 갱신과 다른 정책의 전체 수익률 평가입니다.No:one updates conditional action values;the other evaluates target returns from a behavior log.
Watkins와 Dayan · 조건을 갖춘 수렴Watkins and Dayan · conditional convergence
Watkins & Dayan,1992 · author-hosted UCL paper
표형 표현·반복 방문·학습률을 논문의 정리와 대조합니다.Read tabular representation,repeated visits and step sizes against the theorem.
보고 읽은 뒤 답하기Respond after watching/reading모형 없음은 가정 없음인가요?Does model-free mean assumption-free?
생각을 점검하는 해설Check your reasoning
아닙니다. 상태·표본·환경 조건은 남습니다.No:state,sampling and environmental premises remain.
연습문제 · 계산에서 설명과 증명까지Exercises: calculation, explanation and proof
먼저 혼자 풀고 풀이를 여세요. 숫자와 함께 단위·포함 기준·계산 이유를 확인하세요.Attempt each problem before opening its solution. Check units, inclusion rules and the reason for the calculation.
1. 경험의 순서Experience order
ready에서 practice를 선택한 뒤 3점을 받고 tired가 되었습니다. 상태·행동·첫 보상·다음 상태를 순서대로 쓰고, 첫 보상에 γ를 곱하는지 설명하세요.
From ready choose practice, receive 3, then reach tired. Identify current state, action, first reward and successor. Does the first reward carry a factor γ?
풀이와 확인할 이유Solution and explanation
순서는 ready, practice, 3, tired입니다. 보상은 선택 뒤 받지만 현재 수익률에서 첫 보상의 지수는 0이므로 가중치는 1입니다. 다음 선택 뒤 받은 보상부터 γ가 붙습니다.
The tuple is ready, practice, 3, tired. The first reward has exponent zero and weight one. Discounting starts with the reward received after the next action.
2. 두 단계 수익률Two-step return
보상 2,4를 받고 진짜 종료합니다. γ=1/2일 때 두 시점의 수익률을 구하세요.
Rewards are 2 and 4, then true termination. Find both returns at γ=1/2.
풀이와 확인할 이유Solution and explanation
뒤에서부터 마지막 수익률은 4입니다. 앞은 2+(1/2)×4=4입니다. 보상의 평균 3을 구하는 문제가 아닙니다.
Backward calculation gives last return 4 and initial return 2+(1/2)×4=4. The requested quantity is not the reward average 3.
3. 할인율 0Discount zero
보상 2,4 뒤 종료하는 게임의 첫 수익률을 γ=0에서 계산하세요. 뒤의 4점이 자료에서 사라진 것인가요?
Compute the initial return for rewards 2,4 then termination at γ=0. Does the later reward disappear from the data?
풀이와 확인할 이유Solution and explanation
첫 수익률은 2+0×4=2입니다. 뒤의 4는 여전히 기록되어 있고 두 번째 상태의 수익률도 4입니다. 현재 목적에서 미래에 가중치 0을 준 것입니다.
The initial return is 2+0×4=2. The reward 4 remains recorded and is the second state’s return. It receives zero weight only in the initial objective.
4. 할인율 1의 범위Scope of discount one
보상 2,4 뒤 반드시 종료하는 게임에서 γ=1의 첫 수익률을 구하세요. 매 단계 1점을 무한히 주는 비종료 게임에도 같은 결론이 나오나요?
Find the initial return for rewards 2,4 followed by certain termination at γ=1. What about a nonterminating game paying 1 forever?
풀이와 확인할 이유Solution and explanation
유한 게임은 2+4=6입니다. 무한 게임은 1+1+⋯가 발산합니다. 유한 기록의 계산 가능성이 일반적인 무할인 무한 문제를 정당화하지 않습니다.
The finite return is 6. The infinite stream 1+1+… diverges. A computable finite return does not justify a general undiscounted infinite-horizon calculation.
5. 중단된 꼬리A truncated tail
보상 2,4 뒤 기록만 중단됩니다. 다음 상태의 명시적 추정값은 5이고 γ=1/2입니다. 부트스트랩 수익률과 진짜 종료였을 때의 수익률을 비교하세요.
After rewards 2,4 the recording is truncated. The explicit successor estimate is 5 and γ=1/2. Compare the bootstrapped initial return with true termination.
풀이와 확인할 이유Solution and explanation
중단의 마지막 목표는 4+5/2=13/2, 첫 값은 2+(1/2)(13/2)=21/4입니다. 진짜 종료면 4입니다. 차이 5/4는 두 번 할인한 꼬리이며 완전히 관측된 보상이 아닙니다.
The truncated tail gives 4+5/2=13/2, then 2+(13/2)/2=21/4. True termination gives 4. The difference 5/4 is the twice-discounted supplied estimate, not an observed reward.
6. 종료 보상의 중복 방지Avoid double-counting termination
마지막 행동에서 보상 7을 받고 진짜 종료했습니다. γ=9/10이고 임의의 화면 값이 100이어도 마지막 target은 얼마인가요?
The final action earns 7 and truly terminates. At γ=9/10, what is the target even if an arbitrary displayed terminal value is 100?
풀이와 확인할 이유Solution and explanation
진짜 종료의 이어지는 가치는 0이므로 target은 7입니다. 7+90=97은 끝난 뒤에도 가치가 이어지는 다른 규약입니다. API의 terminal next는 null입니다.
True termination has zero continuation, so the target is 7. Computing 97 uses a different nonterminal convention. The API represents true termination with next=null.
7. 두 행동 ε-탐욕Two-action epsilon-greedy
Q=[5,1], ε=1/5입니다. 모든 행동 중 균등 탐험할 때 행동 확률을 구하세요.
For Q=[5,1] and ε=1/5, compute probabilities when exploration is uniform over all actions.
풀이와 확인할 이유Solution and explanation
탐험은 각각 1/10을 줍니다. 첫 행동은 활용 4/5도 받으므로 9/10, 둘째는 1/10입니다. 무작위 가지에서도 첫 행동이 나옵니다.
Exploration gives each action 1/10. The first also gets exploitation mass 4/5, yielding 9/10 and 1/10. The random branch can select the greedy action too.
8. 공동 최고 균등 처리Uniform greedy ties
Q=[5,5,1], ε=1/5이고 공동 최고에 활용 확률을 균등 분배합니다. 세 확률을 계산하세요.
Let Q=[5,5,1], ε=1/5, with exploitation shared uniformly across greedy ties. Find all probabilities.
풀이와 확인할 이유Solution and explanation
균등 탐험은 각각 1/15입니다. 앞 두 행동에는 2/5씩 더해 7/15,7/15,1/15입니다. 합은 1이며 공동 최고라는 이유로 탐험을 두 행동에만 제한하지 않습니다.
Each gets exploration mass 1/15. Adding 2/5 exploitation to each tied best action gives 7/15,7/15,1/15. Exploration still includes the third action.
9. 첫 공동 최고만 활용Exploit only the first tied action
Q=[5,5,1], ε=1/5에서 활용은 첫 공동 최고만 택합니다. 균등 동률 방식과 비교하세요.
For Q=[5,5,1], ε=1/5, exploitation selects only the first tied best action. Compare with uniform ties.
풀이와 확인할 이유Solution and explanation
확률은 4/5+1/15=13/15,1/15,1/15입니다. 균등 동률의 7/15,7/15,1/15와 다릅니다. 따라서 동률 규칙도 정책 정의의 일부입니다.
Probabilities are 13/15,1/15,1/15 rather than 7/15,7/15,1/15. Tie handling is part of the policy definition.
10. 완전한 균등 탐험Fully uniform exploration
가능한 행동이 세 개이고 ε=1입니다. Q가 [100,0,−5]여도 행동 확률은 무엇인가요?
There are three available actions and ε=1. What are probabilities even for Q=[100,0,−5]?
풀이와 확인할 이유Solution and explanation
각각 1/3입니다. 활용 확률이 0이므로 현재 Q 순위는 이 선택 분포에 영향을 주지 않습니다. 최고 행동 목록 자체는 여전히 첫 행동입니다.
Each probability is 1/3. Exploitation mass is zero, so Q ranking does not affect the choice distribution, though the first action remains the greedy one.
11. 비최고 행동 비율Nongreedy choice probability
네 행동 중 최고가 하나이며 ε=1/5입니다. 비최고 행동을 고를 총확률을 구하세요.
With four actions, one greedy action and ε=1/5, find total nongreedy probability.
풀이와 확인할 이유Solution and explanation
각 비최고 행동은 ε/4=1/20입니다. 세 개를 합하면 3/20입니다. ε=1/5 자체와 다르며 최고 행동은 17/20입니다.
Each nongreedy action gets 1/20; three together get 3/20. This differs from ε=1/5. The greedy probability is 17/20.
12. 몰래 정규화하지 않기Do not silently normalize
행동 확률표가 [0.6,0.5]입니다. 이를 그대로 정책으로 사용할 수 있나요? 실습은 어떻게 처리해야 하나요?
A policy row is [0.6,0.5]. Is it valid as written, and what should the lab do?
풀이와 확인할 이유Solution and explanation
합이 1.1이므로 확률분포가 아닙니다. 실습은 거절합니다. 임의로 6/11,5/11로 바꾸면 사용자가 선언한 것과 다른 정책을 실행합니다.
The sum is 1.1, so this is not a probability distribution. Reject it. Replacing it silently by 6/11,5/11 executes a different policy.
13. 관측되지 않은 행동An unobserved action
매번 독립적으로 right 확률 1/10인 규칙을 세 번 사용했습니다. right가 한 번도 없을 확률과 그 의미를 설명하세요.
A rule independently chooses right with probability 1/10 on three trials. Find the probability of no right and explain its meaning.
풀이와 확인할 이유Solution and explanation
확률은 (9/10)³=729/1000입니다. 이런 로그는 충분히 가능하며 관측 횟수 0이 진짜 행동 확률 0을 뜻하지 않습니다. 독립이라는 전제가 계산에 사용되었습니다.
The probability is (9/10)³=729/1000. Zero observed rights is quite possible and does not imply zero true propensity. Independence was an explicit premise.
14. 지원 공백A support gap
어떤 상태에서 b=[1,0], π=[1/2,1/2]입니다. 목표 정책 값을 이 행동 로그만으로 중요도 평가할 수 있나요?
In one state, b=[1,0] and π=[1/2,1/2]. Can behavior logs alone support importance evaluation of this target?
풀이와 확인할 이유Solution and explanation
둘째 행동은 π가 쓰지만 b가 전혀 고르지 않습니다. 지원 공백이 있어 거절합니다. 더 많은 동일 b 기록을 모아도 둘째 행동 결과는 생기지 않습니다.
The target uses the second action but behavior never selects it. Reject the support gap. More data from unchanged b still supply no second-action outcomes.
15. 가능 행동 하나One available action
어떤 상태에서 허용 행동이 stop 하나뿐입니다. ε=1/2일 때 stop 확률을 계산하세요.
A state permits only stop. At ε=1/2, compute its probability.
풀이와 확인할 이유Solution and explanation
탐험 1/2와 활용 1/2가 모두 stop으로 가므로 1입니다. 존재하지 않는 행동에 확률을 나눠 주지 않습니다.
Both exploration mass 1/2 and exploitation mass 1/2 select stop, giving 1. No mass belongs to nonexistent actions.
16. 유한 작업 게임의 상태State in a finite work game
세 회차 게임이고 미처리량은 0~4입니다. 남은 회차를 구별하려면 최대 몇 개의 비종료 상태가 필요한가요?
A game has three decision rounds and backlog 0–4. How many nonterminal states encode both round and backlog?
풀이와 확인할 이유Solution and explanation
회차 3가지와 미처리량 5가지를 조합하여 15개입니다. 실제 시작 상태에서 전부 도달하지 않을 수 있어도 선언 공간은 15개입니다. 회차를 빼면 종료 조건이 숨겨집니다.
There are 3×5=15 declared states, even if not all are reachable from the chosen start. Omitting round hides the horizon-dependent termination rule.
17. 드문 두 행동의 경로A path requiring two rare actions
각 상태에서 두 행동, 유일한 최고, ε=1/10입니다. 필요한 비최고 행동 두 번을 연속 고를 확률을 이 조건부 확률이 같은 경우 계산하세요.
Each state has two actions, one greedy, ε=1/10. If the required nongreedy conditional probability remains the same, find the chance of two such actions in succession.
풀이와 확인할 이유Solution and explanation
한 번의 비최고 확률은 ε/2=1/20입니다. 연속 경로는 1/400입니다. 두 번째 상태에 도달할 기회 자체도 고려해야 하므로 ε가 양수라고 깊은 상태 경험이 충분하지 않습니다.
Each required conditional probability is 1/20, giving a path probability 1/400. Reaching the second state also matters; positive epsilon alone does not ensure adequate deep-state experience.
18. 긴 경로의 가중치A long trajectory weight
열 단계 모두 선택된 행동의 목표/행동 확률 비가 2입니다. 전체 경로 가중치를 구하고 왜 주의해야 하는지 설명하세요.
At each of ten steps the chosen target/behavior ratio is 2. Find the trajectory weight and explain the concern.
풀이와 확인할 이유Solution and explanation
전체 비는 2¹⁰=1024입니다. 큰 경로 몇 개가 추정을 지배할 수 있습니다. 단계별 가중치가 작아 보인다고 전체 가중치도 작지는 않습니다.
The product is 2¹⁰=1024. A few such paths may dominate evaluation. Modest per-step ratios do not imply modest full-path weights.
19. 증분 표본평균Incremental sample mean
한 상태의 첫 방문 수익률이 순서대로 4,8,0입니다. 1/n 학습률로 초기값 0에서 세 값을 갱신하세요.
First-visit returns for one state are 4,8,0. Starting at 0, use step size 1/n for its updates.
풀이와 확인할 이유Solution and explanation
첫 값은 4, 둘째는 4+(8−4)/2=6, 셋째는 6+(0−6)/3=4입니다. 각 상태별 갱신 횟수를 사용합니다.
The sequence is 4, then 4+(8−4)/2=6, then 6+(0−6)/3=4. Counts belong to that state’s updates.
20. 고정 학습률의 기억Memory under a constant step
초기값 0, 목표 4,8,0, 고정 α=1/2입니다. 최종 값과 표본평균의 차이를 설명하세요.
Start at 0, observe targets 4,8,0 and use constant α=1/2. Find the final estimate and compare with the sample mean.
풀이와 확인할 이유Solution and explanation
값은 2,5,5/2입니다. 최종 5/2는 최근 목표에 큰 가중치를 준 결과이며 표본평균 4와 다릅니다. 유한 전개에는 초기값 항 (1−α)ⁿV₀도 포함됩니다.
Values are 2,5,5/2. The final 5/2 weights recent targets more than a sample mean of 4. The finite expansion also retains (1−α)ⁿV₀.
21. 첫 방문과 모든 방문First versus every visit
A→A 보상 1, A→B 보상 2, B→종료 보상 4, γ=1/2입니다. 이 게임만으로 A를 first-visit와 every-visit 평균낼 때 값을 비교하세요.
A→A earns 1, A→B earns 2, B→termination earns 4, γ=1/2. Compare first-visit and every-visit averages for A from this episode alone.
풀이와 확인할 이유Solution and explanation
수익률은 순서대로 3,4,4입니다. A 첫 방문은 3만 사용합니다. 모든 방문은 A의 3과 4를 사용하여 7/2입니다. B 수익률을 A 평균에 더하지 않습니다.
Returns in order are 3,4,4. First visit uses only 3 for A. Every visit averages 3 and 4 to 7/2. B’s return is not another A observation.
22. 상태별 분모State-specific denominators
세 개의 한 단계 종료 게임이 A에서 4점, B에서 8점, A에서 0점입니다. first-visit MC 표본평균과 각 상태 갱신 횟수를 구하세요.
Three one-step terminal episodes give 4 from A,8 from B, then 0 from A. Find first-visit MC means and state update counts.
풀이와 확인할 이유Solution and explanation
A는 두 번이므로 (4+0)/2=2, B는 한 번이므로 8입니다. 전체 게임 수 3으로 모든 상태를 나누지 않습니다. A 두 번째 학습률은 1/2입니다.
A has two updates and mean 2; B has one update and mean 8. Do not divide each state’s sum by all three episodes. A’s second step size is 1/2.
With V(A)=2,V(B)=6, observe A→B with reward 1,γ=1/2,α=1/4. Find target,error and updated V(A).
풀이와 확인할 이유Solution and explanation
목표는 1+6/2=4, 오차는 4−2=2, 새 값은 2+2/4=5/2입니다. 이어지는 B 값은 현재 추정이며 참값이라고 인증된 것은 아닙니다.
The target is 4,error 2,and new value 5/2. The continuation value 6 is a current estimate,not a certified truth.
24. TD 종료와 중단TD termination versus truncation
V(A)=2,V(B)=5, 보상 4, γ=1/2, α=1/2입니다. B로 이어지는 중단과 진짜 종료의 새 V(A)를 비교하세요.
Let V(A)=2,V(B)=5,reward 4,γ=1/2,α=1/2. Compare a truncation continuing at B with true termination.
풀이와 확인할 이유Solution and explanation
중단 target은 4+5/2=13/2, 새 값은 2+(13/2−2)/2=17/4입니다. 진짜 종료 target은 4, 새 값은 3입니다. 두 표시가 목표를 바꿉니다.
Truncation targets 13/2 and updates to 17/4. True termination targets 4 and updates to 3. Boundary semantics change the calculation.
25. 정보가 한 단계 전달되기Information propagates one step
초기 V(A)=V(B)=0, γ=1, α=1입니다. A→B 보상 0,B→종료 보상 8인 게임을 두 번 시간순으로 처리한 뒤 값을 구하세요.
Initially V(A)=V(B)=0,γ=1,α=1. Process A→B reward 0 then B→termination reward 8,twice in chronological order. Find values after each episode.
풀이와 확인할 이유Solution and explanation
첫 게임은 A=0,B=8입니다. 두 번째에는 A가 갱신 직전 B=8을 사용하므로 A=8,B=8입니다. 첫 A target에 마지막 B 값을 소급해 넣지 않습니다.
After the first episode A=0,B=8. On the second,A uses B’s current 8,so both become 8. Do not retroactively replace the first A target.
26. 음수 값의 갱신Updating a negative value
현재 V(A)=−3,V(B)=2, A→B 보상 −2,γ=1/2,α=1/2입니다. 새 V(A)를 구하세요.
Let V(A)=−3,V(B)=2,reward−2 on A→B,γ=1/2,α=1/2. Find the updated value.
풀이와 확인할 이유Solution and explanation
목표는 −2+1=−1, 오차는 −1−(−3)=2입니다. 새 값은 −3+1=−2입니다. 음수 보상도 허용되며 오차가 양수일 수 있습니다.
Target−1 minus old value−3 gives error 2. The new value is−2. A negative reward can still produce a positive TD error.
27. 학습률 0의 착시The illusion of a zero step size
Q(A,left)=2인데 target이 10입니다. α=0이면 변화가 없다는 이유로 수렴했다고 할 수 있나요?
Q(A,left)=2 while the target is 10. With α=0,does the absence of change establish convergence?
풀이와 확인할 이유Solution and explanation
새 값은 2입니다. 오차 8은 남아 있지만 0을 곱해 변화가 없을 뿐입니다. 작은 변화량과 작은 가치 오차는 서로 다른 진단입니다.
The value remains 2 despite error 8. Multiplication by zero suppresses change; it does not establish a small value error or convergence.
28. 학습률 1A unit step size
기존 추정 2,target 10,α=1이면 새 값은 무엇이며 과거의 단순 평균인가요?
For old estimate 2,target 10,α=1,find the update. Is it a simple mean of all past observations?
풀이와 확인할 이유Solution and explanation
2+(10−2)=10입니다. 마지막 목표로 완전히 교체했습니다. 이전 관측의 동일 가중 평균이 아니라 한 번의 완전 이동입니다.
The update is 10. It completely replaces the old estimate with the latest target rather than averaging all past observations equally.
29. 불가능 행동의 높은 값A high value for an impossible action
다음 상태에서 가능한 행동의 Q는 4,1이고 불가능한 행동의 오래된 숫자가 100입니다. 보상 1,γ=1/2,기존 Q=2,α=1/4의 새 값을 구하세요.
Available successor Q values are 4,1;an impossible action has stale value 100. For reward 1,γ=1/2,old Q=2,α=1/4,find the update.
풀이와 확인할 이유Solution and explanation
가능한 최댓값 4를 써 target=3, 새 값=2+(3−2)/4=9/4입니다. 100을 쓰면 target 51이라는 잘못된 문제를 만듭니다.
Maximize only available values:target 3 and new value 9/4. Including 100 would incorrectly create target 51.
30. SARSA와 Q-learning 비교Compare SARSA with Q-learning
B의 Q는 6,4이고 실제 다음 행동은 4짜리입니다. 보상 1,γ=1/2,기존 Q=2,α=1/4에서 두 목표와 갱신을 비교하세요.
At B,Q values are 6,4 and the actual next action is the value 4 action. With reward 1,γ=1/2,old Q=2,α=1/4,compare SARSA and Q-learning.
풀이와 확인할 이유Solution and explanation
SARSA target은 3이므로 새 값 9/4입니다. Q-learning target은 4이므로 새 값 5/2입니다. 실제 다음 행동을 평가하는지 최댓값을 평가하는지가 다릅니다.
SARSA targets 3 and updates to 9/4. Q-learning targets 4 and updates to 5/2. They evaluate the actual versus greedy successor action.
31. 종료 Q 갱신Terminal Q update
진짜 종료 보상 7,기존 Q=2,α=1/2입니다. 임의의 종료 화면 숫자 100을 무시하고 새 값을 계산하세요.
A true terminal reward is 7,old Q=2,α=1/2. Ignore an arbitrary terminal display value 100 and calculate the update.
풀이와 확인할 이유Solution and explanation
target=7이고 새 값은 2+(7−2)/2=9/2입니다. 종료 이후 이어지는 보상을 다시 더하지 않습니다.
Target 7 gives 2+(7−2)/2=9/2. No continuation is added after true termination.
32. 자기 회귀의 갱신 순서Update order for a self-loop
행동 하나인 A가 자신으로 돌아오며 보상 1,γ=1/2입니다. Q=4,α=1/2의 한 번 갱신과 정확한 Bellman 해를 비교하세요.
A has one self-loop action paying 1,γ=1/2. Compare one update from Q=4,α=1/2 with the exact Bellman solution.
풀이와 확인할 이유Solution and explanation
갱신 전 값으로 target=1+4/2=3, 새 값은 7/2입니다. 고정점 해 q=1+q/2는 2입니다. 표본 갱신 한 번과 고정점 방정식 풀이는 다릅니다.
Using the pre-update value gives target 3 and new Q=7/2. Solving q=1+q/2 gives 2. One sample update is not an implicit fixed-point solve.
33. 상태·행동별 학습률Pair-specific learning rates
전체 로그의 열 번째 갱신이지만 (A,left)는 이번이 세 번째입니다. pair별 1/n 규칙의 학습률은 무엇인가요?
It is the tenth update globally but the third update of (A,left). What is its pair-specific 1/n step size?
풀이와 확인할 이유Solution and explanation
1/3입니다. 전역 1/10을 쓰는 것과 다릅니다. 수렴 조건의 합도 각 필요한 (s,a)가 갱신된 순서에 대해 해석합니다.
Use 1/3 rather than 1/10. The convergence-series conditions also apply along each required pair’s own update sequence.
34. 1/n의 두 합The two series for 1/n
각 상태·행동을 무한히 방문한다고 가정합니다. α_n=1/n이 표준 두 학습률 합 조건을 만족하는 이유와 이것만으로 부족한 이유를 설명하세요.
Assume infinitely many visits to each required pair. Explain why α_n=1/n satisfies the two standard step-size sums and why that alone is insufficient.
풀이와 확인할 이유Solution and explanation
조화급수 Σ1/n은 발산하고 Σ1/n²는 수렴합니다. 하지만 유한·정상 Markov 환경,유계 보상,할인 등 다른 조건도 필요합니다. 유한 로그로 무한 방문을 입증할 수는 없습니다.
The harmonic series diverges while the squared series converges. Finite stationary Markov dynamics,bounded rewards and discount conditions are still needed;finite logs do not prove infinite visitation.
35. 너무 빠른 감소Shrinking too quickly
학습률 α_n=1/n²는 양수이고 0으로 갑니다. 왜 이것만으로 표준 Q-learning 조건을 만족하지 못하나요?
Step size α_n=1/n² is positive and tends to zero. Why does it fail the standard Q-learning conditions?
풀이와 확인할 이유Solution and explanation
Σα_n=Σ1/n²가 유한합니다. 계속 새 경험을 받아도 총 이동 여지가 유한해 초기 오차를 충분히 지우지 못할 수 있습니다. 0으로 간다는 조건만으로 충분하지 않습니다.
Its first sum is finite. Total remaining adjustment can be too small to remove initial error. Merely tending to zero is insufficient.
36. 고정 학습률의 정리 범위The theorem boundary for constant steps
α_n=1/2를 무한히 유지하면 두 합 중 어떤 것이 표준 조건을 어기나요?
If α_n=1/2 forever,which standard step-size sum fails?
풀이와 확인할 이유Solution and explanation
첫 합은 발산하지만 제곱합 Σ1/4도 발산합니다. 따라서 이 표준 거의 확실 수렴 정리를 그대로 적용할 수 없습니다. 변화 추적 등 다른 목적의 사용 가능성과 구별합니다.
The first sum diverges,but so does the squared sumΣ1/4. This standard almost-sure convergence theorem therefore does not apply unchanged,though tracking objectives may use constant steps.
37. 유한 종료와 무한 할인Finite termination versus infinite discounting
γ=1을 허용하는 유한 기록 계산기가 있다는 사실이 무한 비종료 Q-learning 수렴을 보장하지 않는 이유를 설명하세요.
Why does a calculator permittingγ=1 on finite records not establish convergence of infinite nonterminating Q-learning?
풀이와 확인할 이유Solution and explanation
기록의 유한 합은 계산되지만 실제 장기 가치는 발산할 수 있습니다. 할인 모형의 축약성과 종료 모형의 조건은 별개입니다. 적절한 흡수 종료 문제는 별도 가정과 정리가 필요합니다.
A finite sum is computable even when the true continuing value diverges. Discount contraction and appropriate absorbing-task conditions are different arguments.
38. 축약성과 확률 갱신Contraction versus stochastic updates
정확한 Bellman 연산자가 γ=1/2에서 두 입력의 최대 차이 2를 최대 1로 줄입니다. 이것이 임의의 유한 Q-learning 로그의 오차도 매번 반으로 준다는 뜻인가요?
An exact Bellman operator atγ=1/2 contracts a sup-norm difference 2 to at most 1. Must every finite Q-learning sample update halve its true error?
풀이와 확인할 이유Solution and explanation
아닙니다. Bellman 기대 전체를 적용한 계산과 무작위 한 표본·일부 칸·학습률의 갱신은 다릅니다. 표본 변동과 비동기 방문을 다루는 확률 근사의 조건이 추가로 필요합니다.
No. A full expectation backup differs from one noisy sample updating one entry with a step size. Stochastic-approximation and visitation conditions are additional.
39. 비율 없는 오프폴리시 제어Off-policy control without a trajectory ratio
표형 Q-learning의 조건부 (s,a) 표본 갱신에 전체 경로 중요도 비가 없는 이유와 여전히 필요한 데이터 조건을 설명하세요.
Why does a tabular Q-learning conditional(s,a) update lack a trajectory ratio,and what data condition remains?
풀이와 확인할 이유Solution and explanation
현재 (s,a) 뒤 환경 결과의 조건부 법칙을 표본화하고 최댓값 목표를 쓰기 때문입니다. 하지만 필요한 pair 방문과 올바른 조건부 환경 표본이 필요합니다. 지원 없는 임의 로그에서 최적 정책을 보장하지 않습니다.
It samples the environment conditional on the current pair and targets a successor maximum. Required pair coverage and valid conditional samples remain necessary;arbitrary unsupported logs do not establish optimality.
40. 성공으로 보이는 멈춤A misleading stopped estimate
모든 Q를 0으로 초기화하고 α=0으로 두면 정책이 변하지 않습니다. 이 로그의 “안정성”이 좋은 정책이라는 증거인가요?
Initialize every Q to 0 and setα=0. The policy never changes. Does this apparent stability demonstrate a good policy?
풀이와 확인할 이유Solution and explanation
아닙니다. 경험을 무시하도록 설정했기 때문입니다. 변화량,방문,목표 오차,독립 평가를 구별해야 합니다. 수치가 멈추었다는 것만으로 최적성을 알 수 없습니다.
No. The settings deliberately ignore experience. Distinguish update size,visits,target error and independent evaluation. An unchanging number is not proof of optimality.
41. 전체 경로 비The complete path ratio
두 단계 모두 선택한 행동의 b=1/2,π=3/4입니다. 보상 2,4,γ=1/2의 가중치·수익률·가중 수익률을 구하세요.
At both steps the logged action has b=1/2,π=3/4. For rewards 2,4 andγ=1/2,find weight,return and weighted return.
풀이와 확인할 이유Solution and explanation
경로 비는 (3/2)²=9/4입니다. 수익률은 4,곱은 9입니다. 첫 비만 곱한 6은 전체 경로 계산이 아닙니다.
The path weight is 9/4,the return 4,and weighted return 9. Using only the first ratio would give 6 and omit part of the path.
42. 두 정규화 방식Two normalization rules
한 상태의 세 행동에 b=[1/2,1/4,1/4],π=[1/2,0,1/2]입니다. 두 에피소드가 첫 행동 보상 8,둘째 행동 보상 0일 때 일반·가중 IS를 구하세요.
One state has b=[1/2,1/4,1/4],π=[1/2,0,1/2]. Two episodes log the first action for 8 and the second for 0. Find ordinary and weighted IS.
풀이와 확인할 이유Solution and explanation
가중치는 1,0입니다. 일반은 8/2=4,가중은 8/1=8입니다. 관측되지 않은 셋째 행동의 결과를 알 수 없으므로 어느 추정도 여기서 참값 인증이 되지 않습니다.
Weights are 1,0. Ordinary IS gives 4 and weighted IS 8. The unobserved third action prevents either estimate from certifying the true target value.
43. 한 관측의 차이A single-observation difference
한 단계에서 b=[1/4,3/4],π=[1/2,1/2]입니다. 첫 행동을 골라 8점을 받은 한 에피소드의 일반·가중 IS를 비교하세요.
A one-step policy pair is b=[1/4,3/4],π=[1/2,1/2]. One logged episode chooses the first action for reward 8. Compare ordinary and weighted IS.
풀이와 확인할 이유Solution and explanation
가중치는 2입니다. 일반은 2×8=16,가중은 16/2=8입니다. 일반 추정은 관측 보상 범위를 벗어날 수 있고 가중 추정의 한 값 8도 불편향성을 뜻하지 않습니다.
Weight 2 gives ordinary estimate 16 and weighted estimate 8. Ordinary IS can leave the observed reward range;the weighted result 8 does not imply finite-sample unbiasedness.
44. 가중치가 모두 0All weights are zero
b=[1/2,1/2],π=[1,0]인 한 단계 로그가 둘째 행동만 두 번 골랐고 보상은 3,9입니다. 두 추정값과 ESS는 무엇인가요?
With b=[1/2,1/2],π=[1,0],two one-step episodes both choose the second action and receive 3,9. Find both estimates and ESS.
풀이와 확인할 이유Solution and explanation
가중치는 0,0입니다. 일반 IS는 0,가중 IS와 ESS는 분모가 0이라 정의되지 않습니다. 목표 첫 행동의 값이 0이라는 뜻은 아닙니다.
Weights are 0,0. Ordinary IS is 0;weighted IS and ESS are undefined because their denominators vanish. The target action’s true value need not be zero.
45. 가중치 집중 진단Diagnose concentrated weights
네 에피소드의 가중치가 [2,2,0,0]입니다. ESS를 계산하고 독립 표본 수와 구별하세요.
Four episodes have weights[2,2,0,0]. Compute ESS and distinguish it from a literal independent-sample count.
풀이와 확인할 이유Solution and explanation
합 4,제곱합 8이므로 ESS=16/8=2입니다. 가중치 집중의 요약이며 에피소드 의존성이나 보상 변동 자체를 모두 반영하지는 않습니다.
Weight sum 4 and square sum 8 give ESS 2. This summarizes concentration,not all episode dependence or return variability.
46. 세 경로만 남는 ESSESS when only three paths remain
24게임 중 세 경로만 같은 양의 가중치 w를 갖고 나머지는 0입니다. w 값에 관계없이 ESS가 얼마인지 보이세요.
Only three of 24 games have the same positive weight w;all others are zero. Show ESS without choosing w.
풀이와 확인할 이유Solution and explanation
ESS=(3w)²/(3w²)=3입니다. 게임 수 24나 전이 수 72와 같지 않습니다. 양의 경로가 적으면 정보가 집중될 수 있습니다.
ESS=(3w)²/(3w²)=3,not 24 games or 72 transitions. Positive-weight paths concentrate the evaluation.
47. 가중치 절단의 변화What weight clipping changes
가중치 [100,1],수익률 [1,0]입니다. 원래 일반·가중 IS와 가중치를 최대 10으로 자른 결과를 비교하세요.
Weights are[100,1],returns[1,0]. Compare ordinary and weighted IS before and after capping weights at 10.
풀이와 확인할 이유Solution and explanation
원래 일반은 50,가중은 100/101입니다. 절단 뒤 일반 모양의 값은 5,가중은 10/11입니다. 안정된 모양을 얻어도 원래 비율 항등식과 같은 추정이라고 할 수 없습니다.
Original ordinary IS is 50 and weighted IS 100/101. After clipping,the corresponding numbers are 5 and 10/11. Clipping changes the original importance calculation.
48. 정책 확률 검증Validate policy probabilities
어떤 행동 정책 행이 [1/2,1/3]입니다. 빠진 확률을 실습이 임의로 나눠 줘도 되나요?
A behavior row is[1/2,1/3]. May the lab silently distribute its missing probability?
풀이와 확인할 이유Solution and explanation
합이 5/6이므로 불완전합니다. 남은 1/6의 배분은 실제 정책을 바꾸므로 선언을 수정하도록 거절해야 합니다. 정확한 가중치에는 정확히 정의된 분모 정책이 필요합니다.
The sum is 5/6. Allocating the missing 1/6 changes the policy,so reject and require a corrected declaration. Importance denominators need a fully defined behavior rule.
49. 초기 분포도 바뀌는 경우A changed initial-state distribution
한 단계 보상은 A에서 항상 10,B에서 항상 0입니다. 행동 정책은 같지만 시작 A 확률이 자료에서는 4/5,목표 모집단에서는 1/5입니다. 행동 비 1만 쓰면 무엇을 놓치나요?
One-step rewards are always 10 in A and 0 in B. Actions match,but start-A probability changes from 4/5 in data to 1/5 in the target population. What is missed by action ratios of 1?
풀이와 확인할 이유Solution and explanation
자료 기대는 8,목표 기대는 2입니다. 행동 비만으로 초기 상태 분포 변화를 보정할 수 없습니다. 이 장의 API는 초기 분포가 유지된다는 범위이며 별도 모집단 이동 보정은 구현하지 않습니다.
The source expectation is 8 and target expectation 2. Unit action ratios cannot correct changed initial distributions. The API explicitly holds the initial distribution fixed.
50. 중단 경로와 중요도 평가Truncated paths and trajectory IS
에피소드가 진짜 종료 전 중단되어 뒤 보상이 없습니다. 꼬리 추정값을 임의로 붙이고 완전 경로 IS라고 부를 수 있나요?
An episode is truncated before true termination and later rewards are missing. Can an arbitrary tail estimate be labeled complete-trajectory IS?
풀이와 확인할 이유Solution and explanation
아닙니다. 관측된 전체 수익률과 부트스트랩 꼬리를 섞은 다른 추정입니다. 본 offpolicy API는 이런 입력을 거절합니다. 별도 방법을 쓰려면 꼬리 추정·지원·편향의 전제를 명시해야 합니다.
No. This combines observed rewards with an estimated tail and is a different estimator. The offpolicy API rejects it;another method needs explicit tail,support and bias assumptions.
51. GDP 수준과 변화 수GDP levels versus changes
한국 GDP 수준 1980~2024년 45개로 인접 연도 성장률을 만듭니다. 성장률 개수와 첫 예측의 상태를 설명하세요.
Use 45 Korean GDP levels from 1980–2024 to form adjacent-year growth rates. How many rates are there,and what is the first forecast context?
풀이와 확인할 이유Solution and explanation
차이는 44개입니다. 1981년 예측 전에 이 자료 안의 1979→1980 성장률은 없으므로 첫 상태는 unknown입니다. 현재 1981년 성장률을 상태로 주면 정답 누출입니다.
There are 44 changes. No 1979–1980 growth is available in this selection,so the first 1981 context is unknown. Supplying current 1981 growth as context leaks the answer.
52. 짝수 기준 정답률Reference even-prediction accuracy
제공 훈련 손글씨 3,823개 중 짝수 정답이 1,900개입니다. 항상 짝수 목표의 전체 정보 정확도를 쓰고 무엇이 관측·선택인지 구별하세요.
The 3823 training digits include 1900 even labels. Give the full-information accuracy of always-even and separate source observation from a policy choice.
풀이와 확인할 이유Solution and explanation
정확도는 1900/3823입니다. 정답 라벨은 원 관측이며 항상 짝수 목표와 정오 1/0 점수는 선택한 평가 규칙입니다. 원자료에 이 정책의 실제 행동 로그가 있던 것은 아닙니다.
Accuracy is 1900/3823. Labels are original observations;the always-even target and correctness scoring are declared choices. The source did not contain an actual interaction log for this policy.
53. 픽셀 위치Locate a pixel
8×8 이미지를 행 우선으로 0부터 셉니다. p18의 행·열을 사람이 읽는 1부터 센 번호로 구하세요.
An 8×8 image uses zero-based row-major pixel indices. Give human one-based row and column for p18.
풀이와 확인할 이유Solution and explanation
18=2×8+2이므로 0부터는 행 2,열 2,사람의 번호로 세 번째 행 세 번째 열입니다. 18번째 열이나 두 번째 행이라고 읽지 않습니다.
Since 18=2×8+2,the zero-based coordinates are(2,2),or third row and third column in one-based language.
A 44-episode country log has weight sum 34,weighted-return sum 30,and squared-weight sum 68. Compute ordinary IS,weighted IS and ESS.
풀이와 확인할 이유Solution and explanation
일반은 30/44=15/22,가중은 30/34=15/17,ESS는 34²/68=17입니다. 원 성장률 경로를 아는 전체 정답률 19/22와 같은 계산은 아닙니다.
Ordinary IS is 15/22,weighted IS 15/17,and ESS 17. These are not the same calculation as the full-information accuracy 19/22.
55. 훈련 로그와 시험 역할Training logs and the test role
손글씨 훈련 로그 N=3823,가중 수익률 합 1808,가중치 합 3690입니다. 두 추정과 이미 이전 장에서 본 제공 시험 자료의 올바른 설명을 쓰세요.
For training digits,N=3823,weighted-return sum 1808,and weight sum 3690. Find both estimates and describe the provided test that was examined in earlier chapters.
풀이와 확인할 이유Solution and explanation
일반은 1808/3823,가중은 1808/3690=904/1845입니다. 시험 자료는 이미 본 외부 자료 묶음입니다. 새로 전혀 보지 않은 검증이라고 부르지 않으며 여기서 목표를 계속 고르면 선택 편향이 생깁니다.
Ordinary IS is 1808/3823 and weighted IS 904/1845. The provided test is a previously inspected external roster,not a newly untouched test. Further target selection there risks selection bias.
56. 원 수량과 작업 단위Original quantities and labor units
송장 일곱 수량은 6,6,8,6,6,2,6입니다. 두 품목을 한 노동 묶음으로 보는 가정 아래 총 묶음과 균등 행 추출의 평균 도착량을 구하세요.
Invoice quantities are 6,6,8,6,6,2,6. Under the assumption of two items per labor batch,find total batches and mean arrival under uniform row resampling.
풀이와 확인할 이유Solution and explanation
총수량 40을 2로 나누면 20묶음입니다. 일곱 행 균등 추출 평균은 20/7입니다. 상품이 실제로 같은 노동을 요구한다거나 관측 일별 수요가 이 분포라는 결론은 별도 증거가 필요합니다.
Total quantity 40 gives 20 batches and uniform-row mean 20/7. Equal labor requirements and this being an actual daily arrival law are additional assumptions,not original observations.
57. 처리 점수 한 번One service-score calculation
미처리량 3,용량 3,새 도착 4입니다. 상한 4,점수=3×처리−용량−넘침/2−다음 미처리/10일 때 점수를 구하세요.
처리는 0,상한 전 7,넘침 3,다음 미처리 4입니다. 점수는 −3/2−4/10=−19/10입니다. 새 도착을 현재 처리 이전에 넣는 다른 순서로 계산하지 않습니다.
Serve 0,pending 7,overflow 3,next backlog 4. Score is−3/2−4/10=−19/10. Serving before arrivals is part of the declared timing.
59. 기업 경로의 추정Evaluate company paths
목표 용량 3의 행동 확률은 3/5이고 목표는 매번 그 행동을 합니다. 3회차 24게임 중 세 경로만 전부 일치하며 가중 수익률 합은 13699/216입니다. 가중치 합과 두 IS를 구하세요.
Behavior chooses target capacity 3 with probability 3/5. Three of 24 three-round games match every target action;weighted-return sum is 13699/216. Find weight sum and both IS estimates.
풀이와 확인할 이유Solution and explanation
각 양의 경로 비는 125/27,합은 125/9입니다. 일반은 (13699/216)/24=13699/5184,가중은 (13699/216)/(125/9)=13699/3000입니다. 한 단계 비 5/3만 쓰면 틀립니다.
Each positive path weighs 125/27,total 125/9. Ordinary IS is 13699/5184 and weighted IS 13699/3000. Using only a one-step ratio 5/3 omits two decisions.
60. 기준값의 의미Interpret the reference value
가정한 사흘 작업 게임의 모든 도착 경로를 열거한 값이 215156/42875이고 로그 가중 IS는 13699/3000입니다. 어느 숫자가 원회사의 참된 정책 가치이며 왜 다른가요?
Enumerating all arrivals in the assumed three-round game gives 215156/42875,while logged weighted IS is 13699/3000. Which is the source company’s true policy value,and why do they differ?
풀이와 확인할 이유Solution and explanation
둘 다 원회사의 참값이라고 할 수 없습니다. 첫 값은 선언한 게임의 정확한 목표 기대,둘째는 가상 유한 로그의 가중 추정입니다. 표본·지원 겹침·정규화가 차이를 만들 수 있고 실제 작업 법칙·비용·정책 효과는 자료만으로 식별되지 않았습니다.
Neither is established as the company’s true operational value. The first is the exact target expectation in a declared game;the second is an estimate from a finite simulated log. Sampling,overlap and normalization can differ,and real work dynamics,costs and intervention effects were not identified.
자료별 확보일·원행 식별·단위·이용 조건은 출처 기록을 확인하세요. 학습 사본은 제공처의 현재 최신 자료와 다를 수 있습니다.Consult each source record for retrieval dates, row identifiers, units and terms. Teaching copies can differ from current provider releases.