Week 5: Doing Math

 

Week 5: Doing Math

    This week we were tasked with learning about matrices and finding the inverse value and determinant of a matrix using some provided values. I will show my code in parts, explaining as I go along what everything means, as well as what the error codes reveal. This was a fascinating week, and the assignment really makes you think!


    The first thing we can see is that A appears to be a 10x10 square matrix, whereas B is not with its dimensions being 10x100. We also see that the determinant of A is 0, which we take to mean that A is singular, and no inverse of it exists.


    As I mentioned, A is singular as is confirmed by the error message, and as a result cannot be inverted which is attempted by the solve A command. In other words, it tries to Solve A (invert A) but fails to do so and when not placed in the tryCatch, causes the code to fail without running the rest of the program.

We see similar occurrences when we attempt to solve or find the determinant of B, as shown here;

Both error messages state that the input must be a square to be returned the inverse, must be a square showing its dimensions (10x100) which are not square metrics. The determinant simply stating that the input must be a square matrix, which again B is not. The message is clear, squares only!

That's all I was able to derive from the attempts made to find the inverses of the provided matrices, I enjoyed this week's work and lecture as always and hope to continue enjoying the class as the semester marches on. I want to also quickly thank you the professor for their quick responses, it is deeply appreciated.

My github page is here.

Comments

Popular posts from this blog

Week 4: Programming Structure in R