Simple vector word problem: a $100$-dimensional vector $x$, where $x_i$ denotes the number of $i-1$-year-olds in a population

878 Views Asked by At

I'm given this word problem as part of an ungraded homework assignment for my numerical analysis class. I was hoping someone could review my answers and also help me with (c):

1.13 Average age in a population: Suppose the $100$-vector $x$ represents the distribution of ages in some population of people, with $x_i$ being the number of $i - 1$ year olds, for $i = 1, ..., 100$ (You can assume that $x \neq 0$, and that there is no one in the population over age $99$.) Find expressions, using vector notation, for the following quantities.

(a) The total number of people in the population.

(b) The total number of people in the population age $65$ and over.

(c) The average age of the population. (You can use ordinary division of numbers in your expression)

Part (a)

This is $x_1 + x_2 + ... + x_{100} = 1^Tx$, i.e. the $1$-vector transposed and multiplied with $x$. I'm wondering if there's a simpler way to express this.

Part (b)

For this one, I basically did the same as above except with a subscript: $1^Tx_{66:100}$.

Part (c)

Here's the one I'm stuck on.

The average age of the population is the total age of the population divided by the number of people in the population. We got the answer for the denominator in part (a), so it's time to find the numerator.

The total age of the population is $x_1$ times the number of $0$-year olds plus $x_2$ times the number of $1$-year-olds plus ...:

$$x_1(0) + x_2(1) + x_3(2) + ... + x_{100}(99)$$

Which simplifies to:

$$x_2 + 2x_3 + ... + 99x_{100}$$

Now, I'm wondering if I'm missing something obvious that's simpler than this:

$$\frac{\sum_{i=1}^{100}(i-1)(x_i)}{1^Tx}$$

1

There are 1 best solutions below

1
On BEST ANSWER

I think you have the reasonable solutions for the first two parts of the question.

The answer for (a) might be described as the Manhattan distance of the vector. You may be able to denote it as the $\ell_1$ norm of the vector, $||x||_1$, but that doesn't help you compute it any easier.

For (b), you could also consider constructing a new vector with 65 $0$s and then 35 $1$s, rather than slicing parts of your main vector. But I think your notation might be easier to understand.

To solve (c), I think you can construct a vector of ages, $a = \{ 0, 1, 2, ..., 99 \}$, and just do $a^T x \over{1^T x}$.