0
0
Agentic AIml~20 mins

State graphs and transitions in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
State Graph Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding State Transitions in Agentic AI

In an agentic AI system, a state graph represents possible states and transitions between them. Which statement best describes a deterministic transition?

AEach state has exactly one possible next state for a given action.
BA state can transition to multiple next states randomly for the same action.
CTransitions depend on external random noise, making outcomes unpredictable.
DStates loop back to themselves without any change.
Attempts:
2 left
💡 Hint

Think about whether the next state is fixed or can vary for the same action.

Predict Output
intermediate
2:00remaining
Output of State Transition Function

Given the following Python function representing state transitions, what is the output of next_state('S1', 'a')?

Agentic AI
def next_state(current_state, action):
    transitions = {
        'S1': {'a': 'S2', 'b': 'S3'},
        'S2': {'a': 'S2', 'b': 'S1'},
        'S3': {'a': 'S1', 'b': 'S3'}
    }
    return transitions.get(current_state, {}).get(action, 'Invalid')

print(next_state('S1', 'a'))
A'S3'
B'Invalid'
C'S1'
D'S2'
Attempts:
2 left
💡 Hint

Check the dictionary for state 'S1' and action 'a'.

Hyperparameter
advanced
2:00remaining
Choosing Transition Probability in Stochastic State Graphs

In a stochastic state graph, transitions have probabilities. If you want the agent to explore more states randomly, which transition probability setting is best?

AAssign high probability to one transition and near zero to others.
BAssign equal probabilities to all possible transitions.
CAssign zero probability to all transitions except one.
DAssign probabilities based on the shortest path only.
Attempts:
2 left
💡 Hint

Think about how equal chances affect exploration.

Metrics
advanced
2:00remaining
Evaluating State Transition Model Accuracy

You have a model predicting next states in a state graph. Which metric best measures how often the model predicts the correct next state?

AAccuracy
BPrecision
CMean Squared Error (MSE)
DRecall
Attempts:
2 left
💡 Hint

Consider a metric that counts correct predictions over total predictions.

🔧 Debug
expert
2:00remaining
Debugging State Transition Code

What error does the following code raise when calling get_next_state('S1', 'c')?

def get_next_state(state, action):
    transitions = {
        'S1': {'a': 'S2', 'b': 'S3'},
        'S2': {'a': 'S2', 'b': 'S1'},
        'S3': {'a': 'S1', 'b': 'S3'}
    }
    return transitions[state][action]

print(get_next_state('S1', 'c'))
ATypeError
BIndexError
CKeyError
DNo error, returns None
Attempts:
2 left
💡 Hint

Check what happens if the action key does not exist in the dictionary.