10年专注于英语国家留学生作业代写,网课代修,网课Exam代考
 Python代做_作业代写_python代考_DueEssay论文代写

Python代做_作业代写_python代考

python代写, python代做 ,python编程代写,python程序代写, Mingxinwrite 旗下写手均来自国内外名校硕博及一线互联网公司。C++代写,python代写,java代写,机器学习代写,数据库代写,R语言..

EG1hao 立即咨询

快速申请办理

称       呼 :
联系方式 :
备       注:

Python代做_作业代写_python代考

发布时间:2020-12-04 热度:

python代写,python代做,python编程代写,python程序代写,唯一网址:www.mingxinwrite.com旗下写手均来自国内外名校硕博及一线互联网公司。C++代写,python代写,java代写,机器学习代写,数据库代写,R语言代写,CS代写全覆盖。

北美学霸,国内985硕博成员,全公司化管理,高素质、高纪律、高效率。其他个人团体网络接单不可控性很大,无保障,很可能因私人原因错过due,带来不可弥补损失。

我们最基本的原则是必须保证honor code,必须保证原创。我们的留学生CS作业代写服务严格参考客户提供的slide和学业水平,杜绝超纲代码。有test的必全过,requirements必做,Bonus按照客户要求尽全力完成。我们的留学生CS编程作业代写同时会提供一对一远程服务,保证作业的顺利上交。客户的满意度是衡量团队工程师能否继续留在团队的唯一标准,团队大牛们也不屑于抄袭代码.

提供专属的CS程序代写服务,代写各类程序语言:代做程序,C语言代写, C++代写, 算法作业代写, 数据结构代写, AI/MachineLearning代写, python代写, java代写, matlab代写, 汇编代写, scala代写, SQL/Database代写, racket代写, 安卓/Android代写, IOS/swift代写, racket代写, 网络代写, web代写, OS/操作系统代写, R代写等, 涵盖北美CS代写, 加拿大CS代写, 美国CS代写, 澳洲CS代写, 新西兰CS代写, 英国CS代写, 新加坡代写, 香港CS代写等.

CS代写、计算机作业代写,java代写,python代写,c/c++代写
Project代写

Homework代写

Lab代写

C/C++ 编程代写

CS作业代写

Data Mining数据挖掘作业代写

数据结构 Data Structure作业代写

Database Mongodb postgreSql mysql Nosql SQL代写

AI作业代写 人工智能代做

Machine learning 作业代写 机器学习代写

Operating System 操作系统作业代写

EE 作业代写

编程作业代写

Java代写 Java程序代写

Linux C/C++作业代写

Python代写 Python程序代写

Web开发 网站设计 php程序代写/nodejs/css/html5/reactjs/vue等

算法实现 算法作业代写

数据分析 R代写 R语言代写 统计代写

安卓代写 移动开发

IOS代写 移动开发


Please read the entire PDF before starting. You must do this assignment individually.

It is very important that you follow the directions as closely as possible. The directions, while

perhaps tedious, are designed to make it as easy as possible for the TAs to mark the assignments by letting

them run your assignment, in some cases through automated tests. Following closely the instructions will

allow the TAs to provide better feedback and not waste time on administrative details. Plus, if the TA is

in a good mood while he or she is grading, then that increases the chance of them giving out partial marks.

:)

To get full marks, you must:

? Follow all directions below

? Code your solution using the template provided in mycourses.

? Make sure that your code compiles and it is correct.

– Non-compiling code (code with syntax error) will receive a very low mark

? Write your name and student number in a comment in each .py file you hand in

? Indent your code properly

? Name your variables appropriately

– The purpose of each variable should be obvious from the name

– Use a docstring in each function to comment and validate your program

? Submit your code in codePost

– Make sure that your code passes the given test cases.

1

Part 0

Before starting the assignment, it is important that you complete the following steps. These steps are

optional (and will not be graded), but we highly recommend you to go through them.

? For this assignment, we will use the online platform called codePost to facilitate the automatic grade

of your work and to provide high-qualilty feedback on your programming work. The following are the

basic steps that you will have to perform in codePost.

1. Accessing and Signing up codePost: Please make sure that you can access codePost. In

order to login, you must use the link in the content section of the “Resources” tab located in

mycourses. Please fully review this link to get extra information about this task. https://help.

codepost.io/en/articles/3655946-student-signup-instructions

2. Submitting work to codePost: Once you have finished the coding part of the assignment, you

will need to upload your .py file to codePost. Please fully review this link to get extra information

about this task.

https://help.codepost.io/en/articles/3851633-how-can-i-submit-work-to-codepost.

If you need information about how to re-submit your work, please fully review this link to get

extra information about this task.

https://help.codepost.io/en/articles/3734695-can-i-resubmit.

For this assignment, you will be able to receive automated test results with your submission.

Please double check that your code passes all the test cases. Finally, and in order to have

peace of mind, you can check if your submission went through codePost, please fully review

this link to get extra information about this task. https://help.codepost.io/en/articles/

3734625-how-can-i-tell-if-my-submission-worked

