The probabilities are on a draw tree for the first draw
pred=7/13, pblue=5/13 and pgreen=1/13
They add up to one.
For the second draw pgreen=0 if we already draw the green sock. In all other cases pgreen=1/12 because one sock is already removed. For this event, the probability is for the path {1,0,1} p=7/156 and {0,1,1}=5/156. For {2,0,0}: p=42/156, {1,1,0}=35/156, {0,2,0}: p=20/156, where {red,blue,green} sock is drawn.
The sock is drawn and not done back into the box.
First draw step:
{0,0,0} ->{1,0,0}
->{0,1,0}
->{0,0,1}
Second draw step:
{1,0,0}->{2,0,0}
{1,1,0}
{1,0,1}
{0,1,0}->{1,1,0}
{0,2,0}
{0,1,1}
{0,0,1}->{1,0,1}
{0,1,1}
{0,0,2}
and so one.
As reference have a look at Urn_problem and Multinomial distribution.
Since there is only one green sock the expectation to get a green sock depends on the number of draws n and the probability to get the green sock pgreen=1/13: n/13.
So after 13 draws You are sure to get the green sock. And for each such draw the probability of not drawing the green sock is n*12/169, so after 13 draws that probability is 12/13. And so on.
This is a probability problem and a distribution problem. Have a look at Combinatorics for what combinatorics is about in Mathematics.