Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a simple question please. I want a mathematical notation to express sum(A[i]) where A is a vector (one dimensional matrix). I want to rewrite a simple formula in matrix form (compact form) and need your help. For example, if you want to rewrite $\sum_i x^2[i]$, it may be simply denoted by $X^T X$.


share|cite|improve this question
You seem a little confused. What does $x[i]$ mean? If $X$ is a matrix then its entries are of the form $x[i,j]$. If you have a square matrix and multiply it by its transpose you get a much more complicated formula. For a start, the answer will again be a square matrix, while the sum you have given is mealy a number! – Fly by Night Aug 28 '12 at 18:42
I used X as a vector i.e. X=[x_1 x_2 ... x_n], where x_k is a number. – remo Aug 28 '12 at 19:44
Ahhh! I see. I misunderstood your notation. Capital letters are usually reserved for matrices, proper, i.e. not vectors. The notation $X^{\top}\! X$ is most often used when $X$ is an $n$-by-$n$ matrix. For example, the orthogonal matrices are the matrices for which $X^{\top}\! X = E$ where $E$ is the $n$-by-$n$ identity matrix. Vectors are usually denoted by lower case, e.g. $Xv$ is the product of the $n$-by-$n$ matrix $X$ and the $n$-by-1 vector $v$. – Fly by Night Aug 29 '12 at 19:22
Thank you for your guide. – remo Aug 30 '12 at 0:59
up vote 6 down vote accepted

If you let $e = (1,...,1)^T$ (the notation $\bf{1}$ is often used instead), then the summation is given by $e^T A$.

share|cite|improve this answer

Consider multiplication from left with the matrix $(1,...,1)$, i.e. $$(1,...,1) \begin{pmatrix}a_1 \\ \vdots \\ a_n \end{pmatrix} = \sum_{i=1}^n a_i$$.

share|cite|improve this answer
It is common to consider this matrix product as a value, but it is also important to recognize that the output of such a multiplication is actually a 1x1 matrix. – process91 Aug 28 '12 at 19:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.