Part 1

The questions in this part of the assignment will be graded.

During this week lecture, we studied how to solve a system of linear equations through a method called

Gauss-Jordan elimination. This method involves common operations on matrices (i.e., stacking a matrix,

elementary row operations [row swap, scalar multiplication, row addition]). In this assignment, we will study

a highly related method that is based on finding the inverse of a matrix. A system of linear equations can

be written as AX = B where A is the coefficient matrix, X is a column vector containing the variables, and

B is the right hand side. If AX = B, then X = A?1B, where A?1

represents the inverse of A (see below for

the operations performed to obtain this result).

AX = B .... initial statement

A?1

(AX) = A?1

(B) .... pre-multiply both sides by A?1

(A?1A)X = A?1B .... use the associative property to regroup factors

IX = A?1B .... when you multiply inverses together, they become the identity matrix

X = A?1B .... the identity matrix is like multiplying by 1.

Finding the inverse of a matrix is not only important to solve systems of linear equations, but it represents an

extremely important concept used in a huge variety of applications to model physical systems and engineering

models. You must be aware that numpy and/or scipy could be used to solve many numeric computing

problems. Actually, this assignment could be easily solved using this modules; however, you are not allowed

to use those modules (or any other module). This assignment is about understanding the implementation

principles to be able in a future to know how to apply them. Remember what was mentioned during the

lectures, libraries are good because they make it so easy to program, but they are bad because I will never

know how to do that myself. Then, lets do this assignment without the help of the libraries.

Page 2

Solving a system of linear equations by computing the inverse

The Gauss-Jordan elimination method (seen during the recording lecture video) can be used to determine a

matrix inverse (only possible for a square matrix with non-zero determinant). The main idea is that we will

now perform a sequence of row transformations (i.e., interchange of rows, multiply a row by a constant, add

a multiple of one row to another) to transform the matrix A to the identity matrix (i.e., a square matrix

with ones on the main diagonal and zeros elesewhere) and simultaneously perform the same sequence of

operations on the identity matrix I (we can do that by creating an augmented matrix M = [A|I] between A

and the identity matrix I).

Then, it is clear that to find the inverse (and to solve the equation X = A?1B) we will need the following

functions

? A multiplication method to multiply two matrices (i.e., to compute A?1B).

? A stacking method to obtain an augmented matrix (e.g., in the recording lecture video we computed

the augmented matrix M = [A|b] by stacking b as the last column to the matrix A)

? An un stacking method to extract the stacking matrix from the augmented matrix (e.g., following the

example shown in the recording lecture video, this method must return (extract) b from the augmented

matrix M = [A|b])

? A gauss jordan method that implements the elementary row operations to convert an augmented

matrix into a row-echelon form.

? An inverse method that calls the other methods to compute the inverse of a matrix

As mentioned before, the objective of this assignment is to implement the above-mentioned functions without

the help of (numerical computation) libraries such as numpy and scipy.

Question 1: multiplication (12 points)

The method called multiplication takes two Matrix objects as input and returns a new Matrix object

representing the multiplication of the two input matrices. if X is an m × n matrix and Y is an n × p

matrix, their matrix product XY is an m × p matrix, in which the n entries across a row of X are

multiplied with the n entries down a column of Y and summed to produce an entry of AB.

The following is a view of how the function looks in the Matrix.py file.

def multiplication(self, other):

’’’Returns a new Matrix object with the result of the matrix multiplication between

self.matrix and other.matrix

pre-req: self.num_columns == other.num_rows

’’’

