Begin Sci Comp5 - Mathematics
Please use the sample format as attached mlx file and upload both mlx and pdf. Make sure to sign problems and which part is it.
By hand part you should write by hand and take a picture then insert it in.
Notes.
When uploading your work, be sure to choose correct pages, without missing any, for each problem. Besides, make sure all pages are in order, no page is rotated, and none of your code or hand-written work is cut out.
According to our homework policies, you are allowed to collaborate for homework assignments in a group of up to 5 students. If you did, please list all your collaborators at the top of your homework, below your name.
Homework must be prepared using a live script (.mlx file). Submission generated using any other means (e.g., Words with MATLAB screenshots) will not be accepted.
Starting from this assignment, you will be asked to write MATLAB functions. Unlike scripts, functions can be included inside your mlx file at the very end of the document. So you no longer need to write an external m-file and print its content using the type function. For more detailed instruction, please read
[Guide] How to Embed Functions in Live Scripts:
Method 1: Using Code Example Environment
Suppose that you have written a function as a separate function m-file, myfoo.m and now you want to include its contents within your homework live script, HW2_Kim.mlx. At the top of MATLAB window, click on Insert > Code Example. It creates a blank box. Any text typed within this box will be formatted in monospaced fonts with syntax highlighting.
Drawbacks:
The box is not an executable code block.
If you make changes to myfoo.m, you need update the code example block accordingly (by copying and pasting).
Method 2: Using TYPE Function
Still suppose that you have a function written as a separate m-file titled myfoo.m. Then you can simply type
type myfoo
within a code block. The contents of myfoo.m will be printed out in your live script.
Note:
We have been using this to print out the contents of external script m-files. This works in the exact same way for function m-files.
Drawbacks:
If you forget to run that block after your final edit, your live script will show an outdated version of your function.
As you complete more and more assignments, your folders will be filled with more m-files and may be difficult to manage unless you are well-organized.
Method 3 (Recommended): Writing Functions at the End of Live Script
Instead of writing a separate m-file, you may just write the function at the very bottom of the document. The functions are local to the live script, and so you are able to call the function anywhere inside the live script. This way, your mlx file is fully self-contained and you no longer need to go back and forth between Editor and Live Editor. See the live script accompanying Lecture 9; all functions defined for the live script are gathered in the last section titled Functions Used.
This is my recommended method!
The only caveat I can think of:
Suppose Problem 1(a) asks you to write a function, and so you write it at the end of your live script. You then exports it to a pdf file and find out that Problem 1 solutions are on pp. 1--2, with the function written for 1(a) appearing on p. 7. In this case, when you upload the pdf file to Gradescope, you have to select pages 7, 1, and 2 for Problem 1, in that order.
Updated on September 30, 2021
Hints for Homework 5
1. (Improved triangular substitutions; adapted from FNC 2.3.5)
(a) The function backsub handles the case in which A is upper triangular; call it U:
U
x1 x2 · · · xp
︸ ︷︷ ︸
=X
=
b1 b2 · · · bp
︸ ︷︷ ︸
=B
.
For any j ∈ N[1,p], the solution of Uxj = bj is obtained by applying the backward
substitution formula given in lecture:
xn,j =
bn,j
un,n
and
xi,j =
1
ui,i
bi,j − n∑
k=i+1
ui,kxk,j
for i = n− 1,n− 2, . . . , 1.
Encode these formulas using nested for-loops in your program:
• outer loop: iterate over columns (j = 1, 2, . . . ,p)
• inner loop: implement the backward substitution formula (i = n,n− 1, . . . , 1).
You may use the following template to begin your program backsub.m1 by
function X = backsub(U,B)
\% BACKSUB X = backsub(U,B)
\% Solve multiple upper triangular linear systems.
\% Input:
\% U upper triangular square matrix (n-by-n)
\% B right-hand side vectors concatenated into an (n-by-p) matrix
\% Output:
\% X solution of UX = B (n-by-p)
[n,p] = size(B); \% grab dimensions
X = zeros(n,p); \% preallocate output
\%\% Implement back. subs. formula (nested for-loop)
end
1You do not need to write external function m-files. Simply write them at the end of the document as instructed
in the problem.
1
The function forelim can be written in a very analogous manner.
Note. If you want to include a check for triangularity of the coefficient matrix, use
istriu (upper triangular) or istril (lower triangular), e.g.,
if ~istriu(U)
error(’The matrix U must be upper triangular.’);
end
The inclusion of such a check will not be part of the grading rubrics.
(b) One way to test your code using the given examples is to compute the norm of the
difference of the analytical inverse and the numerically calculated inverse. For example,
L1 = .....;
L1inv = .....; \% analytical inverse given
L1invNum = ltinverse(L1); \% numerically calculated inverse
norm(L1inv - L1invNum) \% norm of the difference
We want to see a small norm, if not zero.
2. (Triangular substitution and stability; FNC 2.3.6)
(a) In this part, you show that x = (1, 1, 1, 1, 1)T solves the system for any values of α and
β; this is an analytical result.
(b) In this second part, however, you check whether the computer indeed produces the
same answer for changing values of β while α is fixed. When the problem says “Using
MATLAB, solve the system . . .”, it simply means that you use the backslash \ to solve
the system Ax = b.
3. (Vectorizing mylu.m; FNC 2.4.7)
(a) For this part, follow the direction given in the problem:
• delete the keyword for in the inner loop; (just for, not the rest)
• delete the matching end of the inner loop;
• put a semicolon at the end of i = j+1:n.
This defines i to be a vector of indices (j + 1,j + 2, . . . ,n). Passing i into L or A in
the next two lines, the code effectively accesses the (j + 1)st through nth rows of the
respective matrices; see the slides titled Using Vectors as Indices in Lecture 7 on arrays.
(b) Let x ∈ Rn and A ∈ Rn×n, not necessarily the ones appearing in the problem. The
ordinary elementwise vector/matrix notation refers to the convention of denoting the
elements of a vector or a matrix using subscripts such as
• xi: the ith element of vector bx;
• Ai,j: the element of A on the ith row and jth column.
In MATLAB, they are expressed as x(i) and A(i,j), respectively. Now, let’s concen-
trate on the matrix case:
A(< rowindex >,< columnindex >)
When one of the two indices is a vector, as in the case of the problem, it represents the
slice of the matrix on a specified row or column. For example,
2
• A row vector consisting of 5th through 8th elements on the 3rd row of A:
A(3, 5 : 8) −→
[
A3,5 A3,6 A3,7 A3,8
]
• A column vector consisting of 5th through 8th elements on the 3rd column of A:
A(5 : 8, 3) −→
A5,3
A6,3
A7,3
A8,3
When both indices are vectors, it represents the submatrix on the specified rows and
columns. For example,
• The submatrix of A between 2nd and 4th rows and between 1st and 5th columns:
A(2 : 4, 1 : 5) −→
A2,1 A2,2 A2,3 A2,4 A2,5A3,1 A3,2 A3,3 A3,4 A3,5
A4,1 A4,2 A4,3 A4,4 A4,5
You are to translate the MATLAB statements in your vectorized mylu into mathematical
notations as shown above.
4. (Application of LU factorization: FNC 2.4.6)
(a) Recall the following properties of the determinant from linear algebra:
• det(AB) = det(A) det(B).
• det(T) = t11t22 · · ·tnn =
∏n
i=1 tii, where T ∈ Rn×n is a triangular matrix.
(b) Try to vectorize your code. The function can be written in only couple lines (excluding
the function header and the end statement) without using any loop. It would be also
useful to recall that if you only want to generate the second output of a certain function,
you put ~ in place of the first output argument as a placeholder. For instance, if you
only need U from mylu(A), instead of calling it with [L,U] = mylu(A), use
[~, U] = mylu(A);
Note. Use the vectorized version of mylu which you already wrote for Question 3.
5. (Proper usage of lu; FNC 2.6.1)
The expression U \ L \ b is equivalent to (U \ L) \ b.
6. (FLOP Counting)
(a) Consider the following example question.
Question. How would you code x = ABb most efficiently in MATLAB, and how many
flops are needed?
Answer. There are only two ways2 to code it: x=A*(B*b) or x=(A*B)*b. If the
former is used, MATLAB
i. carries out B*b: matrix-by-vector multiplication (∼ 2n2 flops)
2This is the same as x = A*B*b.
3
ii. left-multiplies the previous result by A: another matrix-by-vector multiplication (∼
2n2 flops)
In total, it takes ∼ 4n2 flops. On the other hand, the latter version requires the matrix-
by-matrix multiplication A*B, which already takes ∼ 2n3 flops. So the former is the
efficient one.
Lesson. Avoid matrix-by-matrix multiplication as much as possible!
Also remember to use the backslash operator if matrix inversion is required, instead of
inv. When \ is invoked, MATLAB in general does a pivoted Gaussian elimination,
which takes ∼ (2/3)n3 flops.
7. (Matrix norms; Sp20 midterm)
Hints are found in the lecture for 10/01/21 (F).
4
Updated on September 28, 2021
Math 3607: Homework 5
Due: 10:00PM, Tuesday, October 5, 2021
TOTAL: 30 points
• Problems marked with v are to be done by hand; those marked with � are to be solved using a
computer.
• Important note. Do not use Symbolic Math Toolbox. Any work done using sym or syms will receive
NO credit.
• Another important note. When asked write a MATLAB function, write one at the end of your
live script.
1. (Improved triangular substitutions; adapted from FNC 2.3.5) � If B ∈ Rn×p has columns
b1, . . . , bp, then we can pose p linear systems at once by writing AX = B, where X ∈ Rn×p
whose jth column xj solves Axj = bj for j = 1, . . . ,p:
A
x1 x2 · · · xp
︸ ︷︷ ︸
=X
=
b1 b2 · · · bp
︸ ︷︷ ︸
=B
.
(a) Modify backsub.m and forelim.m from lecture1 so that they solve the case where
the second input is an n×p matrix, for p ≥ 1. Include the programs at the end of your
live script.
(b) If AX = I, then X = A−1. Use this fact to write a MATLAB function ltinverse
that uses your modified forelim to compute the inverse of a lower triangular matrix.
Include the program at the end of your live script. Then test your function using the
following matrices, that is, compare your numerical solutions against the given exact
solutions.
L1 =
2 0 08 −7 0
4 9 −27
, L−11 =
1
2 0 0
4
7 −
1
7 0
50
189 −
1
21 −
1
27
L2 =
1 0 0 0
1
3 1 0 0
0 13 1 0
0 0 13 1
, L−12 =
1 0 0 0
−13 1 0 0
1
9 −
1
3 1 0
− 127
1
9 −
1
3 1
1Lecture 12 (09/24/21, F): Square Linear Systems (Introduction)
1
2. (Triangular substitution and stability; FNC 2.3.6) Consider the following linear system Ax =
b:
1 −1 0 α−β β
0 1 −1 0 0
0 0 1 −1 0
0 0 0 1 −1
0 0 0 0 1
︸ ︷︷ ︸
A
x1
x2
x3
x4
x5
︸ ︷︷ ︸
x
=
α
0
0
0
1
.
︸ ︷︷ ︸
b
(a) v Show that x = (1, 1, 1, 1, 1)T is the solution for any α and β.
(b) � Using MATLAB, solve the system with α = 0.1 and β = 10, 100, . . . , 1012, making a
table of the values of β and |x1 − 1|. Write down your observation.
3. (Vectorizing mylu.m; FNC 2.4.7) Below is an instructional version of LU factorization code
presented in lecture.
function [L,U] = mylu(A)
\% MYLU LU factorization (demo only--not stable!).
\% Input:
\% A square matrix
\% Output:
\% L,U unit lower triangular and upper triangular such that LU=A
n = length(A);
L = eye(n); \% ones on diagonal
\% Gaussian elimination
for j = 1:n-1
for i = j+1:n
L(i,j) = A(i,j) / A(j,j); \% row multiplier
A(i,j:n) = A(i,j:n) - L(i,j)*A(j,j:n);
end
end
U = triu(A);
end
Consider the innermost loop. Since the different iterations in i are all independent, it is
possible to vectorize this group of operations, that is, rewrite it without a loop. In fact, the
necessary changes are to delete the keyword for in the inner loop, and delete the following
end line. (You should also put a semicolon at the end of i = j+1:n to suppress extra
output.)
(a) � Make the changes as directed and verify that the function works properly.
(b) v Write out symbolically (i.e., using ordinary elementwise vector and matrix notation)
what the new version of the function does in the case n = 5 for the iteration with j = 3.
4. (Application of LU factorization: FNC 2.4.6) When computing the determinant of a matrix
by hand, it is common to use cofactor expansion and apply the definition recursively. But
this is terribly inefficient as a function of the matrix size.
(a) v Explain why, if A = LU is an LU factorization,
det(A) = u11u22 · · ·unn =
n∏
i=1
uii.
2
This part is an analytical question. Do it by hand.
(b) �Using the result of part (a), write a MATLAB function determinant that computes
the determinant of a given matrix A using mylu from lecture. Include the function at
the end of your live script. Use your function and the built-in det on the matrices
magic(n) for n = 3, 4, . . . , 7, and make a table (using disp or fprintf) showing n,
the value from your function, and the relative error when compared to det.
5. (Proper usage of lu; FNC 2.6.1) v Suppose that A ∈ Rn×n and b ∈ Rn. On the left is
correct MATLAB code to solve Ax = b; on the right is similar but incorrect code. Explain
using mathematical notation exactly what vector is found by the right-hand version.
[L,U] = lu(A);
x = U \ ( L \ b );
[L,U] = lu(A);
x = U \ L \ b;
6. (FLOP Counting) v Do LM 10.1–12(a,b,d). Justify your calculation of p and c for each
part.
7. (Matrix norms; Sp20 midterm) Let
A =
[
1 2
0 3
]
.
(a) v Calculate ‖A‖1, ‖A‖2, ‖A‖∞, and ‖A‖F all by hand.
(b) � Imagine that MATLAB does not offer norm function and you are writing one for
others to use, which begins with
function MatrixNorm(A, j)
\% MatrixNorm computes matrix norms
\% Usage:
\% mat_norm(A, 1) returns the 1-norm of A
\% mat_norm(A, 2) is the same as mat_norm(A)
\% mat_norm(A, ’inf’) returns the infinity-norm of A
\% mat_norm(A, ’fro’) returns the Frobenius norm of A
Complete the program. (Hint: To handle the second input argument properly which
can be a number or a character, use ischaracter and/or strcmp.)
3
[Content_Types].xml
_rels/.rels
matlab/document.xml
Homework 1 Math 3607, Spring 2021 [Your Name] Table of Contents Problem 1. (LM 2.1--6)
Problem 2. (LM 2.1--8)
Part (a)
(i)
Part (b)
Part (c)
Problem 3. (LM 2.1--14)
Part (a)
Problem 4. (Temperature Conversion)
Problem 5. (Oblate Spheroid) Problem 1. (LM 2.1--6) Your answer here. \% Code goes here Problem 2. (LM 2.1--8) Part (a) (i) (ii) (vi) Part (b) Part (c) Problem 3. (LM 2.1--14) Part (a) Problem 4. (Temperature Conversion) Problem 5. (Oblate Spheroid)
matlab/output.xml
manual code ready 0.4
metadata/coreProperties.xml
2021-01-13T21:38:03Z 2021-01-13T21:38:03Z
metadata/mwcoreProperties.xml
application/vnd.mathworks.matlab.code MATLAB Code R2020b
metadata/mwcorePropertiesExtension.xml
9.9.0.1444674 93b378b9-5b5d-4623-b00d-0e154b3a183c
metadata/mwcorePropertiesReleaseInfo.xml
9.9.0.1524771
R2020b
Update 2
Nov 03 2020
2207788044
CATEGORIES
Economics
Nursing
Applied Sciences
Psychology
Science
Management
Computer Science
Human Resource Management
Accounting
Information Systems
English
Anatomy
Operations Management
Sociology
Literature
Education
Business & Finance
Marketing
Engineering
Statistics
Biology
Political Science
Reading
History
Financial markets
Philosophy
Mathematics
Law
Criminal
Architecture and Design
Government
Social Science
World history
Chemistry
Humanities
Business Finance
Writing
Programming
Telecommunications Engineering
Geography
Physics
Spanish
ach
e. Embedded Entrepreneurship
f. Three Social Entrepreneurship Models
g. Social-Founder Identity
h. Micros-enterprise Development
Outcomes
Subset 2. Indigenous Entrepreneurship Approaches (Outside of Canada)
a. Indigenous Australian Entrepreneurs Exami
Calculus
(people influence of
others) processes that you perceived occurs in this specific Institution Select one of the forms of stratification highlighted (focus on inter the intersectionalities
of these three) to reflect and analyze the potential ways these (
American history
Pharmacology
Ancient history
. Also
Numerical analysis
Environmental science
Electrical Engineering
Precalculus
Physiology
Civil Engineering
Electronic Engineering
ness Horizons
Algebra
Geology
Physical chemistry
nt
When considering both O
lassrooms
Civil
Probability
ions
Identify a specific consumer product that you or your family have used for quite some time. This might be a branded smartphone (if you have used several versions over the years)
or the court to consider in its deliberations. Locard’s exchange principle argues that during the commission of a crime
Chemical Engineering
Ecology
aragraphs (meaning 25 sentences or more). Your assignment may be more than 5 paragraphs but not less.
INSTRUCTIONS:
To access the FNU Online Library for journals and articles you can go the FNU library link here:
https://www.fnu.edu/library/
In order to
n that draws upon the theoretical reading to explain and contextualize the design choices. Be sure to directly quote or paraphrase the reading
ce to the vaccine. Your campaign must educate and inform the audience on the benefits but also create for safe and open dialogue. A key metric of your campaign will be the direct increase in numbers.
Key outcomes: The approach that you take must be clear
Mechanical Engineering
Organic chemistry
Geometry
nment
Topic
You will need to pick one topic for your project (5 pts)
Literature search
You will need to perform a literature search for your topic
Geophysics
you been involved with a company doing a redesign of business processes
Communication on Customer Relations. Discuss how two-way communication on social media channels impacts businesses both positively and negatively. Provide any personal examples from your experience
od pressure and hypertension via a community-wide intervention that targets the problem across the lifespan (i.e. includes all ages).
Develop a community-wide intervention to reduce elevated blood pressure and hypertension in the State of Alabama that in
in body of the report
Conclusions
References (8 References Minimum)
*** Words count = 2000 words.
*** In-Text Citations and References using Harvard style.
*** In Task section I’ve chose (Economic issues in overseas contracting)"
Electromagnetism
w or quality improvement; it was just all part of good nursing care. The goal for quality improvement is to monitor patient outcomes using statistics for comparison to standards of care for different diseases
e a 1 to 2 slide Microsoft PowerPoint presentation on the different models of case management. Include speaker notes... .....Describe three different models of case management.
visual representations of information. They can include numbers
SSAY
ame workbook for all 3 milestones. You do not need to download a new copy for Milestones 2 or 3. When you submit Milestone 3
pages):
Provide a description of an existing intervention in Canada
making the appropriate buying decisions in an ethical and professional manner.
Topic: Purchasing and Technology
You read about blockchain ledger technology. Now do some additional research out on the Internet and share your URL with the rest of the class
be aware of which features their competitors are opting to include so the product development teams can design similar or enhanced features to attract more of the market. The more unique
low (The Top Health Industry Trends to Watch in 2015) to assist you with this discussion.
https://youtu.be/fRym_jyuBc0
Next year the $2.8 trillion U.S. healthcare industry will finally begin to look and feel more like the rest of the business wo
evidence-based primary care curriculum. Throughout your nurse practitioner program
Vignette
Understanding Gender Fluidity
Providing Inclusive Quality Care
Affirming Clinical Encounters
Conclusion
References
Nurse Practitioner Knowledge
Mechanics
and word limit is unit as a guide only.
The assessment may be re-attempted on two further occasions (maximum three attempts in total). All assessments must be resubmitted 3 days within receiving your unsatisfactory grade. You must clearly indicate “Re-su
Trigonometry
Article writing
Other
5. June 29
After the components sending to the manufacturing house
1. In 1972 the Furman v. Georgia case resulted in a decision that would put action into motion. Furman was originally sentenced to death because of a murder he committed in Georgia but the court debated whether or not this was a violation of his 8th amend
One of the first conflicts that would need to be investigated would be whether the human service professional followed the responsibility to client ethical standard. While developing a relationship with client it is important to clarify that if danger or
Ethical behavior is a critical topic in the workplace because the impact of it can make or break a business
No matter which type of health care organization
With a direct sale
During the pandemic
Computers are being used to monitor the spread of outbreaks in different areas of the world and with this record
3. Furman v. Georgia is a U.S Supreme Court case that resolves around the Eighth Amendments ban on cruel and unsual punishment in death penalty cases. The Furman v. Georgia case was based on Furman being convicted of murder in Georgia. Furman was caught i
One major ethical conflict that may arise in my investigation is the Responsibility to Client in both Standard 3 and Standard 4 of the Ethical Standards for Human Service Professionals (2015). Making sure we do not disclose information without consent ev
4. Identify two examples of real world problems that you have observed in your personal
Summary & Evaluation: Reference & 188. Academic Search Ultimate
Ethics
We can mention at least one example of how the violation of ethical standards can be prevented. Many organizations promote ethical self-regulation by creating moral codes to help direct their business activities
*DDB is used for the first three years
For example
The inbound logistics for William Instrument refer to purchase components from various electronic firms. During the purchase process William need to consider the quality and price of the components. In this case
4. A U.S. Supreme Court case known as Furman v. Georgia (1972) is a landmark case that involved Eighth Amendment’s ban of unusual and cruel punishment in death penalty cases (Furman v. Georgia (1972)
With covid coming into place
In my opinion
with
Not necessarily all home buyers are the same! When you choose to work with we buy ugly houses Baltimore & nationwide USA
The ability to view ourselves from an unbiased perspective allows us to critically assess our personal strengths and weaknesses. This is an important step in the process of finding the right resources for our personal learning style. Ego and pride can be
· By Day 1 of this week
While you must form your answers to the questions below from our assigned reading material
CliftonLarsonAllen LLP (2013)
5 The family dynamic is awkward at first since the most outgoing and straight forward person in the family in Linda
Urien
The most important benefit of my statistical analysis would be the accuracy with which I interpret the data. The greatest obstacle
From a similar but larger point of view
4 In order to get the entire family to come back for another session I would suggest coming in on a day the restaurant is not open
When seeking to identify a patient’s health condition
After viewing the you tube videos on prayer
Your paper must be at least two pages in length (not counting the title and reference pages)
The word assimilate is negative to me. I believe everyone should learn about a country that they are going to live in. It doesnt mean that they have to believe that everything in America is better than where they came from. It means that they care enough
Data collection
Single Subject Chris is a social worker in a geriatric case management program located in a midsize Northeastern town. She has an MSW and is part of a team of case managers that likes to continuously improve on its practice. The team is currently using an
I would start off with Linda on repeating her options for the child and going over what she is feeling with each option. I would want to find out what she is afraid of. I would avoid asking her any “why” questions because I want her to be in the here an
Summarize the advantages and disadvantages of using an Internet site as means of collecting data for psychological research (Comp 2.1) 25.0\% Summarization of the advantages and disadvantages of using an Internet site as means of collecting data for psych
Identify the type of research used in a chosen study
Compose a 1
Optics
effect relationship becomes more difficult—as the researcher cannot enact total control of another person even in an experimental environment. Social workers serve clients in highly complex real-world environments. Clients often implement recommended inte
I think knowing more about you will allow you to be able to choose the right resources
Be 4 pages in length
soft MB-920 dumps review and documentation and high-quality listing pdf MB-920 braindumps also recommended and approved by Microsoft experts. The practical test
g
One thing you will need to do in college is learn how to find and use references. References support your ideas. College-level work must be supported by research. You are expected to do that for this paper. You will research
Elaborate on any potential confounds or ethical concerns while participating in the psychological study 20.0\% Elaboration on any potential confounds or ethical concerns while participating in the psychological study is missing. Elaboration on any potenti
3 The first thing I would do in the family’s first session is develop a genogram of the family to get an idea of all the individuals who play a major role in Linda’s life. After establishing where each member is in relation to the family
A Health in All Policies approach
Note: The requirements outlined below correspond to the grading criteria in the scoring guide. At a minimum
Chen
Read Connecting Communities and Complexity: A Case Study in Creating the Conditions for Transformational Change
Read Reflections on Cultural Humility
Read A Basic Guide to ABCD Community Organizing
Use the bolded black section and sub-section titles below to organize your paper. For each section
Losinski forwarded the article on a priority basis to Mary Scott
Losinksi wanted details on use of the ED at CGH. He asked the administrative resident