Computer Science
Computer Science-2021.gz:143496
Computer Science
436c0a286d5ab7077d263f110c380b8575036289
Explainable robotic systems: Understanding goal-driven actions in a reinforcement learning scenario

Robotic systems are more present in our society everyday. In human-robot environments, it is crucial that end-users may correctly understand their robotic team-partners, in order to collaboratively complete a task. To increase action understanding, users demand more explainability about the decisions by the robot in particular situations. Recently, explainable robotic systems have emerged as an alternative focused not only on completing a task satisfactorily, but also on justifying, in a human-like manner, the reasons that lead to making a decision. In reinforcement learning scenarios, a great effort has been focused on providing explanations using data-driven approaches, particularly from the visual input modality in deep learning-based systems. In this work, we focus rather on the decision-making process of reinforcement learning agents performing a task in a robotic scenario. Experimental results are obtained using 3 different set-ups, namely, a deterministic navigation task, a stochastic navigation task, and a continuous visual-based sorting object task. As a way to explain the goal-driven robot's actions, we use the probability of success computed by three different proposed approaches: memory-based, learning-based, and introspection-based. The difference between these approaches is the amount of memory required to compute or estimate the probability of success as well as the kind of reinforcement learning representation where they could be used. In this regard, we use the memory-based approach as a baseline since it is obtained directly from the agent's observations. When comparing the learning-based and the introspection-based approaches to this baseline, both are found to be suitable alternatives to compute the probability of success, obtaining high levels of similarity when compared using both the Pearson's correlation and the mean squared error.


Introduction
Explainable robotic systems have become an interesting field of research since they give robots the ability to explain their behavior to the human counterpart [1,2]. One of the main benefits of explainability is to increase the trust in Human-Robot Interaction (HRI) scenarios [3,4].
To get robots into our daily-life environments, an explainable robotic system should provide clear explanations specially focused on non-expert end-users in order to understand the robot's decisions [5]. Often, such explanations, given by robotic systems, have been focused on interpreting the agent's decision based on its perception of the environment [6,7]. Whereas, little work has provided explanations of how the action selected is expected to help it to achieve its goal [8]. For instance, the use of the visual sensory modality often attempts to understand how a deep neural network makes decisions considering a visual state representation. In general, prior work has been focused on state-based explanations [9,10,11], i.e., given explanations take the form of: 'I chose action A because of this feature F of the state'. Nevertheless, explanations from a goal-oriented perspective have so far been less addressed and, therefore, there exists a gap between explaining the robot's behavior from state features and the help to achieve its aims [1].
In this work, we propose two robotic scenarios where the robot has to learn a task using reinforcement learning (RL) [12]. The aim of RL is to provide an autonomous agent with the ability to learn a new skill by interacting with the environment. While RL has been shown to be an effective learning approach in diverse areas such as human cognition [13,14], developmental robotics [15,16,17], and games [18,19,20], among others, an open issue is the lack of a mechanism that allows the agent to clearly communicate the reasons why it chooses certain actions given particular goals [8]. Therefore, it is not easy for a person to entrust important tasks to an AI-based system (e.g. robots) that cannot justify its reasoning [21]. In this regard, our goal-driven approach is concerned with the outcomes of each decision, e.g., an explanation may take the form of: 'action A 1 gives an 85% chance of success the task compared to 38% for action A 2 '.
When interacting with the environment, an RL agent will learn a policy to decide which action to take from a certain state. In value-based RL methods the policy uses Q-values to determine the course of actions to follow. The Q-values represent the value function in reinforcement learning. The value function is an estimation of possible future collected reward starting from an specific situation and following an specific policy. Therefore in practise, the Q-values used to choose what action to perform next. However, the Q-values are not necessarily meaningful in the problem domain, but rather in the reward function domain [22]. Hence, they do not allow the robot to explain its behavior in a simple manner to a person with no knowledge about RL or machine learning techniques. It is clearly not acceptable for the agent to provide explanations to non-expert end-users such as: 'I choose action A 1 because it maximizes future collected reward' or 'I choose action A 2 because it is the next one following the optimal policy' [23].
In this paper, we propose three different approaches that allow a learning agent to explain, using a userfriendly concept, the decision of selecting an action over the other possible ones. In these approaches, explanations are given using the probability of success, i.e., the probability of accomplishing the task following particular criteria related to the scenario. Although we are not automatically generating explanations yet, using the probability of success an RL agent might next explain its behavior not only in terms of Q-values or the probability of selecting an action, but rather in terms of the necessity to complete the intended task. For instance, using a Q-value, an agent might provide an explanation as: 'I decided to go left because the Q-value associated with the action left in the current state is −0.181', which could be the highest Q-value in the reward function domain but is pointless for a non-expert user. Whereas using the probability of success, an agent might give an explanation as: 'I chose to go left because that has a 73.6% probability of reaching the goal successfully', which is much more understandable for a non-expert end-user.
The proposed methods differ in their approach to determining the probability of success. Each approach trades off accuracy against space complexity (understood as the memory required for each method) or applicable problem domain. This paper illustrates empirically the benefits and shortcomings of each approach. We have tested our approaches in 3 simulated robotic scenarios. The first 2 scenarios consists of a robot navigation task where we have used both deterministic and stochastic state transitions. The third scenario consists of a sorting object task where we have used continuous visual inputs in order to test how the introspection-based approach scales up to more complex scenarios.
The first method uses a memory-based explainable RL approach, which we have previously introduced [24] to compute the probability of success in both bounded and unbounded grid-world scenarios. This approach uses a high space complexity, but provides a realistic probability of success since it is obtained directly from the actual agent's observations. The memory-based approach is used as a baseline to verify the accuracy of the other two estimation methods developed in this paper. The new approaches in this paper include a learning-based and an introspection-based method. We hypothesize they significantly reduce the space complexity while obtaining similar results. This reduction in space complexity would also allow these methods to be better suited for domains requiring a continuous state representation. The learning-based method allows the agent to learn the probability of success while the Q-values are learned. The introspection-based method uses a logarithmic transformation to compute the probability of success directly from the Q-values.
2 Explainable reinforcement learning in robotics 2.1 Reinforcement learning RL is studied as a decision-making mechanism in both cognitive and artificial agents [25]. Unlike other learning techniques, RL does not include supervision nor instruction but rather the agent is able to sense changes in the environment due to carried out actions. Hence, new states and numeric rewards are observed by the agent every time-step after performing an action. In other words, an agent must learn from its own experience [26]. The usual interactive loop between an RL agent and its environment is depicted on the right-hand side of Fig. 1, in the interaction between the agent and the environment, where it is possible to observe that the robot performs an action a t from the state s t to reach a new state s t+1 and a reward signal r t+1 as a response from the environment. An RL agent must learn a policy π : S → A, with S being a set of states and A a set of actions available from S. By learning a policy π, the agent looks for the highest possible cumulative future reward starting from a state s t [12]. The optimal policy and the optimal action-value function are referred to as π * and q * respectively.
The optimal action-value function is defined as q * (s, a) = max π q π (s, a) and solved using the Bellman optimality equation for q * , as shown in Eq. (1).
where s t represents the agent's current state, a t the performed action, r is the reward signal received by the agent after performing a t from s t to reach the state s t+1 , and a t+1 is a possible action from s t+1 . Moreover, p is the probability of reaching s t+1 given the agent's current state s t and the taken action a t . To solve Eq. 1, an alternative is to use the on-policy method SARSA [27]. SARSA is a temporal-difference learning method which iteratively updates the stateaction values Q(s, a) using the Eq. (2) as follows: Thus, the optimal action-value function maps states to actions to maximize the future reward (r) over a time (t) as shown in Eq. (3). In the equation, E π [] denotes the expected value given that the agent follows policy π. In continuous representations, an approximation function (e.g., implemented by deep neural networks) allows an agent to work with highdimensional observation spaces, such as pixels of an image [28].

