For the first one i can tell how many combinations there are not what are they:
if you have a binary of x bits which a are zeroes and b are ones (a+b=x)
so there will be xCa or xCb combinasions of this binary (the C is the
combination formula , and note that xCa = xCb)
for the second one here is a method but i don;t know if it's faster:
let's say your number is 1993 you start to subtract the biggest power of two that will not make the number negative so here it's 1024 ... and so on until you get 0
1993 -2^10 -2^9 -2^8 -2^7 -2^6 -2^3 -2^0 =0
so in 1993 there are 7 ones (you count how many subtractions you made)