0

# Probability of A given B

Unsolved
###### Prob. and Stats

Difficulty: 2 | Problem written by peter.washington
Given two lists of binary events A and B, where an event occurring is denoted as 1 and an event not occurring is denoted as 0, calculate P(A | B).

A[i] indicates whether event A occurred at time i or not. Same for B[i].

##### Sample Input:
<class 'list'>
A: [1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
<class 'list'>
 B: [0, 1, 1, 1, 0, 1, 0, 1, 0, 1]

##### Expected Output:
<class 'float'>
0.16666666666666666

MLPro Premium also allows you to access all our high quality MCQs which are not available on the free tier.

Not able to solve a problem? MLPro premium brings you access to solutions for all problems available on MLPro

Have an issue, the MLPro support team is available 24X7 to Premium users.