I am looking at a MATLAB code that times the backslash operator for several cases. I will list the cases below:
Note: all of these are for m = 5000
1) Z = randn(m,m); A = Z'*Z; b = randn(m,1); tic; x = A\b; toc; elapsed time = 1.0368
2) tic; x= A\b; toc; elapsed time = 1.0303
3) A2 = A; A2(m,1) = A2(m,1)/2; tic; x = A2\b; toc; elapsed time = 2.0361
Note that the times above were obtained years ago and today's MATLAB is significantly faster, but the relative trends are still observed.
FOr each case, I would like to know why the experiment was performed and why is the result the way it is. The first 2 are fairly simple and the elapsed times are approximately the same. But in #3, we see the time double. For #3, the lower left element of the matrix is divided by 2, but any idea why this would result in a two times slower computation?
The algorithm used by the mldivide operator is descried here in Matlab's documentation: http://www.mathworks.com/help/matlab/ref/mldivide.html
The "general" backslash for square matrices would end up using LU decomposition, while for symmetric matrices the Cholesky decomposition is used instead. This decomposition, which is simply a simplification of LU for symmetric matrices, is also twice as fast, which explains your timings.
See https://en.wikipedia.org/wiki/Cholesky_decomposition#Computation