In: Advanced Math
Exercise 3
Part 1. Solving a system Ax = b **Create a function in MATLAB that
begins with: function [C,N]=solvesys(A) [~,n]=size(A);
b=fix(10*rand(n,1)) format long We are using format long to display
a number in exponent format with 15 digit mantissas. If later on,
you will need to switch back to the default format, type and run
format The input is an matrix A. If A is invertible, the outputs
are the matrix C, whose 3 columns x1, x2, x3 are the solutions
obtained by the three methods described above, respectively, and N
is the vector whose 3 entries are the 2-norms of the vectors of the
differences between each two solutions.
**First, check if A is invertible. If A is not invertible, the function returns an empty matrix C=[ ] and an empty vector N=[ ]. Also, in this case, there are two possibilities for the system Ax = b: either “the system is inconsistent” or “the solution is not unique”. Use the command rank to check it on the two possible cases and program the two corresponding output messages. After that, terminate the program.
If A is invertible, the function solves the equation Ax = b using the three methods described above and gives the output vectors x1, x2, x3 for each of the methods (1)-(3), respectively. The vectors have to be the columns of the matrix C. Thus, we assign: C=[x1, x2, x3 ];
**The function [C,N]=solvesys(A) also returns a column vector N=[n1;n2;n3]; where n1=norm(x1-x2); n2=norm(x2-x3); n3=norm(x3-x1); The entries of the vector N are the 2-norms of the vectors of the differences between each two distinct solutions. Each entry is calculated by using a built-in MATLAB function norm, which is a square root of the sum of squares of the entries of the vector. The vector N gives an idea how “different” are the solutions obtained by various methods.
**Type the function solvesys in your Live Script.
**Run the function [C,N]=solvesys(A) for the following choices of the matrix A:
(a) A = magic(6); (b) A = magic(7); (c) A = eye(4); % Write a comment on the output for part (c) by comparing the solution with the vector b. (d) A = randi(20,4), (e) A = magic(3); (f) A = hilb(7)
Part 2. Condition numbers **Find the condition numbers of the matrices A=magic(7) and A=hilb(7) c1=cond(magic(7)) c2=cond(hilb(7))
% Compare c1 and c2 with number 1 and explain in your dairy file why the norms of the differences between the solutions for the coefficient matrix in part (f) are so big compared with the ones for the matrix in part (b).
**Explore the sensitivity of a badly conditioned matrix hilb(7): Input: A=hilb(7); Run the following: b=ones(7,1); x=A\b; b1=b+0.01; y=A\b1; norm(x-y) c3=rcond(A) %Using the output c3, which is the reciprocal condition number, explain why the system with the coefficient matrix hilb(7) is sensitive to perturbations.
**Re-run the code above for: A=magic(7);
%Comment on sensitivity to perturbations of magic(7) compared with hilb(7) by analyzing the corresponding outputs for the norm(x-y) and c3.
In: Advanced Math
Problem 2: Indirect and Euclidean proofs (40 pts) For the following problems, you must use an indirect proof technique.
(a) (10 pts) Prove indirectly that, if a 2 is a multiple of 31, then so is a. Your proof should not consist of 30 cases – this includes absolutely no implied cases using horizontal dots (· · ·) and/or vertical dots (. . .).
(b) (15 pts) Using the result of question (a), prove that √ 31 is not a rational Q using the Euclidean method.
(c) (15 pts) Using the result of question (a), prove that √ 31 is not a rational Q using the Unique Prime Factorization Theorem.
In: Advanced Math
Research one of the fields below. a description of what the field is, i.e. what topics it covers, some of the questions that it tries to answer and the ways in which it can be used.
In: Advanced Math
Find a general solution to the following higher-order equation: y''''+17y''+16y=0
I know you have to rewrite this question into :
r4 + 17r2 +16 = 0
factoring I get (r2 +1)(r2+16), facotring further (r+i)2(r+4i)2
Am I correct so far? and if so how do I approach from this point onwards?
In: Advanced Math
Prove that Kruskal’s algorithm finds a minimum weight spanning tree.
In: Advanced Math
1. For each of the phenomena described below, propose a
probability distribution for the numerical variable(s) involved and
give the corresponding formula.
e) Compute the probability of observing exactly k alternations of
colours in a drawing of 6 balls, with replacement, from an urn
containing an equal number of red and blue balls. (Examples: RBBBBB
is one alternation, whereas RBBRBB and RRBRBB each have three
alternations.)
In: Advanced Math
1.
How many permutations of the 26 letters are there that contain none of the sequences ROCK, STONE, PLUG, FIT or HAY?
In: Advanced Math
5. For each set below, say whether it is finite, countably infinite, or uncountable. Justify your answer in each case, giving a brief reason rather than an actual proof.
a. The points along the circumference of a unit circle.
(Uncountable because across the unit circle because points are one-to-one correspondence to real numbers) so they are uncountable
b. The carbon atoms in a single page of the textbook.
("Finite", since we are able to count the number of atoms in a single page of textbook)(The single page is the limit and it contains a number of carbon atom elements)
c. The different angles that could be formed when two lines intersect (e.g. 30 degrees, 45 degrees, 359.89 degrees, etc….)
("uncountable" because, the different angles that can be made would be in radial from 0-2pi, pi is an example of irrational angle and cannot be counted in the set.
d. All irrationals which are exact square roots of a natural number.
("countably infinite", there are infinite perfect squares as x approaches infinity, so there are infinite exact square roots for a natural number, which is one to one correspondence and is onto therefore is countable
e. All irrationals of the form a+sqrt(b) where a and b are rational numbers.
(im unsure about this one but i would say "uncountable" because not all a+sqrt(b) will be rational, sqrt(b) would have to be ration for it to be a countable, since irrational numbers are countable
f. The set of all squares that can be drawn within a unit circle.
"Uncountable" it has a one to one correspondence from 0 to 2pi
i wanted to crosscheck n see if this is right
In: Advanced Math
In: Advanced Math
The standard technique for determining cardiac output is the indicator dilution method developed by Hamilton. One end of a small catheter is inserted in the radial artery and the other end is connected to a densitometer which can automatically record the concentration of the dye in the blood. A known amount of dye, 5.6mg is injected rapidly the following data is obtained. Fill in the table using Newton’s interpolation to determine the divided difference coefficients.
t (s) 2 3 8 10 13 14
C (mg/L) 0.89927 0.85987 1.96637 1.54559 0.17987 0.50699
t | C(t) | ∆ f'(x) | ∆ f"(x) | ∆ f"'(x) | ∆ f""(x) | ∆ f""'(x) |
2 | 0.89927 | |||||
3 | 0.85987 | |||||
8 | 1.96637 | |||||
10 | 1.54559 | |||||
13 | 0.17987 | |||||
14 | 0.50699 |
In: Advanced Math
Show that if there are 100 people of different heights standing in a line, then it is possible to find at least 10 people in the order they stand in the line with increasing heights, or at least 12 people with decreasing heights.
In: Advanced Math
Show that is [(n^2) + 2] and [(n^2) - 2] are both primes, then 3 divides n
In: Advanced Math
Solve both ways:
a) y" -2y' + y = e^2x
b) Solve only by variation of parameters
b) y" -9y = x/(e^3x)
c) y" -2y' + y = (e^x)/(x^4)
d) y" + y = sec^3 x
In: Advanced Math
a) Determine the correct form of the particular solution
y" + y = sin x
b) Solve IVP: y" + y = e^x + x^3; y(0) = 2, y'(0) = 0
c) Solve IVP: y" + y' -2y = x + sin 2x; y(0) = 1, y'(0) = 0
In: Advanced Math