On Partial Differential and Difference Equations with Symmetries Depending on Arbitrary Functions