msr4mba wrote:...Is y=2 a correct solution coz. 15 mod 2 = 1 (and not 3)?
From mathematical point of view, there is no reason to discard 2 as the value of y.
If a and d are integers, with d non-zero, then a remainder is an integer r such that a = qd + r for some integer q, and with 0 ≤ |r| < |d|. Hence, the remainder can be either positive or negative. Generally we deal with positive reminders.
For example, when 15 is divided by 4, generally we say the remainder is 3 because 15 = 3*4 + 3. But 15 can also be written as 4*4 - 1, in which case -1 is the remainder.
Similarly, here for y = 2, when 15 is divided by y, the remainder is (y - 3) = (2 - 3) = -1 which is the case when 15 = 8*2 - 1
Hope that helps.