Computer Science Math Problem With Solution