"""

For this method you can safely assume that self.num columns == other.num rows (i.e., the multiplication

can always be computed); however you can not assume that self.num rows == other.num rows

(i.e., both matrices have the same dimensions).

Page 3

Question 2: stacking (12 points)

Complete the stacking function, which takes two Matrix objects as input and returns a new Matrix

object representing the augmented matrix of the inputs (i.e., it stacks the matrix of the second parameter

at the end to the matrix of the first parameter). if X is an m × n matrix and Y is an m × n matrix,

the augmented matrix M = [X|Y ] is an m × (2n) matrix,

The following is a view of how the function looks in the Matrix.py file.

def stacking(self, other):

’’’Returns a new Matrix object that represent the augmented matrix between self.matrix

and other.matrix

pre-req: self.num_rows == other.num_rows and self.num_columns == other.num_columns and

self.num_rows == self.num_columns

’’’

For this method you can safely assume that the matrices of both input objects have the same dimensions

(i.e., self.num rows == other.num rows and self.num columns == other.num columns).

Furthermore, both square matrices are square matrices (i.e., self.num rows == self.num columns). These

pre-requisite is very important because it differs from the stacking method of the recorded video lecture.

Please remember that in the video we stacked the vector b as the last column of the matrix A. Here,

for this assignment (and in order to compute the inverse of the matrix), we need to stack the identity

matrix I to the matrix A.

Question 3: un stacking (12 points)

Complete the un stacking function, which takes one Matrix object as input and returns a new Matrix

object representing the matrix that was stacked in the augmented matrix. If M (M = [X|Y ]) is the

augmented matrix, the un stacking method must return a new Matrix object representing the matrix Y .

The following is a view of how the function looks in the Matrix.py file.

def un_stacking(self):

’’’Returns a new Matrix object that represent the matrix that was stacked in the

augmented matrix self.matrix.

pre-req: self.num_columns % 2 == 0

’’’

For this method you can safely assume that the number of columns in the augmented matrix is even

(i.e., self.num columns % 2 == 0 )

Question 4: gauss jordan (12 points)

The gauss jordan function, which takes one Matrix object (which represents an augmented matrix)

as input, compute the gauss jordan elimination method on that augmented matrix and returns a new

Matrix object with the result.

The following is a view of how the function looks in the Matrix.py file.

def gauss_jordan(self):

’’’Returns a new Matrix object that represent the resulted matrix of applying the

gauss_jordan elimination method on the augmented matrix self.matrix.

pre-req: self.num_columns % 2 == 0

’’’

a = [row[:] for row in self.matrix]

for i in range(self.num_rows):

if a[i][i] == 0.0:

sys.exit(’Divide by zero detected!’)

for j in range(self.num_rows):

if i != j:

ratio = a[j][i]/a[i][i]

for k in range(self.num_columns):

a[j][k] = a[j][k] - ratio * a[i][k]

#Start of ’I could not update this part, HELP!!!’

for i in range(n):

x[i] = a[i][n]/a[i][i]

#End of ’I could not update this part, HELP!!!’

return Matrix(a)

This method has been provided to you and it is a copy/paste version of the code mentioned in the

recorded video lecture. Please remember that in the slide 14 (of the recorded video lecture) we provided

a link with a sample program

https://www.codesansar.com/numerical-methods/gauss-jordan-method-python-program-output.

htm. We just copied that code and modify small details to accommodate it to our OOP model. However,

we run out of time in the preparation of this assignment and we were not able to modify all the code.

Particularly, the code that is inside the two comments “#Start of ’I could not update this part, HELP!!!”’

and “#End of ’I could not update this part, HELP!!!”’ was not fixed. Your job for this question is to

modify that part of the code to make it work on our augmented matrix. Please remember that the code

that you saw in the recorded video lecture works in an augmented matrix M = [A|b] where b is a vector

with one column. For this assignment, we are working with an augmented matrix M = [A|I], where I is

the identity matrix whose dimensions are the same than A. Please do not forget to comment the code.

Question 5: inverse (12 points)

Finally we have everything that is needed to compute the inverse of our matrix. Complete the inverse

function, which takes one Matrix object as input and returns a new Matrix object representing the

inverse of the input matrix. Please remember the protocol to find the inverse of a matrix.

1. Create an augmented matrix M = [A|I] by stacking the matrix I at the end of the matrix A. Please

Page 5

notice that we provided the function create identity and at this point you have already coded

the function stacking

2. Run the Gauss Jordan elimination method on the augmented matrix created in the previous step.

3. un stacking and return the result.

The following is a view of how the function looks in the Matrix.py file.

def inverse(self):

’’’Returns a Matrix object representing the inverse of self.matrix

’’’

Question 6: my test (0 points)

The function my test is there to give you a starting point to test your functions. Please note that this

function will not be graded, and it is there only to make sure that you understand what every function

is expected to do and to test your own code. Note: In order for you to test your functions one at a time,

comment out the portions of the my test() function that call functions you have not yet written.

What To Submit?

Attached to this assignment is a file called Matrix.py. PLEASE note that the code outside the body of the

function must not be modified. You have to submit only this Matrix.py file. Please DO NOT zip (or rar)

your files, and do not submit any other files.


关闭窗口
上一篇:程序设计代写、java留学生编程代做、代写program语言
下一篇:Python代写Programming作业_Python作业代写

相关阅读

cs代写_计算机作业代写_靠谱代写机构
cs代写_计算机作业代写_靠谱代写机构

mingxinwrite 专业 代写文章 的网站,提供优质的软文代写、论文润色、论文翻译、论文修改和 代写作业 、代写作文等服务. 您如果寻找靠谱的编程作业代写,mingxinwrite代写可以说,...

c/c++程序代写、c++编程代写,c++作业代写
c/c++程序代写、c++编程代写,c++作业代写

代做data留学生作业、代写Python,Java编程设计作业、 代做c/c++语言作业 ,代写data留学生作业、 代做c/c++ ,Java,Python程序语言作业、代写program课程作业, Mingxinwrite 拥有出身于世...

Python代写Programming作业_Python作业代写
Python代写Programming作业_Python作业代写

我们提供专属的 CS程序代写 服务,代写各类程序语言: C语言代写 , C++代写, 算法作业代写 , 数据结构代写, AI代写, python代写 , java代写, matlab代写, 汇编代写, scala代写, GO代写,Hask...


代写
微信

微信客服

微信客服:EG1hao

山东济南市历下区三庆财富中心

qq

QQ客服

QQ联系:3029629821