Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Work Integrated Learning Programmes Division Assignment 1 DSECL ZC416 - Mathematical Foundations for Data Science   Instructions Use Python only

Work Integrated Learning Programmes Division Assignment 1 DSECL ZC416 - Mathematical Foundations for Data Science   Instructions Use Python only

Computer Science

Work Integrated Learning Programmes Division Assignment 1

DSECL ZC416 - Mathematical Foundations for Data Science

 

Instructions

  1. Use Python only. Do not use vectorized operations in Python, insteaduse ’for loops’ wherever needed. Attach only the relevant data in your submission and no need to submit the code.
  2. By random entries, we mean a system generated random number. Nomarks would be awarded for deterministic entries.
  3. This is not a group activity. Each student should do the problems andsubmit individually.
  4. Submissions beyond 9th of December, 2021 17.00 hrs would not begraded
  5. Assignments sent via email would not be accepted
  6. Copying is strictly prohibited. Adoption of unfair means would leadto disciplinary action.
  7. Assignment have to be handwritten, scanned as a pdf document anduploaded on canvas. File name should be your bitsid.pdf

 

Answerallthequestions

 

Q1) Implementing Gaussian Elimination Method

  1. Find the approximate time your computer takes for a single additionby adding first 106 positive integers using a for loop and dividing the time taken by 106. Similarly find the approximate time taken for a single multiplication and division. Report the result obtained in the form of a table.    (0.5)
  2. Write a function to implement Gauss elimination with and without pivoting. Also write the code to count the number of additions, multiplications and divisions performed during Gaussian elimination. Ensure that the Gauss elimination performs 5S arithmetic which necessitates 5S arithmetic rounding for every addition, multiplication and division performed in the algorithm. If this is not implemented correctly, the rest of the answers will be considered invalid. Note that this is not same as simple 5 digit rounding at the end of the computation. Do not hardwire 5S arithmetic in the code and use dS instead. The code can then be run with various values of d. (0.5 + 0.5)
  3. Generate random matrices of size n × n where n = 100,200,...,1000. Also generate a random b Rn for each case. Each number must be of the form m.dddd (Example : 4.5444) which means it has 5 Significant digits in total. (0.5)
  4. Perform Gaussian Elimination with and without pivoting for each ofthe 10 cases above. Report the number of additions, divisions and multiplications for each case in the form of a table. No need to write matrices. (0.5 + 0.5)
  5. Using the time calculated in the first step and using the theoretical operation count (total time for an operation = number of operations × time for one operation), generate the approximate time taken for Gaussian elimination with and without pivoting for the 10 cases. Present this data in a tabular form. Assuming T1(n) is the time calculated for an n×n matrix, plot a graphs of log(T1(n)) vs log(n) and fit a straight line to the observed curve and report the slope of the lines. (1 + 1) Q2) Implementing Gauss Seidel and Gauss Jacobi Methods
  1. Write a function to check whether a given square matrix is diagonallydominant or not. If not, the function should indicate if the matrix can be made diagonally dominant by interchanging the rows? (1)
  2. Write a function to generate Gauss Seidel iteration for a given squarematrix. The function should also return the values of 1,∞ and Frobenius norms of the iteration matrix. Generate a random 4 × 4 matrix. Report the iteration matrix and its norm values returned by the function along with the input matrix. (1)
  3. Repeat part (ii) for the Gauss Jacobi iteration.     (1)
  4. Write a function that perform Gauss Seidel iterations. Generate a random 4 × 4 matrix A and a suitable random vector b R4 and report the results of passing this matrix to the functions written above. Write down the first ten iterates of Gauss Seidel algorithm. Does it converge? Generate a plot of ?xk+1xk?2 for the first 100 iterations.

            Take a screenshot and paste it in the assignment document.       (1)

  1. Repeat part (iv) for the Gauss Jacobi method.     (1)

2

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions