easy puzzles
easy | probability |
Let be a random variable that takes value 0 or 1 with 50% probability each. You need to define a new random variable as a function of , such that has the value 1 with 25% probability and 0 otherwise.
Use as an independent copy of .
where is an independent copy of
Given is a random variable such that .
These mathematical entities typically represent a real world concept. For example, this can take value 0 or 1 based on the outcome of a coin toss, say Tails representing 0 and Heads represeting 1. But we can toss this coin again, and get another sample independent of the first outcome. Let take the value 0 or 1 based on this second toss, independent of the first toss. This is the concept of an independent copy.
Let be an independent copy of . It has the same probability distribution as but the value may or may not be the same.
Thus,
Also, we can imagine if one coin-toss has probability of 1/2 for a heads, then the probability will be 1/4 for both coins to show up heads.
Hence, we can define = 1 if both and are 1, and 0 otherwise.
We can also use product operator to simplify this relationship.
This way, if both and are 1 then will be 1, otherwise zero.
This is not the same as because can take the value 0 or 1 with probability 50% each.
Programming Variant
Following is the programming version of this question:
Function f1()
returns true
or false
with 50% probability each, define function f2()
that can return true
with 25% probability, and false
otherwise. You may use the function f1
.
This can be answered using the and gate.
def f2():
return f1() and f1()