In an agentic AI system, a state graph represents possible states and transitions between them. Which statement best describes a deterministic transition?
Think about whether the next state is fixed or can vary for the same action.
Deterministic transitions mean that for a given state and action, the next state is always the same, with no randomness involved.
Given the following Python function representing state transitions, what is the output of next_state('S1', 'a')?
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'))
Check the dictionary for state 'S1' and action 'a'.
The dictionary maps 'S1' with action 'a' to 'S2', so the function returns 'S2'.
In a stochastic state graph, transitions have probabilities. If you want the agent to explore more states randomly, which transition probability setting is best?
Think about how equal chances affect exploration.
Equal probabilities encourage the agent to explore all possible next states rather than favoring one.
You have a model predicting next states in a state graph. Which metric best measures how often the model predicts the correct next state?
Consider a metric that counts correct predictions over total predictions.
Accuracy measures the fraction of correct next state predictions out of all predictions.
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'))Check what happens if the action key does not exist in the dictionary.
Accessing a missing key in a dictionary raises a KeyError in Python.