Score:1

Is the xor of a prg and a function still a prg?

hm flag

I have this couple of deterministic functions $G_1$ and $G_2$. Suppose at least I of them is a PRG. Take $G^*=G_1(x)$ xor $G_2(x)$ with the same $x$. I have to show whether this is still a PRG. I thought about this counterexample: if $G_1=G_2$ then $G^*$ cannot be a PRG but my teacher said then $G^*$ isn't interesting.

What should I do?

Gee Law avatar
cn flag
Maybe you should ask your teacher what your teacher means by "interesting".
fgrieu avatar
ng flag
If the teacher asked the question in these terms and did not accept this perfectly valid counterexample, changing teacher might be the best option. On the other hand, it's quite possible that a part of the puzzle is missing or distorted.
Score:-2
et flag

Take 2 bits $x1$ & $x2$ generateD by $G_1$ & $G_2$ respectively. Let $G_2$ be a good PRG i.e $x2$ generated by $G_2$ is perfectly random. So there is 50% probability that $x2$ is $0$ or $1$. Let $G_1$ be a terrible PRG - i.e. it always generates the same value.

Truth table of $x1$ XOR $x2$

x1 x2 output
1 0 1
1 1 0
1 0 1
1 1 0

Even with a fixed $x1$ (i.e. $x1$ is always 1), the output after XOR with a perfectly Random $x2$ has 50% probability of being 0 or 1. i.e. $G_1$ $XOR$ $G_2$ is a PRG.


More formal Proof

Let's have a biased $a$ and a perfectly unbiased $b$:

$P(a = 0) = x$

$P(a = 1) = 1 - x$

$P(b = 0) = 0.5$

$P(b = 1) = 0.5$

$P(a\text{ XOR } b = 0) = $

$= P(a = 0) * P(b = 0) + P(a = 1) * P(b = 1) =$

$= x * 0.5 + (1 - x) * 0.5$

$= 0.5x + 0.5 - 0.5x$

$= 0.5$

$P(a \text { XOR } b = 1)$

$= P(a = 1) * P(b = 0) + P(a = 0) * P(b = 1) $

$= (1 - x) * 0.5 + x * 0.5$

$= 0.5 - 0.5x + 0.5x $

$ = 0.5$

Cristie avatar
hm flag
I'm sorry but i don't see your point, this seems to me just an example where $G^*$ is a PRG and not a proof it is always.
et flag
@Cristie - see the proof after the example. `The function generating `a` is not fixed like in the example. The bias is variable - i.e. `x`. Irrespective of what value `x` is, the output is unbiased
cn flag
This is not correct since the output sequences are not independent.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.