function P_u=compute_prob_actions(actions, policies, Q_pi)
  % P_u = np.zeros(len(actions)) # initialize the vector of probabilities of each action
  P_u = zeros(length(actions),1);
  % 
  % for policy_id, policy in enumerate(policies):
  %   P_u[int(policy[0,0])] += Q_pi[policy_id] # get the marginal probability for the given action, entailed by this policy at the first timestep
  % 
  % P_u = utils.norm_dist(P_u) # normalize the action probabilities
  % 
  % return P_u

  for policy_id = 1:size(policies,2)

      P_u(policies(1,policy_id))=P_u(policies(1,policy_id)) + Q_pi(policy_id);
  end

 P_u = P_u./ sum(P_u);
end


