Let R, a not necessarily
associative algebra over a field F of characteristic ≠2, be equipped with a map
g : R × R × R → F. We show that if R contains a nonzero idempotent and
satisfies the identities (1) (xy)z + (yx)z = g(x,y,z)[x(yz) + y(xz)] and (2)
(xy)z + (xz)y = g(x,y,z)[x(yz) + x(zy)] then R is an alternative algebra. The
methods also apply to other pairs of identities.