I am trying to reduce the following $\lambda$-expression: $$(\lambda x.x x) (\lambda y.y x) z$$ So I am reducing to $$(\lambda y.y x) (\lambda y.y x) z$$ That reduces to $$(\lambda y.y x)xz$$ Now comes trouble. According to the solution given here at letter k, you have: $$ (\lambda y.y x)xz \rightsquigarrow_\beta xxz$$ Bout from what I understand it should be: $$ (\lambda y.y x)xz \rightsquigarrow_\beta xzx$$ Because the lambda expression $(\lambda y.y x)$ just adds a final $x$ to the term that it is applied to.
What I am doing wrong?