(In reply to
Puzzle Answer by K Sengupta)
Let us consider N green marbles and 2 gray marbles.
x denotes the number of green marbles to the left of the first gray marble.
y denotes the number of green marbles between two gray marbles
z denotes the number of green marbles to the right of the second gray marble.
x y z
| ************************ G ************************** G **********************|
green 1st gray green 2nd gray green
marbles marble marbles marble marbles
Obviously, this is an analogue of the given equation x+y+z=N
If there does NOT exist a green marble in any of the three positions, then that would mean that the corresponding variable would assume the value zero.
Consequently, the required number of solutions is:
comb(N+2 ,2) = (N+1)(N+2)/2.
Edited on September 7, 2022, 3:23 am