the value returned from f and g should be rand on a per-run basis.
remove variable assignment and use a lambda binding instead.
"prove" interchange law holds.