In my course on probabilistic graphical models, my professor made a claim which I find a little sus. In discussing the equivalence between Markov Random Fields and Factor Graphs, the following example was given:


An MRF over 3 variables was drawn as a triangle graph (3-cycle). This admits density function like $\psi(x, y, z)$. Naturally, an equivalent factor graph can be drawn by having only one factor connected to all three variables, $p(x,y,z) \propto f(x, y, z)$. However the example where a factor graph with three factors, one along each edge, was also considered, which admits a density like $p(x,y,z) \propto f\_1(x,y) \cdot f\_2(y,z) \cdot f\_3(x,z)$.


The question was posed that all three graphical models are equivalent for the appropriate choice of factors. Formally, the claim is as follows:



> 
> For any nonnegative function $f(x,y,z)$, there exists nonnegative functions $u, v, w$ such that $f(x,y,z)=u(x,y)\cdot v(y,z)\cdot w(x,z)$. We can assume that $x,y,z \in \{0,1\}$.
> 
> 
> 


My guess at a counterexample would be a function along the lines of $f(x,y,z) = xy + yz + xz$, but I'm stuck at finding a way to *prove* that this cannot be written as a product of pairwise factors.


Intuitively, for a binary alphabet, $f(x,y,z)$ can be encoded using 8 values, where each of $u,v,w$ need 4 values, leaving 8 degrees of freedom versus 12. But this intuition seems weak to me.



Can nonnegative functions $f(x,y,z)$ be written as a product of pairwise functions $u(x,y) v(y,z) w(x, z)$?
Let $f(x,y,z)=x^2+y^2+z^2$ for $(x,y,z) \in \mathbb{R}^3$. The only zero of $f$ is $(0,0,0)$.


If we had three functions $u,v,w$ such that $f(x,y,z)=u(x,y)v(y,z)w(z,x)$ for every $(x,y,z) \in \mathbb{R}^3$, at least one of the functions $u,v,w$ would vanish at $(0,0)$, so $f$ would vanish on a whole line.


This argument also works on $\{0,1\}^3$.


