import math


def log_loss_one_example(prob, outcome):
  # type: (float, int) -> float
  """Returns log loss of given prediction for given 0/1 outcome."""
  return - outcome*math.log(prob) - (1-outcome)*math.log(1-prob)