Explainable reinforcement learning
Machine learning techniques are getting more attention everyday in different areas of our daily life. Applications in fields such as robotics, autonomous driving cars, assistive companions, video games, among others are constantly shown in the media [29]. There are different alternatives to model intelligent agents, e.g., by using phenomenological (white-box) models, empirical (black-box) models, or hybrid (grey-box) models [30,31]. Explainable artificial intelligence (XAI) Environment Agent End-users action a t state s t+1 reward r t+1 explanations understanding Figure 1: The explainable reinforcement learning framework. The environment's response is a new state s t+1 and sometimes a reward r t+1 . During and after the learning process, the agent is able to explain its behavior to the end-users, which leads to an increased level of action understanding.
has emerged as a prominent research area that aims to provide black-box AI-based systems the ability to give human-like and user-friendly explanations to nonexpert end-users [32,33]. XAI research is motivated by the need to provide transparent decision-making that people can trust and accept [34].
Up to now, there has been considerable effort to provide agents with instruments to explain their actions to end-users. Nevertheless, in explainable reinforcement learning (XRL), most works have addressed explainability using technical explanations [35]. For instance, [36] presented the programmatically interpretable reinforcement learning framework which works only with symbolic inputs considering deterministic policies, but not covering stochastic policies that are commonly pre-sent in real-world scenarios. Another approach [37] included hierarchical and interpretable skill acquisition. In this approach, the tasks are decomposed in a hierarchical plan with understandable actions. Moreover, [38] introduced a hybrid approach for interpretable policies mixing RL with genetic programming. The approach explains the policies using equations instead of more humanfriendly explanations. In [22] the drQ method was presented, an XRL approach based on reward decomposition [39]. Using a variant of Q-learning, the method decomposed the action-values to better understand the agent's action selection. However, the proposed approach focused on RL practitioners and does not look for end-user explanations.
Additionally, in [6] saliency maps are used to explain the agent's decisions. In this work, a game scenario is used to provide visual explanations with deep RL. In [40] an explainable recommendation system is presented within an RL scheme. Inspired by cognitive science, [41] introduced a game scenario providing causal explanations determined by causal models. However, the particular causal model has to be known in advance for the specific domain. Recently, [42] presented a distal explanation model analyzing opportunity chains and counterfactuals by using decision trees and causal models. As in the previous case, the main drawback is the need for a previously known causal model which is not possible in large-domain problems. In [43] a conceptual framework for XRL is introduced based on the causal explanation network model representing explanations of people's behavior [44]. The proposed casual XRL framework includes a simplified version using the more relevant components for zero-order explanations [33]. While surveying the main XRL approaches, this work also brings insights about the future development of the XRL field, such as the explanation of goals.
Another closely related field is explainable planning, whose primary goal is to help end-users to better understand the plan produced by a planner [34]. In [45], Sukkerd et al. propose a multi-objective probabilistic planner for a simple robot navigation task. They provide verbal explanations of quality-attribute objectives and properties, however, these rely on assumptions about the preference structure on quality attributes. 4

Explainable robotic systems
As robots are giving their first steps into domestic scenarios, they are more likely to work with humans in teams. Therefore, if a robot has the ability to explain its behavior to non-expert users, this may lead to an increase in the human's understanding of the robot's actions [46] as shown within Fig. 1. In this regard, some works have demonstrated explanations to be an effective way of increasing understanding and trust in HRI scenarios. For instance, Want et al. [4] proposed a domain-independent approach to generate explanations and measure their impact in trust with behavioral data from a simulated humanrobot team task. Their experiments showed that using explanations improved transparency, trust and team performance. Lomas et al. [47] developed a prototype system to answer people's questions about robot actions. They assumed the robot uses a cost map-based planner for low-level actions and a finite state machine high-level planner to respond to specific questions. Yang et al. [48] presented a dual-task environment, where they treated the trust as an evolving variable, in terms of the user experience.
Furthermore, Sander et al. [49] proposed to use different modalities to evaluate the effect on transparency in an HRI scenario. They also varied the level of information provided by the robot to the human and measured the understanding responses. In their study, participants reported higher understanding levels when the level of information was constant, however, no significant differences were found when using a different communication modality. Haspiel et al. [50] carried out a study about the importance of timing when giving explanations. They used four different automated vehicle driving conditions, namely, no explanation, explanation seven seconds before an action, one second before an action, and seven seconds after an action. They found that earlier explanations lead to higher understanding by end-users.
In HRI environments, explainable agency [51,1] has been used to refer to robots explaining the reasons or motivations of the underlying decision-making process. For instance, in [52] an HRI environment was presented where users informed that the robot was more intelligent, helpful, and useful when giving expla-nations about its behavior. In [53] an explainability framework was presented using a three-level analysis from the agent's transition history. Furthermore, an extension included a study of the agent's capabilities and limitations [54]. Finally, [55] proposed an episodic memory to save state transitions during the learning process, however, the approach was not implemented.

