Difference Equations: An Introduction with Applications