A and B both have some pencils. If A gives 10 pencils to B, then B will have twice as many as A. And if B gives 10 pencils to A, then they will have the same number of pencils. How many pencils does each has?
As per the statement, "If A gives 10 pencils to B, then B will have twice as many as A":
⟹2(x−10)=y+10
2x−y=30 --- (1)
Also, as per the statement, "if B gives 10 pencils to A, then they will have the same number of pencils"
⟹x+10=y−10
x−y=−20 --- (2)
Subtracting equation (2) from (1), we get:
2x−y−x+y=30+20
x=50
Substituting x=50 in equation (2), we get:
50−y=−20
⟹y=70
So, A has 50 pencils and B has 70 pencils.