Goal-driven explanations
As discussed previously, the actions taken by a robot may be explained using technical terms, for instance, comparing Q-values or algorithmically speaking. However, this is not possible to do it successfully if the explanation is addressed to people with no technical knowledge about algorithms or machine learning [22]. In this regard, this work looks for explanations that can be understood by any person interacting with a robot, using terminology similar to human interaction.
On several occasions, intelligent agents and robots deployed in domestic-like environments have to interact with non-expert end-users. An important current research challenge is to improve the ability a robot has to communicate explanations about intentions and performed actions to interacting users [29], especially in case of failure [56].
As aforementioned, although there is increasing literature in different XAI subfields, such as explainable planners, interpretable RL, or explainable agency, just a few works are addressing the XRL challenge in robotic scenarios. In some of those works, although they are in a certain way focused on XRL, they have different aims than ours, e.g., to explain the learning process using saliency maps from a computational vision perspective, especially when using deep reinforcement learning as in [6,57]. In this paper, we focus on explaining goal-oriented decisions to provide an understanding to the user of what motivates the robot's specific actions from different states, taking into account the problem domain.
In HRI scenarios, there are many questions which could arise from a non-expert user when interacting with a robot. Such questions include what, why, why not, what if, how to [58]. However, from a non-expert end-user perspective, we can consider the most rel-evant questions as to 'why?' and 'why not?' [41], e.g., 'why did the agent perform action a from state s' ? Hence, we focus this approach on answering these kinds of questions using an understandable domain language. Thus, our approach explains how the agent's selected action is the preferred choice based on its likelihood of achieving its goal. This is achieved by determining the probability of success. Once the probability of reaching the final state is determined the agent will be able to provide the end-user an understandable explanation of why one action is preferred over others when in a particular state.
In the following subsections, we present different approaches aiming to explain why an agent selects an action in a specific situation given an specific goal. As discussed, we focus our analysis on the probability of success as a way to support the agent's decision as this will be more intuitive for a non-expert user than an explanation based directly on the Qvalues. We introduce three different approaches to estimate the probability of success. The memorybased approach develops a transition network of the domain during learning and has been previously presented by us applied to a grid-world scenario [24]; whereas the learning-based approach uses a so-called P-value learned in parallel with the Q-value. The introspection-based approach proposes a model of self-examination to relate the agent's own motivations and actions directly to the probability of success using a numerical transformation of the Q-values. Therefore, in this work, we extend our previous approach adding two additional alternatives to compute the probability of success with the aim to use fewer memory resources and to be usable in non-deterministic, continuous, and deep RL domains.

Memory-based approach
In [24], we proposed a memory-based explainable reinforcement learning approach to compute the probability of success P s using an RL agent with an episodic memory as suggested in [55]. The episodic memory was implemented using a list (T List ) to save all the state-action pairs transited by the agent through the learning process.
Using the total number of transitions T t and the Algorithm 1 Explainable reinforcement learning approach to compute the probability of success using the memory-based approach.
1: Initialize Q(s, a), T t , T s , P s 2: for each episode do 3: Choose an action a t from s t 5: Take action a t

7:
Save state-action transition T List .add(s t , a t ) 8: Observe reward r t+1 and next state s t+1

13:
until s t is terminal (goal or aversive state) 14: if s t is goal state then 15: for each s,a ∈ T List do 16 Compute P s ← T s /T t 20: end for number of transitions in a success sequence T s , we compute the probability of success P s . In order to obtain T t and T s , the transitions saved in the episodic memory are used, represented as state-action pairs within the list T List . Therefore, when the robot reaches the goal position, the path followed determines the probability The proposed algorithm implements the on-policy method SARSA [27] with softmax action selection. Algorithm 1 shows the memory-based approach to train the robot using the episodic memory. Particularly, line 7 saves into the episodic memory the transited state-action pairs, and in line 19 the final probabilities of success P s is computed after each learning episode.
It has been previously shown that an agent using this memory-based approach is able to explain its behavior using the probability of success in an understandable manner for non-expert end-users at any moment during its operation [24]. However, in this approach, the use of memory increases rapidly and the use of resources is ∼ O(s × a × l × n), where s is the number of states, a is the number of actions per state, l the average length of the episodes, and n the number of episodes. Therefore, this approach is not suitable to high/continuous state or action situations, such as real-world robotics scenarios.

Learning-based approach
Although to compute the probability of success by means of the episodic memory is possible and has previously lead to good results, one of the main problems is the increasing amount of memory needed as the problem dimensionality enlarges. In this regard, an alternative to explain the behavior in terms of the probability of success is by learning it through the agent's learning process.
To learn the probability of success, we propose to maintain an additional set of state-action values. Therefore, learning in parallel the probability of success using a state-action transition table is also an alternative to explain the behavior to non-expert users. We refer to this table as a P-table and as P-value to an individual value inside the table. While using the memory-based approach the episodic memory could increase unrestricted, when using a P-table, as proposed in this learning-based approach, the additional memory needed is fixed to the size of the P-table, i.e., ∼ O(s × a). This represents a doubling of the memory requirements of RL which implies a constant increase to the base algorithm and is therefore negligible.
Similarly to Q-values, to learn the P-values implies to update the estimations after each performed action. In our approach, we employ the same learning rate α for both values, however, the main change with respect to the implemented temporal-difference algorithm is that we do not use a reduced discount factor γ, or in other words, we set it to γ = 1 to consider the total sum of future rewards. From the discount reward perspective, to use γ = 1 does not represent an issue to solve the underlying optimization problem since the Q-values are used for learning purposes, which indeed use a discount factor γ to guarantee the convergence.
As using the discount factor γ = 1, the agent asso-ciates each action based on the total sum of all future rewards, nevertheless, we want to learn a P-value as a probability of success ∈ [0, 1]. Therefore, we do not use the reward r t+1 to update the P-table, instead, we use a success flag ϕ t+1 which consists of a value equal to 0 to indicate that the task is being failed, or a value equal to 1 to indicate that the task has been completed. In such a way, the agent learns the probability of success considering the sum of the probabilities to finalize the task in the future.
The update of the P-values is performed according to Eq. (4) as follows: where a t is the taken action at the state s t . P(s t , a t ) and P(s t+1 , a t+1 ) are the probability of success values considering the state and the action at timestep t and t + 1 respectively. Moreover, α is the learning rate and ϕ t+1 is the success flag used to indicate if the task has been completed or not. Note that γ is not present in Eq. (4) since its value is set to 1.
Algorithm 2 shows the learning-based approach. Particularly, in line 10 the P-table is updated. While the P-table and Q-table share a similar structure and learning mechanism, their roles are quite different with the Q-values driving the agent's policy while the Pvalues are used for explanatory purposes. Separating the role of these values allows the use of ϕ t and r t terms best suited to each purpose. Therefore, ϕ t might be sparse with non-zero values only when the task is successfully completed, whereas r t might be free to take on any form, including incorporation of reward shaping terms [59] which might be difficult to interpret for a non-expert.
The learning method described in Eq. (4) suits only for discrete representations. However, the same learning-based approach can be extended to continuous and larger discrete scenarios by using a function approximators, such as neural networks. As usual, we would need a neural approximator to learn the Q-values and an additional neural network to learn the P-values in parallel.
Algorithm 2 Explainable reinforcement learning approach to compute the probability of success using the learning-based approach. Choose an action a t from s t 5: Take action a t

