Ans)
%======================MATLAB CODE=============
%Generation of Matrix "E"
n=20;
for i=1:20
for j=1:20
if i==j
C(i,j)=i*(n-i+1);
E(i,j)=(1/(n+1))*C(i,j);
elseif j>i
C(i,j)=C(i,j-1)-i;
E(i,j)=(1/(n+1))*C(i,j);
else
C(i,j)=C(j,i);
E(i,j)=(1/(n+1))*C(i,j);
end
end
end
b=[1:n]'; %MATRIX "b"
a=[E b]; %Coefficient Matrix used for Gauss Elimination below
%Gauss elimination method [m,n)=size(a);
[m,n]=size(a);
for j=1:m-1
for z=2:m
if a(j,j)==0
t=a(j,:);a(j,:)=a(z,:);
a(z,:)=t;
end
end
for i=j+1:m
a(i,:)=a(i,:)-a(j,:)*(a(i,j)/a(j,j));
end
end
x=zeros(1,m);
for s=m:-1:1
c=0;
for k=2:m
c=c+a(s,k)*x(k);
end
x(s)=(a(s,n)-c)/a(s,s);
end
disp('Gauss elimination method:');
x' %solution vector
===============================================
The solution when you run above code is
2 Write an M-file to generate E (1/(n+1)Cjwhere, C-1) ifi-j i,j-1 fj >1 Having generated E. for n...
function f( , j) if i0 eturn j else return fj, i-1 ) + 1 a) What is the value of f(1,1)? (0.2 point) b) What is the value of f (2,3)? (0.2 point) c) What is the value of f(5,8)? (0.2 point) d) What is the value of f (13, 21)? (0.2 point) e) Give a short (20 words suffice) intuitive description of what this function does, not how it does it. (Hint: Ignore the code, look at your...
Abstract Algebra
(1) Let I, J C R be ideals. Show that if I is generated by n elements, and J is generated by m elements, then I +J is generated by no more than nm elements. 1
i need explanation for each line and thank you
% Gauss-Jordan method [m, n]-size (a): for j-1:m-1 for z-2:m if a (j,1)0 end end for i-j+1:m end end for j-m:-1:2 for i*)-1:-1:1 end end for s=1:m x (s)-a(s,n); end disp('Guass-Jordan method: '
% Gauss-Jordan method [m, n]-size (a): for j-1:m-1 for z-2:m if a (j,1)0 end end for i-j+1:m end end for j-m:-1:2 for i*)-1:-1:1 end end for s=1:m x (s)-a(s,n); end disp('Guass-Jordan method: '
Generate N binary random variables Xi, i E {1,2,.., N] where X 1 or -1 with equal probability in Matlab using rand or randn. According to central limit theorem, i= 1 should follow normal distribution when N is large. (1) Please plot the theoretical pdf of normal distribution (2) Please estimate the pdf of Vv by generating a lot of instances of Vv (hint: use hist command to get histogram then scaleit) (3) Please plot the theoretical pdf and the...
et l(a) be the language generated by g(a) - (n, 2, s, p) where 2 - [a, b), n= {s,x) and s->axb ... Question: Let L(a) be the language generated by G(a) - (N, 2, S, P) where 2 - [a, b), N= {S,X) and S->aX... Let L(a) be the language generated by G(a) - (N, 2, S, P) where 2 - [a, b), N= {S,X) and S->aXb X->aX|bX|epsilon (i) (3 marks) Describe the language L(a). (First generate a few...
Only need parts c, e, j, m, and p
only need parts c, e, j, m, and p
15. Suppose that X i ~ N(, σ*), i = 1, . . . , n and Zi ~ N(0, 1), i-1, , k, and all variables independent. State the distribution of each of the following variables if it is a "named" distribution or otherwise state "unknown." (a) X1-X2 (i) (b) X2 + 2X3 () Z2 We were unable to transcribe this...
7. Let A [aij] be an n x n invertible tridiagonal matrix, that is aij= 0 if |i - j > 1. Compute the number of operations needed to solve the system Ax b by Gauss elimination without partial pivoting. (10 marks)
7. Let A [aij] be an n x n invertible tridiagonal matrix, that is aij= 0 if |i - j > 1. Compute the number of operations needed to solve the system Ax b by Gauss elimination without...
M-file
dft.m
function Xk = dft(x)
[N,M] = size(x);
if M ~=1, % makes sure that x is a column vector
x = x';
N = M;
end
Xk=zeros(N,1);
n = 0:N-1;
for k=0:N-1
Xk(k+1) = exp(-j*2*pi*k*n/N)*x;
end
Using the MATLAB M-file dft, compute the 32-point DFT of rn cos(₩), 0 〈 n < 10, x[n] 0 for all other n. COS
The pscudocode shown below solves a system of n linear algebraic equations using Gauss-Jordan 125] elimination. DOFOR -1,n DOPOR 1 = k + 1,n + 1 END DO ae 1 DOFOR 1 = 1, n k THEN IF i DOFOR j- k+1,n+ 1 ENDDO END IF END DO END DO DOFOR m-1,n END DO Write a Matlab function program GaussJordan(A,n) which implements this algorithm and a) returns the solution. Here A is the augmented matrix consisting of the coefficient matrix...
a e Octave a a Caleculator to qn i. Calculate the number N equal to the sum of all digits of your SID ii. For the N × N matrix A = (aij) defined as aij-l if i = j, or i + 1 = j, and aij 0 for all other values of (i,j) Compute (A-)x for x ,,1 ER . Compute (A-1)Tx for x = [1, 2, 3, . . . , NIT E RN. . Compute x-A(A-19%...