I am soon to start my compulsory military service. I applied to the Cyber Warfare Unit of Finnish army. There was a test for applicants. Since the test is done the questions have now been published here: http://erityistehtavat.puolustusvoimat.fi/cyberchallenge.html
Here is question 4:

Two completely isolated programs get one random bit each from different hardware random number generators. After getting the bit each program guesses what the other program's random bit was. Programs can be different and use different strategies for guessing. After running them once, if at least one program guessed correctly, the author of the programs receives a prize.
Is it possible to devise a strategy that provides a 100% chance of winning the prize? If yes, explain the strategy.

I answered no because I couldn't figure out winning strategy. Was that the right answer or did I miss something?

There is actually a solution that will always succeed: Program A will guess the opposite of the value it receives, program B will guess the same value as the one it receives. 

You can also think of that as such: A guesses that they will receive different numbers; B guesses they receive the same. One of them is bound to be correct. If you look at the following table (r for receive, g for guess), you will see that either A or B is always right (* denotes correct response):

rA | rB | gA | gB
0     0    1    0*
0     1    1*   1
1     0    0*   0
1     1    0    1*