7:
Observe reward r t+1 and next state s t+1

12:
until s t is terminal (goal or aversive state) 13: end for

Introspection-based approach
Even though the learning-based approach previously presented represents an improvement when compared to the memory-based approach, in terms of using fewer memory resources, it still requires some additional memory to keep the P-values updated. Moreover, during the learning process, time is also needed for computations and for learning episodes in order to obtain a better estimation.
Therefore, we also look for an approach that allows us to estimate the probability of successP s directly from the Q-values using a numerical transformation. As pointed out, the idea of this approach is to relate the Q-values to the probability of success as an introspective means of the agent's self-motivation. In this regard, this approach is more efficient in terms of used memory and time required for the learning, i.e., since it is computed directly from the Q-values, it does not require additional memory leading to the use of resources of ∼ O(1).
Bearing in mind the temporal difference learning approach shown in Eq. (2), the optimal Q-values represent possible future reward, therefore, they are expressed in the reward function domain. Thus, if an agent reaches a terminal state in an episodic task obtaining a reward R T , the associated Q-value approximates this reward. In a simplified manner, we can consider any Q-value Q(s, a) as the terminal reward R T multiplied by the times the discount factor γ is applied, as Q(s, a) ≈ R T · γ n . Using this derivation, when Q(s, a) converges to the true value, we can compute how far away the agent is from obtaining the total reward for any state, using directly the Q-values. Therefore, using the previous argument, we have computed the estimated distance n to the reward, as shown in Eq. (5): where Q(s, a) is the Q-value, R T the reward obtained when the task is completed successfully, and n is the estimated distance, in number of actions, to the reward. After computing the estimated distance n to obtain a reward, we use this value as the base to estimate an estimated probability of successP s . Using a constant transformation, we weight the estimated distance n by 1 2·logγ 10 + 1. Therefore, what we are actually performing is a logarithmic base transformation to estimate the probability of successP s as shown in Eq. (6) and Eq. (7). In our approach, we also take into account stochastic transitions represented by the σ parameter. We will discuss this parameter further in the following section.P This transformation is carried out in order to shape the probability of success curve as a common base logarithm (base 10) that fits the behavior of both previously introduced approaches. Moreover, we shift the curve to a region where the probability values are plausible by adding 1 and multiplying by 1/2. Finally, in order to restrict the value of the probability of success, consideringP s ∈ [0, 1], we compute the 8 Algorithm 3 Explainable reinforcement learning approach to compute the probability of success using the introspection-based approach. Choose an action a t from s t 5: Take action a t

7:
Observe reward r t+1 and next state s t+1 10: Ps≥0 13: end for rectification shown in Eq. (8), which basically consists of assigning a value of 0 when the result is less than that, or 1 when the result is greater than 1.
In algorithm 3, the estimated probability of succesŝ P s is computed at the end in line 12. Although algorithms 1, 2, and 3 share a common structure based on the temporal-difference learning, we decided to show them independently since they do differ in the way they compute the probability of success inside the SARSA method. The three approaches introduced in this section are tested experimentally in a simulated robotic set-up described in the following section.

Experimental set-ups
In this section, we describe the experimental scenarios used to test the proposed approaches. We have designed 3 domestic scenarios using the CoppeliaSim robot simulator [60]. The first 2 experiments use a discrete robot navigation task including deterministic and stochastic transitions. In this scenario, a humanoid robot needs to reach a goal position by moving across different rooms from an initial position. The third experiment is a continuous visual-based sorting task. In this scenario, a robotic arm has to sort different objects with different shape and color using raw images from an RGB camera as inputs.

Robot navigation task
The first scenario used in this work is an episodic robot task in which the transitions can be modeled as a graph, and therefore the Q-values can be approximated using a tabular method. The scenario consists of a simulated robot navigation task comprising of six rooms and three possible actions to perform from each room. The simulated scenario is shown in Fig. 2. Furthermore, two variations are considered for the proposed scenario: deterministic and stochastic transitions.
In the proposed scenario, a mobile robot has to learn how to navigate from a fixed initial position (room 0) through different rooms considering two possible paths to find the table within the goal position (room 5). Moreover, it is also possible to observe that every room in the middle of the paths, i.e., from room 1 to room 4, has an exit that leaves the level. These transitions are treated as leading to an aversive region and, therefore, once any of these exits have been taken, the robot is unable to come back and needs to stop the current learning episode and restart a new one from the initial position. In the scenario, the agent starts from the initial position and may transit two symmetric paths towards the goal position.
We have defined six states corresponding to the six rooms and three possible actions from each state. Actions are defined taking into account the robot's perspective. The possible actions are (i) a L , move through the left door, (ii) a R , move through the right door, and (iii) a S , stay in the same room. These transitions are, in principle, all deterministic. Nevertheless, in some situations, transitions may not be deterministic and may include a certain level of stochasticity or uncertainty, as in partially observable problems, or also sometimes due to noisy sensors, for instance. Therefore, taking into consideration these situations, we have also used a parameter σ ∈ [0, 1] to include When stochastic transitions are used, the next state reached, as a result of performing an action, is any of the possible future states from where the action has been performed. For instance, if the action a L is being performed from the state s 0 , the agent is expected to be in the state s 1 once the action is completed, taking into account deterministic transitions (σ = 0). However, considering stochasticity (i.e., σ > 0), there is also a probability the agent could finish in the state s 0 or the state s 2 since these two are also reachable from the state s 0 (by performing the action a S and the action a R respectively).
For the learning process, the reward function returns a positive reward of 1 when the agent reaches the final state and a negative reward of −1 in case the agent reaches an aversive region, i.e., when it leaves the scenario. Eq. 9 shows the reward function for s.
Although we are aware that this scenario is rather simple from the learning perspective, and thus manageable by an RL agent, in this work we are focusing on giving a basis for goal-oriented explanations regarding fundamental RL aspects using the proposed methods. In this regard, this robot navigation task allows us to obtain valuable initial insights about the behavior of the different proposed approaches and their equivalence. Moreover, following we propose a second scenario in which later we test the approach consuming less resources in order to prove the scalability to more complex scenarios.

