Discrete detailed solution + example + program