How to calculate the probability of something that relies on multiple booleans when some of them are repeated.

100 Views Asked by At

Ok, sorry for the ambiguous / weird title but I don't know what to call to my problem.

My question is, imagine I have three booleans A, B and C that will randomly be true or false. Now imagine I have different variables that will calculate their value based on these three variables. For example:

object1 = A (so object1 will be true if A is true, 50% chance)

object2 = !A (so object2 will be true if A is false, 50% chance)

object3 = A & B (25% chance)

now, if I complicate this and say object4 is A & A, or A & !A, or B & (A & (!C & !B)), how can I properly calculate these probabilities? It is obvious to me that I have to discard repeated values (so A & A = A) and address contradictions (A & !A will always be false), but I don't know how to express this mathematically.