How can I say that this matrix is invertible? Let $A_{ij}=1$ if $i=j$ and let $A_{ij}=\frac{1}{2}$ if $i \neq j$. How can I formally argue that $A$ is an invertible matrix? I can made for particular examples, but I don't know how to argue for the general case.
 A: $$
\begin{bmatrix}
1&\frac12&\frac12&\cdots&\frac12\\
\frac12&1&\frac12&\cdots&\frac12\\
\frac12&\frac12&1&\cdots&\frac12\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
\frac12&\frac12&\frac12&\cdots&1\\
\end{bmatrix}
$$
subtract $\frac1n\times$ the sum of the $n-1$ right columns from column $1$ and we get
$$
\begin{bmatrix}
\frac{n+1}{2n}&\frac12&\frac12&\cdots&\frac12\\
0&1&\frac12&\cdots&\frac12\\
0&\frac12&1&\cdots&\frac12\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
0&\frac12&\frac12&\cdots&1\\
\end{bmatrix}
$$
subtract $\frac1{n-1}\times$ the sum of the $n-2$ right columns from column $2$ and we get
$$
\begin{bmatrix}
\frac{n+1}{2n}&\frac1{2(n-1)}&\frac12&\cdots&\frac12\\
0&\frac{n}{2(n-1)}&\frac12&\cdots&\frac12\\
0&0&1&\cdots&\frac12\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
0&0 &\frac12&\cdots&1\\
\end{bmatrix}
$$
Continuing for the rest of the columns, we end up with
$$
\begin{bmatrix}
\frac{n+1}{2n}&\frac1{2(n-1)}&\frac1{2(n-2)}&\cdots&\frac12\\
0&\frac{n}{2(n-1)}&\frac1{2(n-2)}&\cdots&\frac12\\
0&0&\frac{n-1}{2(n-2)}&\cdots&\frac12\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
0&0&0&\cdots&1\\
\end{bmatrix}
$$
Computing the determinant of the upper triangular matrix gives
$$
\frac{n+1}{2^n}
$$
A: Here is a short way to compute its determinant:
Let $J$ be the matrix of dimension $n$ with all coefficients equal to $\frac12$. As this matrix has rank $1$, its kernel has dimension $n-1$, so, using Vieta's relations, we see that its characteristic polynomial is
$$\det (XI_n-J)=X^n -\operatorname{Tr}(J) X^{n-1}=X^{n-1}\Bigl(X-\frac n2\Bigr).$$
Now consider the matrix $A(x)$ which is the same as your matrix, except the  $1$s on the diagonal are replaced with a variable $x$. We have 
\begin{align}
\det A(x)&=\det\bigl(J+\bigl(x-\tfrac12\bigr) I_n\bigr)=(-1)^n\det\bigl(\bigl(\tfrac12-x)I_n-J\bigr)\bigr) \\
&=(-1)^n\bigl(\tfrac12-x\bigr)^{n-1}\bigl(\tfrac12-x-\tfrac n2\bigr)=\bigl(x-\tfrac12\bigr)^{n-1}\bigl(x+\tfrac{n-1}2\bigr).
\end{align}
What we want is $$A(1)=\frac1{2^{n-1}}\frac{n+1}2=\frac{n+1}{2^n}.$$
A: Notice that for every $x = (x_1, \ldots, x_n) \in \mathbb{R}^n, x \ne 0$ we have
$$\langle Ax,x\rangle = \sum_{i=1}^n x_i^2 + \sum_{i\ne j}x_ix_j = \frac12\left(\sum_{i=1}^nx_i\right)^2 + \frac12\sum_{i=1}^nx_i^2 > 0$$
so $A$ is positive definite. In particular, $A$ is invertible.
A: Note that
$$2A\:=\:\mathbb 1_n+\:\begin{pmatrix}1\\\vdots\\1\end{pmatrix}(1,\cdots,1)$$
where $\mathbb 1_n$ is the identity matrix. 
The eigenvalues to the $n$ eigenvectors
$$\begin{pmatrix}1\\1\\1\\\vdots\\1\end{pmatrix},\;
\begin{pmatrix}-1\\1\\0\\\vdots\\0\end{pmatrix},\;
\begin{pmatrix}0\\-1\\1\\0\\\vdots\end{pmatrix},\;
\dots,
\begin{pmatrix}0\\\vdots\\0\\-1\\1\end{pmatrix}$$
are non-zero.
