Second order difference equation general solution

181 Views Asked by At

I am reading a Gambler's ruin probability question but do not really understand difference equation. So I am reading the link here:https://www.cl.cam.ac.uk/teaching/2003/Probability/prob07.pdf

enter image description here

I understand how to get the two roots of $w_1$ and $w_2$. But I don't understand the below process: enter image description here

What $A_1$ and what $A_2$ are we doing here, and why do we do so?

Also how does the author conclude that the general solution is below: enter image description here

It seems the author is skipping several key reasoning and I just don't follow the steps here..