JuliaAcademy / JuliaTutorials

Learn Julia via interactive tutorials!
https://julialang.org/learning/
MIT License
1.26k stars 657 forks source link

LinearAlgebra.SingularException(3) in notebook 10 #48

Closed samusz closed 4 years ago

samusz commented 5 years ago

In the 11. Basic linear algebra for #### Solving linear systems The problem $Ax=b$ for square $A$ is solved by the \ function. When I do the A\b I get this : LinearAlgebra.SingularException(3)

Stacktrace: [1] checknonsingular at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/factorization.jl:12 [inlined] [2] #lu!#99(::Bool, ::Function, ::Array{Float64,2}, ::Val{true}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/lu.jl:41 [3] #lu! at ./none:0 [inlined] [4] #lu#105(::Bool, ::Function, ::Array{Int64,2}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/lu.jl:251 [5] lu at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/lu.jl:242 [inlined] [6] (::Array{Int64,2}, ::Array{Float64,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/generic.jl:870

xorJane commented 5 years ago

Hi @samusz! When you run this notebook again from scratch, do you get the same error? The matrix A is seeded pseudo-randomly, so sometimes you end up getting a singular matrix. And then everything breaks. If you try again with a new A and everything works, then that's probably the issue.

samusz commented 5 years ago

Hi @xorJane ! Yes I guess that was it. matrix was 3 2 4 2 3 1 3 2 4 best

NHDaly commented 4 years ago

Closing this issue since it's resolved. :)