I have been tasked with showing that the number of operations needed to solve $Ax = b$ for a tridiagonal n x n matrix $A$ is $8(n-1)+1$. I tried to solve this and I was getting too large an answer, so I realised there must be a flaw in the way I am counting. I decided to simply the problem and try to count the operations the case $n=2$.
By the formula, there should be nine operations, but as far as I can tell the minimum amount needed is ten. Say we have
$a_{11}x_1+a_{12}x_2=b_1$ and
$a_{21}x_1+a_{22}x_2=b_2$.
I count that you would need 6 operations to do Gauss-Jordan elimination to get an upper triangular matrix:
$a_{21} \rightarrow 0$ (no operations), $a_{22} \rightarrow a_{22}-(\frac{a_{21}}{a_{11}}) a_{12}$ (3 operations) and $b_2 \rightarrow b_2-(\frac{a_{21}}{a_{11}}) b_1$ (3 operations)
and a further four to do back substitution:
$x_2 = \frac{b_2}{a_{22}}$ (1 operation) and $x_1 = \frac{b_1-a_{12}x_2}{a_{11}}$ (3 operations).
If someone could say where my logic is wrong that would be great.