Sorting object task
The second scenario used in this work is a continuous visual-based sorting object task [61]. An alternative in continuous states is to approximate the agent's state directly from raw images. For instance, deep RL uses the same RL structure adding a deep neural network in order to approximate the Q-values from raw inputs. In this scenario, a robotic arm has to sort 6 different The robot arm must grab each object and sort them in the lateral tables. The task is completed once the robot has sorted out all the objects. Moreover, if an object is wrongly sorted the learning episode finishes and the task is restarted.
objects. The objects are represented by geometric figures with different colors. The sorting task involves moving the objects from a central table to two other tables located to each side, one for each class of object. Initially, the objects are placed in the central table on random positions. Figure 3 illustrates the sorting object task scenario. The robot is allowed to perform four different actions. The possible actions are (i) grab an object, (ii) drop an object, (iii) move right, and (iv) move left.
To grab and drop an object, the robot has a suction pad that is activated or deactivated respectively. Move right or left, it moves the robot's arm to the indicated position from the robot's perspective. When moving, the suction pad can either have an object or be free. The actions to perform are decided by a neural network by approximating the Q-values, while all the low-level control commands to produce the robot movements are computed using inverse kinematics.
The robot's state is represented with raw images containing 64 × 64 pixels obtained directly from an RGB camera. The raw image is presented to the neural network previously normalized as ∈ [0, 1].
The reward function is defined also considering subgoals, i.e., the robot receives a reward for each object correctly sorted. Moreover, when all the objects are properly sorted, the task is completed and an additional reward is received. If an object is wrongly sorted, the training episode finishes and a negative reward is obtained. Finally, after 18 learning timesteps (the minimal number of steps to complete the task), the robot receives an additional small negative reward in order to encourage it to finish the task as soon as possible. The reward function is shown following: 1 if all the objects are sorted 0.4 if a single object is sorted −1 if an object is incorrectly sorted −0.01 if steps > 18 (10) Thus, if the agent correctly finalizes the task in 18 steps, it receives a total reward of 3, i.e., 0.4 for each of the first 5 objects sorted, and an additional reward of 1 due to the sixth and final object.

Real-world proof of concept
Although this work has been primarily developed in simulated scenarios, we have also run a simple realworld test in order to assess the application with end-users. We have replicated the robot navigation task described in Section 4.1 in a real-world scenario and we have tested our approach with an end-user. The replicated real-world scenario is shown in Fig. 4.
Using this scenario, we have carried out 2 different situations. In the first situation, the robot performed an action from the initial state (room 0). In the second situation, the robot performed an action that led it to the goal position (room 5). In both situations, the

Experimental results
In this section, we describe the results obtained when using the proposed explainable approaches in the scenarios described in the last section. During the robot navigation task, the experiments have been performed using the on-policy learning algorithm SARSA, as shown in Eq. 2, and the softmax action selection method, where a = e Q(st,a)/τ ai∈A e Q(st,ai)/τ , where s t is the current agent's state, a i an action in the set A of available actions, τ is the temperature parameter, and e the exponential function. A total of 20 agents have been trained and thus, the plots in this work depict average results. The parameters used for the training are: learning rate α = 0.3, discount factor γ = 0.9, and softmax temperature τ = 0.25. During the sorting object task, a continuous visual representation is used for the agent's state. Therefore, a function approximator for Q(s t , a t ) (as shown in Eq. (3)) and experience replay [62] are introduced for generalization during the learning process. We implemented the Deep Q-learning algorithm using previous experiences to train a convolutional neural network (CNN) as an approximator for Q-values. The CNN architecture comprises an input of 64 × 64 pixels in RGB channels, 3 convolutional layers (8 × 8 with 4 filters, 4 × 4 with 8 filter, and 2 × 2 with 16 filters, respectively). Each convolutional layer is followed by a 2 × 2 max-pooling layer. Finally, there is a flattened layer and a fully connected layer with 256 neurons. The output of the network includes a softmax function with 4 neurons to represent the Qvalue of each possible action. The experience replay technique uses a memory M containing 128 tuples that include < s t , a t , r t , s t+1 >. Initially, 1000 random actions are performed as a pretraining in order to populate the memory M . Afterwards, the agent learning is carried out. In this experiment, due to the higher learning complexity, only 10 agents have been trained, however as mentioned, plots still show average results. The parameters used for the training are: -greedy action selection with initial = 1 and decay rate = 0.9995, learning rate α = 0.001, and discount factor γ = 0.9. Although the training parameters used in these experiments are not much relevant in terms of explainability, we include them for reference. Certainly, they do affect the agent's learning speed, nevertheless, we focus on better understanding and explaining the agent's decisions.

