I have a algorithm and from the post its time complexity is:
$$\sum_{k=1}^{n}k\binom nk= n 2^{n-1}$$
My question is, how to get the result $n2^{n-1}$ need some help . thanks
I have a algorithm and from the post its time complexity is:
$$\sum_{k=1}^{n}k\binom nk= n 2^{n-1}$$
My question is, how to get the result $n2^{n-1}$ need some help . thanks
By definition of the binomial coefficients, $$(1+x)^n=\sum_{k=0}^n{n\choose k}x^k $$ Taking the derivative of both sides, we obtain $$n(1+x)^{n-1}=\sum_{k=0}^n{n\choose k}kx^k $$ Now let $x=1$.