A stick of length $1$ is broken into two pieces by cutting at a randomly chosen point. What is the expected length of the smaller piece?
(a)$1 /8$
(b)$1 /4$
(c)$1 /e$
(d)$1 /π$
This is a question from an exam in India. I am bit confused to see this question and not getting any clue. What I know is $E(x)=\sum xp(x)$. Now how to use that theory here?

Let's let $x$ denote the length of the smaller piece. Then $x$ is uniform on $[0, 1/2]$, as the split-point $s$ is uniform on $[0, 1]$, but for split points past $1/2$, the "smaller piece" $x$ becomes $1-s$ instead of $s$.
The formula you've got is great when the probability space is discrete; in this case, it's continuous, and we use $$ E(x) = \int x \cdot d(x) ~dx $$ where $d$ is the probability density rather than the probability mass.
The probability density $d$, defined on $[0, 0.5]$, is given by $$ d(x) = 2 $$ (its integral over the interval is exactly $1$). So you need to compute $$ \int_0^{0.5} x \cdot 2 dx. $$