Deterministic robot navigation task
Initially, we have tested an RL agent moving across the rooms considering deterministic transitions, i.e., performing an action a from the state s i to state s j always reaching the intended state s j with probability equal to 1, or σ = 0. For the analysis, following we plot the obtained Q-values, estimated distance n to task completion, and probabilities of success using the three proposed methods. In principle, we show these values in all cases for the actions performed from the initial state s 0 , nevertheless, similar plots can be obtained for each state. Fig. 5a shows the Q-values obtained over 300 episodes for the actions of moving to the left a L , to the right a R , and staying in the same room a S from the initial state s 0 . It is possible to observe that during the first episodes the agent prefers to perform a R as a consequence of the collected experience which is shown by the blue line. However, as the learning improves, the three actions converge to similar Q-values above 0.6.
In Fig. 5b can be seen the estimated distance n (according to Eq. (5)) from the initial state s 0 to the reward by performing the three available actions. Contrary to the Q-values, the distance needed to reach the reward decreases over time, starting with more than 50 actions and reaching values close to the minimum. It can be seen that action right a R converges faster since the estimated distance is computed according to the agent's experience using the Q-values and the reward. Since the distance n is obtained from the Q-values, it can be produced for any of the proposed approaches, however, we use it specifically to compute the probability of success with the introspection-based approach.
In Fig. 5d are shown the probabilities of success for the memory-based approach taking the different possible actions from the initial state s 0 , i.e., the probability of successfully finishing the task choosing any path from room 0. The three possible actions from this state, i.e., go to the left room a L , go to the right room a R , and stay at the same room a S are shown using red, blue, and green respectively. In the first episodes, any possible action has a very low probability of success since the agent still does not know how to navigate appropriately and, therefore, often selects an action that leads it out of the floor. Over the episodes, the agent tends to follow the path to its right to reach the goal state, however, after 300 episodes all the probabilities converge to a similar value as the agent collects enough knowledge in all paths.
By using the probability of success as a source of information for a non-expert end-user, the RL agent can more easily explain its behavior in terms of its goals and why at a certain point of the learning process one action may be preferred instead of others. For in-stance, after 50 learning episodes, the computed probabilities of success are 48.09%, 70.46%, and 64.24% for actions a L , a R , and a S respectively. Therefore, the robot might justify its behavior as follow: 'From the initial room, I chose to move to the right because it had the biggest probability of successfully finishing the task'. Since the computed probabilities of success using the memory-based approach are obtained directly from the performed actions during the episodes, following we use these results to compare to both: the learning-based approach and the introspection-based approach. Moreover, we use a noisy signal obtained from the memory-based approach as a control group. For all the approaches, including the noisy signal, we compute the Pearson's correlation to measure the similarity between the approaches as well as the mean square error (MSE). Fig. 5e shows the probability of success for the three possible actions from the initial state s 0 using the learning-based approach. Similarly to the memory-based approach, the probabilities show the agent initially prefers to perform the action for moving to the right a R , however, as the previous case, after the learning process, all the probabilities converge to similar values close to 90% of success.
The probabilities of success using the introspectionbased approach are shown in Fig. 5f. As before, the possible actions are shown from the initial state s 0 . The evolution of the probabilities behaves similarly over the episodes as in previous approaches. Initially, the agent favors the action to the right room but the three actions reach a similar probability of success after training.
Equivalently as shown by the learning-based approach, the introspection-based approach in the first episodes gets a probability of success equal to zero P s = 0. This initial behavior is due to the fact that the probability of success P s using the learning-based approach is computed in a similar way as the Q-values, which is updating the P-values inside the P-table. Likewise, the estimated probability of successP s using the introspection-based approach is computed from the Q-values as it is a numerical transformation from the estimated distance n.
Overall, the three proposed approaches have similar behavior when using deterministic transitions reaching similar results in terms of the final probabilities of success from the initial state s 0 and the evolution over the learning process. To further analyze the similarity between the proposed approaches we compute the Pearson's correlation as well as the MSE with respect to the memory-based approach. Additionally, we have used a control group of probabilities of success as a noisy signal from the memory-based approach using 20% of white noise (M = 1, SD = 0.2). We have used that amount of noise since we want to create control data from our baseline approach which are different enough from the original probabilities and, at the same time, distinguishable from each other.
However, in this work, we do not test how tolerant our approaches are to respond to possible noise. The resultant noisy probabilities of success can be seen in Fig. 5c.
In Fig. 6 is shown the correlation matrix for all the approaches. In the figure, axes are the different actions from the initial state s 0 for each proposed method. The uppercase letter refers to the action and the lowercase one refers to the method. Thus, L, R, and S are for the actions of going to the left, to the right, and staying in the same room, whereas m, l, p, and n are for memory-based, learning-based, introspectionbased, and noisy approaches respectively. The figure   14 L m R m S m L l R l S l L p R p S p L n R n S n Actions shows that there is a high correlation between the three proposed approaches, while in our noisy control group the values of the correlations are much lower in comparison. Moreover, Table 1 shows the MSE between the memory-based approach and all the other approaches. It can be seen that the introspection-based approach approach has the least amount of errors in relation to the memory-based benchmark, obtaining an MSE lower than 0.01 for all possible actions, which is achieved with much lower memory-usage than the memory-based approach.

Stochastic robot navigation task
In this section, we have performed the same robot navigation task but using stochastic transitions instead as is the case in many real-world scenarios. In our scenario, to use stochastic transitions means that the RL agent may perform the action a from the state s i to the state s j and may reach the intended state s j Table 1: MSE for all the proposed approaches using deterministic transitions against the memory-based approach. All shown actions are performed from the initial state s 0 .

