Highlights
You must keep filenames as mentioned in the assignment since the assignments will be auto evaluated via a script. There are 5 problems , each for 10 marks. and 10 marks are for viva.
Problem fi: Matrices Write a python script to generate two random matrices and create text files txt and MatB.txt to save two different matrices.
Take the number of rows and number of columns as command line arguments: r1 c1 r2 c2. r1 and c1 are rows and columns of the first matrix, r2 and c2 of second.
Each line of the files should have space separated row elements, and line number should represent row So, the format of the files will be (a(i,j) means value at ith row and jth column)
rows, columns
a(1,1) a(1,2) a(1,3) . . . a(1,c)
a(2,1) a(2,2) a(2,3) . . . a(2,c)
a(r,1) a(r,2) a(r,3) . . . a(r,c)
Save the python filename as problem1a.py.
Save the python filename as problem1b.py.
Problem 2: Search the file ‘datafile.dat’ for the numbers 100831, 24, 43479 and 70125. Estimate the time taken to search through the entire data using:
Extend the script to repeat the search for 10 times and find mean time taken for each of the processes.
Note: Time can be estimated by importing time library as follows: import time
start = time.time() #execution of the function end = time.time()
total_time = (start-end)
Save the python filename as problem2.py, and save the times in a file with name problem2Op.txt with mean time using list in line 1, mean time using dictionary in line 2, and mean time using Numpy array in line 3.
Problem 3: Write a Python script to solve system of Linear Equations Ax=B, where A is a N X N matrix with N <=3 and B is N X 1, as follows (use gaussian elimination or numpy.linalg library)
Take input matrices A and B from the user in the form of files, with their names as two command line arguments similar to inputs in problem 1b.
Problem 4: Norms
If vector x = [x1, x2, … , xn],
Then, nth norm of vector x = ||x||n = (|x1|n + |x2|n + … + |xn|n)(1/n) Interestingly,
Take a matrix in the form of a file, with its name as two command line arguments similar to one of the inputs in problem 1b. Find the norm 0, norm 1,norm 2, norm 3, and ‘infinity norm’ of each row and save it in file “problem4aOp.txt” with a line of space separated values. (line number should represent row number of matrix. Leftmost value in each line should represent norm 0, and the right most value should represent the infinity norm). Handle corner cases (if any).
Save the python filename as problem4a.py.
(you do not need to find norm 0 for the matrix)
Take a matrix in the form of a file, with its name as two command line arguments similar to one of the inputs in problem 1b. Find the norm 1,norm 2, and infinity norm of the input matrix and save it in file “problem4bOp.txt” with a line of space separated values. (leftmost value should represent norm 0, and right most value should represent infinity norm).
Handle corner cases (if any).
Save the python filename as problem4b.py.
Problem 5: Statistical Regularity and Central Limit Theorem
Run the code with 50 trials instead of 5 in each repetition of 50000. Save the plot as problem5b_50_50000.png.
Share your observations with the lab TAs or lab Instructor. Save the python filename as problem5b.py.
Create the folder having your python files and inputs/outputs, with name having your roll number followed by “_assignment7” (don’t use inverted commas in folder name), compress the folder with .zip extension and submit it on moodle. Important: If you copy the assignment or any of its parts from others or share with others, our plagiarism softwares will catch it and you will be awarded 0 marks for the whole assignment or F grade for the course.
This It Computer Science have been solved by our PhD Experts at My Uni Paper. Our Assignment Writing Experts are efficient in providing a fresh solution to this question. We are serving more than 10000+ Students in Australia, the UK, and the US by helping them to score HD in their academics. Our Experts are well-trained to follow all marking rubrics and referencing styles.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.