The University of Melbourne · FACULTY OF ARTIFICIAL INTELLIGENCE

COMP90054 Chap.7 Bandits and Monte Carlo Prediction

- one subject, every graph, every model, every mark
5 Chapters3-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 7 of 11 · COMP90054

Bandits and Monte Carlo Prediction

Define multi-armed bandit

The course material gives this chapter a concrete anchor: Stable Week 7 content joins bandit strategy and model-free Monte Carlo prediction.

That multi-armed bandit anchor controls how epsilon-greedy is explained and how Monte Carlo return is tested in changed practice.

Bandits and Monte Carlo Prediction turns multi-armed bandit, epsilon-greedy and Monte Carlo return into executable reasoning.

The chapter's practical target is to estimate action or state value from sampled returns and choose an exploration strategy, so every explanation should connect syntax to program state, control flow and observable output.

Treat multi-armed bandit as a precise program object, not a loose label.

Identify the value or responsibility of multi-armed bandit before execution, then trace what can read it, change it or depend on it.

This makes state changes visible before they become debugging guesses.

Formula checkpoint: multi-armed bandit

Monte Carlo return
Gt=k=0Tt1γkRt+k+1G_t=\sum_{k=0}^{T-t-1}\gamma^kR_{t+k+1}

The episodic return discounts rewards observed after time t until terminal time T.

Trace epsilon-greedy

Use epsilon-greedy to explain the program's next move.

Work through one representative epsilon-greedy input by hand and name the branch, iteration or call that follows. If the epsilon-greedy trace cannot be stated, the code may run by accident rather than by understood design.

Bring in Monte Carlo return as the test of structure.

Compare normal, boundary and invalid inputs for Monte Carlo return; state the expected behaviour first; then use the mismatch between expectation and result to localise the defect.

For the application — estimate action or state value from sampled returns and choose an exploration strategy — write the smallest complete example that exposes the rule.

Explain why the Monte Carlo return result works, what would break it and how the program should signal or recover from that failure.

Test with Monte Carlo return

Before running an example involving multi-armed bandit, make a trace table with the important state before and after each operation.

Include the value associated with multi-armed bandit, the control decision governed by epsilon-greedy and the output or object affected by Monte Carlo return. The multi-armed bandit table turns an unexplained result into a sequence that can be tested one transition at a time.

Test three inputs: an ordinary case, a boundary case and an invalid case.

State the expected Monte Carlo return result for each before execution, then compare it with what the program actually does. A useful test of epsilon-greedy isolates one rule; changing several conditions at once cannot reveal which condition caused the failure.

Practise explaining the solution without reading the code.

For comp90054, name the data representation, the control flow, the responsibility of each function or class and the reason the chosen design supports estimate action or state value from sampled returns and choose an exploration strategy.

This Monte Carlo return rehearsal matters when a written test or interview asks why the program works rather than whether it produces one correct output.

Transfer to Bandits and Monte Carlo Prediction

A complete response should make the task visible before the detail: identify what must be decided, define the relevant terms, connect the evidence to epsilon-greedy, and use Monte Carlo return to test the result.

The final sentence about Monte Carlo return should answer the question actually asked rather than merely repeat the topic.

The controlling limit is specific: Sample averages can be biased by policy, non-stationarity, rare events and inadequate coverage.

Keep that Monte Carlo return limit beside the worked example, because it separates a careful comp90054 answer from one that sounds confident but claims more than the task or evidence supports.

For revision, retrieve multi-armed bandit, epsilon-greedy and Monte Carlo return without notes, explain their relationship aloud, then complete a changed version of the application: estimate action or state value from sampled returns and choose an exploration strategy.

Record the first failed epsilon-greedy reasoning move and repair it before attempting another case.

In this chapter

What this chapter covers

  • 01

    multi-armed bandit

  • 02

    epsilon-greedy

  • 03

    Monte Carlo return

  • 04

    Applying multi-armed bandit

  • 05

    Limits of epsilon-greedy and Monte Carlo return

Worked example · free

Compute an episodic return

Q [4 marks]. AskSia-authored practice. From time t the rewards are 3, 2 and 4 and gamma is 0.5.
  • 1Write Gt = 3 + 0.5×2 + 0.25×4.
  • 1Calculate 5.
  • 1Attach the episode and policy boundary.
  • 1Explain why more samples are needed for value.
The observed return is 5. It is one sample of policy value, not the value itself, and later rewards are discounted by powers of gamma.
Sia tip — Keep sampled return distinct from its expected value.
Glossary

Key terms

multi-armed bandit
Sequential choice problem balancing uncertain action rewards without state transitions. This chapter uses the concept when students estimate action or state value from sampled returns and choose an exploration strategy. Use this definition when the task is to estimate action or state value from sampled returns and choose an exploration strategy.
epsilon-greedy
Policy choosing a currently best action most of the time and a random action with probability epsilon. It helps explain the reasoning required to estimate action or state value from sampled returns and choose an exploration strategy. Use this definition when the task is to estimate action or state value from sampled returns and choose an exploration strategy.
Monte Carlo return
Discounted sum of rewards observed from a time step until episode termination. Its limit matters because sample averages can be biased by policy, non-stationarity, rare events and inadequate coverage. Use this definition when the task is to estimate action or state value from sampled returns and choose an exploration strategy.
FAQ

Bandits and Monte Carlo Prediction FAQ

What is the main task in Bandits and Monte Carlo Prediction?

Estimate action or state value from sampled returns and choose an exploration strategy.

How do multi-armed bandit and epsilon-greedy work together?

Use multi-armed bandit to establish the object or condition, then use epsilon-greedy to explain how it changes the outcome being analysed.

What must a comp90054 answer qualify here?

Sample averages can be biased by policy, non-stationarity, rare events and inadequate coverage.

How should I revise Bandits and Monte Carlo Prediction?

Retrieve multi-armed bandit, epsilon-greedy and Monte Carlo return, apply them to a changed case, and correct the first point where the evidence no longer supports the conclusion.

Study strategy

Exam move

Reconstruct the relationship among multi-armed bandit, epsilon-greedy and Monte Carlo return; complete the chapter application without notes; then test the result against this limit: Sample averages can be biased by policy, non-stationarity, rare events and inadequate coverage.

Working through Bandits and Monte Carlo Prediction in COMP90054? Sia is AskSia’s AI Artificial Intelligence tutor — ask any COMP90054 Bandits and Monte Carlo Prediction question and get a clear, step-by-step explanation grounded in how COMP90054 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 24 of your The University of Melbourne subjects - and 1,000+ Bibles across every Australian university.
Sia - your COMP90054 tutor, unlimited, worked the way the exam marks it
The full 3-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works
Unlock the full COMP90054 Bible + 24 The University of Melbourne subjects
$0.99 Trial