Deterministic app.
a L a R a S Learning-based 0.0117 0.0110 0.0178 Introspection-based 0.0095 0.0065 0.0083 Noisy Memory-based 0.0187 0.0245 0.0226 with a transition probability p t < 1, or more precisely p t = 1 − σ, with σ ∈ [0, 1] (if σ = 0 deterministic transitions are used, i.e., no stochasticity) taking into consideration the defined transition function. We have introduced a transition probability p t = 0.9, or σ = 0.1. In other words, a 10% of stochasticity in order to test how coherent are the possible explanations extracted from all the proposed approaches. Fig. 7a shows the obtained Q-values after the learning process. The actions shown also correspond to the three possibilities, i.e., a L , a R , and a S , from the initial state s 0 . Similarly to the use of deterministic transitions, the Q-values converge to similar values after 300 episodes, however, in this case the agent favors the action of going left in the first episodes. Certainly, this is not due to the use of stochastic transitions, but rather the agent in this experiment explored initially that path, which can lead to diverse exploration experiences over different learning processes.
In Fig. 7b is shown the estimated distance n in terms of actions to the reward. By using stochastic transitions the distances also decrease over time getting close to the minimal amount of actions. In this case, the action of going to the right a R needs more time to converge since this path is explored later as shown in the Q-values. Fig. 7d shows the probabilities of success during the learning process from the initial state s 0 using stochastic transitions and the memory-based approach. In this case, the agent initially exhibits more experience taking the path to the left; however, after 300 episodes, similarly as before, the probabilities converge to a similar value. Although using stochastic transitions lead to a less overall probability of success, in comparison to the deterministic robot navigation task, the agent In this case, the agent favors going to the left room at the beginning of the training, however, as in the previous case, for each approach all the probabilities converge to similar values after 300 episodes. The estimated probabilities of success are lower than the deterministic case, which is due to the introduced σ-value stochasticity. In the learning-based approach, due to the fact of using a discount factor equals to one (γ = 1), the agent becomes more foresighted and take into consideration all the possible future reward, which leads to slightly higher probabilities of success. The estimated distance n converges close to the minimum for all actions after the learning process.
is still able to explain in these terms the reasons for its behavior during the learning episodes. In this case, after 50 learning episodes, the computed probabilities of success are 68.99%, 51.02%, and 58.65% for actions a L , a R , and a S respectively. Therefore, according to the experience collected by the robot, the behavior might be justified as: 'From the initial room, I chose to go to the left because it had the biggest probability of success'. Like the previous case, we have used the memory-based approach as a baseline to compare the other proposed approaches, since these probabilities are obtained directly from the actual robot experience collected in the episodic memory.
The probabilities of success for the three possible actions from the initial state s 0 using the learningbased approach are shown in Fig. 7e. Like using the memory-based approach, at the beginning of the training, the agent shows more experience by following the path to the left, but also the three actions converge after training. In this case, the probabilities of success converge to a slightly higher amount in comparison to the memory-based approach. This is due to the fact that these probabilities are computed using the P-values from the P-table. These values are updated according to Eq. (4), where we set the discount factor γ = 1 and, therefore, the agent is more foresighted taking into account all possible future rewards. The estimated probabilities of success using the introspection-based approach are shown in Fig. 7f. The probabilities are for the three possible actions from the initial state s 0 as well. The introspectionbased approach has a similar behavior as the memorybased approach, converging to similar values after the learning process when using stochastic transitions. The estimated probabilities are computed from the Q-values using the Eq. 8 and, therefore, it can be similarly seen that the agent preferred the path to the left at the beginning of the training. L m R m S m L l R l S l L p R p S p L n R n S n Actions  As in the deterministic case, we have also used a noisy signal in the stochastic robot navigation task as a control group. We obtained the noisy signal from the memory-based approach since this is computed from the actual agent's interaction during the learning process. Once again, we have added a 20% of white noise using a normal distribution with media 1 and standard deviation 0.2, i.e., (M = 1, SD = 0.2). The noisy signal can be seen in Fig. 7c.
As in the deterministic robot navigation task, we also compute the Pearson's correlation as well as the MSE to analyze the similarity between the obtained probabilities of success P s . In Fig. 8 is shown the correlation matrix for all the approaches. The axes contain the different possible actions from the initial state s 0 for each proposed method. As mentioned, the uppercase letter refers to the action and the lowercase letter refers to the method. Although the correlations are lower in comparison to the deterministic robot navigation task due to the use of stochastic transitions, the figure still shows that there is a high correlation between the three proposed approaches, in opposite to the noisy control group, where the values of the correlations are lower in comparison.
Furthermore, Table 2 shows the MSE between the memory-based approach and the other approaches using stochastic transitions. It is observed that once again the introspection-based approach is the most similar to the memory-based approach, obtaining errors lower than 0.007 for all possible actions, which is also achieved using much less memory in comparison to the memory-based approach.

Continuous sorting object task
In this section, we show the results obtained in a continuous task. The continuous sorting object task has been used along with the introspection-based approach. As demonstrated in the previous section, all the proposed approaches are equivalent in terms of the probabilities of success obtained, however, not all of them are suitable for all problem representations. Moreover, as aforementioned, the introspection-based approach is more efficient ( O(1)) in terms of memory use and time required for learning. In this problem, using the memory-based approach is not feasible since no tabular representation is possible; moreover, the learning-based approach would require the training of an additional neural network as a function approximator. Figure 9a shows the Q-values from the initial state for the 4 possible actions averaged for 10 agents. The results are smoothed using a Savitzky-Golay filter [63] with a window of length 15 and a polynomial of order 3 to fit the data. As mentioned, the Q-values are in the reward function domain and the dominant initial action during the 300 learning episodes is 'grab object', which indeed leads to finish the task faster. The Qvalues for this action vary from 0.25 to 0.45 during the training, thus, if they are directly used to generate an explanation, it would be meaningless for non-expert users.
The probabilities of success are computed directly from the Q-values using the logarithmic transformation introduced in the introspection-based approach. Figure 9b shows the probabilities of success from the initial state for the 4 possible actions. The results are averaged for 10 agents and smoothed using the Savitzky-Golay filter once again with a window of 15 and the data fitted with a polynomial of order 3. In this case, it is observed that estimated probabilities for the action 'grab object' vary from values close to 0.5 to 0.6. This respectively means 50% and 60% of probability for successfully completing the task when performing this action from the initial state. In this regard, an explanation elaborated in such a way may be much more intuitive to follow by non-experts interacting with the robot.
Similarly, counterfactual arguments may be given. For instance, after 300 learning episodes, a user may ask in the initial state 'why the action move right or move left have not been chosen by the agent'. The robot may intuitively answer this question using the computed probability of success for the actions. Thus, an answer may be 'I have selected the action grab object because doing so, I have 59% chances of sorting all the objects successfully, while moving left I have only 38% probability of being successful'.

Real-world scenario
As previously mentioned in Section 4.3, we have performed a simple real-world test involving two different situations. In the first situation, the robot performed the action a R (move to the right) from the initial position (room 0). We showed to the user one of the following explanations: (i) I moved to the right because it has a Q-value of 0.744, or (ii) I moved to the right because it has a 95.8% probability of reaching the table. In the second situation, the robot performed the action a L (move to the left) that led the robot to the goal position (room 5). We showed to the user one of these explanations: (i) I moved to the left because it has a Q-value of 1, or (ii) I moved to the left because it has a 100% probability of reaching the table.
Both Q-values and probabilities of success P s have been computed with the introspection-based approach. As non-expert end-users have no understanding of the meaning of a Q-value necessarily, we hypothesize that an explanation using the probability of success should bring more clear ideas in order to understand the robot's behavior. However, the situations are different. While in the first situation the robot is still far from the reward, in the second situation the robot is initially just one action away from the goal position. Therefore, we consider that end-users may have a general better understanding of the second situation since this needs only one action to complete the task. Therefore in this situation, explanations may make more sense to users regardless if they are shown using Q-values or the probability of success. Another aspect that may affect the explainability judgment is the previous experience in the current scenario. Whatever situation is experienced first by an end-user, this may bias the next situation, since they have already seen the robot acting and may have a better perception of the robot's behavior. Nevertheless, we have performed this test as a proof of concept and we do believe that further human-robot interactive experiments are needed in order to draw meaningful conclusions. For instance, it is important to test the approaches including end-users with different backgrounds, aiming at people with no experience in machine learning. Additionally, including people with different levels of educational background (e.g., English language, knowledge in math, etc.) would also benefit future tests since our explanations are intended for non-expert end-users as widely as possible.

