Hi Milagros,
Soroban has given you an excellent solution already, but here is a generating function approach since that seems to be what you are looking for.
First, let

= the number of ways to form a binary string of length 50 with exactly r ones, and let
 = \sum a^r x^r)
.
We know

,
so by the binomial theorem,
 = (1 + x)^{50})
.
Now let

= the number of ways to form a binary string of length 50 with exactly r ones, all at the end. There is only one such string, so

and
Now the number of ways to form a binary string of length 50 and another string of length 50 with all the one's at the end, containing a total of r ones, is

which has the generating function
 \cdot g(x))
.
So the answer to the original question is the coefficient of

in
^{50} \cdot (1-x^{51})}{1-x})
which I think probably reduces, in the end, to the same answer given by Soroban (but I haven't checked it).