I have a set of Bernoulli variables, giving specific values with different probabilities. The variables are independent. I'm trying to build a simple discrete probability table for all the possible outcomes. A short example of the data I have is:
# A tibble: 2 x 4
`test number` prob value `no-value`
<dbl> <dbl> <dbl> <dbl>
1 1 0.7 1.7 0.3
2 2 0.6 1.5 0.6
and the solution I'm trying to find is:
# A tibble: 1 x 5
value `3.2` `2.299999999999999~ `1.8` `0.8999999999999999~
<chr> <dbl> <dbl> <dbl> <dbl>
1 probability 0.42 0.280 0.18 0.12
Where the value is the sum of the possible values and the probability is the probability of this value.
The example I'm using is from an excel sheet. The table I'm working on is a long list of independent tests. Each test has a possible value for success, a probability for success and a value for no success (with 1 - probability for failure). The probability table is a table that calculates the probability for each possible outcome - possible values (summing the values for that outcome) and the probability for that outcome. So the first possible outcome 3.2 = 1.7 + 1.5 has a probability of 0.42 = 0.7 * 0.6. The second outcome is 2.3 = (1.7 + 0.6) with a probability of 0.28 = (0.7 * (1 - 0.6) and so on.