Conclusions
In this work, we have presented an explainable robotic system to supply understandable human-like explanations to an end-user in a human-robot environment. The experimental scenarios have been carried out using a robot simulator where 2 robotic tasks have been implemented. Additionally, a real-world proof of concept has been carried out in order to validate the probability of success as a valid metric for explainability purposes. The proposed approaches do not focus on speeding up the learning process nor on generating automatic explanations, but rather on looking for a plausible and practical means of explaining the robot's behavior during the decision-making process. For this purpose, we have used goal-driven explanations instead of state-based explanations.
The proposed approaches estimate the probability of success for each action, which in turn allows the agent to explain the robot's decision to non-expert end-users. By describing decisions in terms of the probability of success, the end-user will have a clearer idea about the robot's decision in each situation using human-like language. On the contrary, using Q-values to explain the behavior, the end-users will not necessarily obtain a straightforward comprehension unless they have prior knowledge about reinforcement learning or machine learning techniques.
We have implemented three approaches with different characteristics. First, the memory-based approach uses an episodic memory to save the interaction with the environment from which it computes the probability of success. Second, the learning-based approach utilizes a P-table where the values of the probability of success are updated as the agent collects more experience during the learning process. Third, the introspection-based approach computes the estimated probability of success directly from the Q-values by performing a numerical transformation. The proposed approaches differ in both the amount of memory needed and the kind of RL problem representation where they could be used.
Using either deterministic or stochastic transitions in the robot navigation task, the obtained results show that the proposed approaches accomplish similar behavior and converge to similar values, which is also verified through the high correlation level and the MSE computed. Overall, from the similarity exposed by the three proposed approaches, the learning-based approach and the introspection-based approach represent a plausible choice for replacing the memorybased approach to compute the probability of success, using fewer memory resources and being an alternative to other RL problem representations. In this regard, the introspection-based approach is the one requiring fewer resources in comparison to the 2 others. Additionally, we have demonstrated that the introspection-based approach is easily scaled up to continuous scenarios by implementing the visual-based sorting object task.
Although we have used simulated scenarios, an additional important aspect to consider in explainable robotic systems is real-world scenarios in which human-robot trust may be critical, such as medical or safety scenarios, or when decisions are taken based on biased data [64]. If a robot is required to give an explanation during the first learning stages, the RL agent may not have collected all the necessary information to answer properly. In other words, the robot may provide an incorrect or poor explanation that although it may be the best to its current knowledge, still it is not necessarily correct after the optimal policy has been learned. If this explanation seems coherent to the end-user, this may create an unjustified trust feeling and lead to inappropriate decisions, and in critical cases exposing the human to unsafe or risky situations. If the explanation is obviously wrong, this may deteriorate the trust relationship and the human counterpart may not tolerate that kind of answer in the future [65]. A comprehensive explanation is sometimes impossible given that the underlying algorithms may be too complex to explain to non-expert end-users. Sometimes, it is not possible due to privacy breaches. Nevertheless, it is important to focus on explaining the robot's behavior to keep it accountable and working according to the laws [66].
As future works, we see reward decomposition [22] as a good alternative to include additional reward signals, such as more complex penalties, or to address multi-objective problems. In this regard, each meaningful part of the reward signal may be decomposed in order to compute the different independent probabilities of success and generate explanations for each of them. It is also important to test how much impact different values of stochastic transitions, represented by the σ parameter, especially considering that in real-world scenarios stochasticity may vary between states.
We also plan to use a real-world robot scenario in order to automatically generate explanations to be given to non-expert end-users. Using a real-world scenario, we plan to perform a user study to measure the effectiveness of the probability of success as a metric to enhance the trust in robotic systems. show the results for Q-values, and for the three proposed methods. Fig. 10a, 10b, 10c, and 10d show the results obtained after 300 learning episodes for the Q-values and the probabilities of success using the memory-based approach, the learning based-approach, and the introspection-based approach, respectively.
When the robot is placed in the state s 1 , the action of moving to the left a L leads it to a terminal aversive area, therefore, the associated Q-value and probabilities of success are close to zero. Nevertheless, due to stochastic transitions, the robot still is able to reach a different room and, hence, the associated Q-value and probabilities of success are not necessar-ily null. Conversely, the action of moving to the right a R has bigger Q-value and probability of success in comparison to staying at the room a S , since a R leads the robot to the state s 3 which is closer to the goal state. For the obtained probabilities of success using the three approaches, actions of moving right a R and staying at the same room a S increase their values in comparison to the Q-value to represent a better estimation of the real probability of success in each case. The action of moving to the left, in all cases remains low with values near to zero.
For instance, after 300 learning episodes and with the robot just performing an action from s 1 , an end-user could ask an explanation as: why did you move to the right in the last situation? If the robot uses the probability of success to explain why action a R has been chosen when being in the state s 1 , the following explanation could be provided: 'In state s 1 , I chose to move to the right because it has a probability of success of: (i) 86.91%, (ii) 93.75%, or (iii) 85.93%'.
The previous values are from using the memory-based, learning-based, and introspection-based approaches respectively. As previously discussed, we consider the memory-based approach the more accurate estimation for the probability of success, since this value is obtained directly from the actual robot's transitions. In this case, the Q-value is 0.8166, therefore, the proposed methods approximate more precisely the real probability and potentially give a more informative answer to a non-expert end-user. Equivalently, if the end-user asks an explanation as: why did you not move to the left in the last situation? As before, using the probabilities of success to explain the counterfactual of why action a L has not been chosen when being in the state s 1 , the explanation can be constructed as follows: In state s 1 , I did not choose to move to the left because has only a probability of success of: (i) 4.76%, (ii) 14.60%, or (iii) 22.67%. These values also using the memory-based, learning-based, and introspection-based approaches respectively. The associated Q-value, in this case, is 0.1202. Although the deviation is higher, the proposed approaches are able to approximate the probability of success in the stochastic scenario.