5 added 19 characters in body edited Mar 15 '17 at 6:43 aaag 1,11755 silver badges1818 bronze badges Let us assume that required element is equally likelyequally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means requiresrequired element is in ith position and vice-versa. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let us assume that required element is equally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let us assume that required element is equally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means required element is in ith position and vice-versa. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer 4 added 75 characters in body edited Mar 15 '17 at 6:37 aaag 1,11755 silver badges1818 bronze badges Let us assume that required element is equally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$$$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$$$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$$$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let $$x _i$$ be a random variable. $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let us assume that required element is equally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer 3 added 75 characters in body edited Mar 15 '17 at 6:30 aaag 1,11755 silver badges1818 bronze badges Let $$x _i$$ be a random variable. $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let $$x _i$$ be a random variable. $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let $$x _i$$ be a random variable. $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer 2 added 35 characters in body edited Mar 15 '17 at 6:17 aaag 1,11755 silver badges1818 bronze badges 1 answered Mar 15 '17 at 6:07 aaag 1,11755 silver badges1818 bronze badges