# Tutor profile: Motaz E.

## Questions

### Subject: Numerical Analysis

Write a Matlab program to perform the bisection method, the program must terminate when the error reaches a certain value.

function [c,err,yc] = bisect(f,a,b,delta) ya = feval(f,a); yb = feval(f,b); if ya*yb > 0 disp('f(a)*f(b) > 0'), yc = NaN; c = NaN; err = NaN; return, end N = 1+round((log(b-a)-log(delta))/log(2)); for k = 1:N+1 c =(a+b)/2; yc = feval(f,c); if yc == 0 a = c; b = c; elseif yb*yc>0 b = c; yb = yc; else a = c; ya = yc; end; end err = abs(b-a);

### Subject: Electrical Engineering

Under equilibrium condition, what is the probability of an electron state being occupied if it is located at the Fermi level?

1/2

### Subject: C++ Programming

Write a C++ program that takes a matrix called X [2,3]= {{1,-2,1},{4,7,3}}, finds its transpose and the product of the matrix with its transpose.

#include <iostream> using namespace std; int main() { int x[2][3]={{1,-2,1},{4,7,3}}; int y[3][2]; for(int i=0;i<2;i++) { for(int j=0;j<3;j++) { y[j][i]=x[i][j]; } } for(int i=0;i<3;i++) { for(int j=0;j<2;j++) { cout<<y[i][j]<<'\t'; } cout<<endl; } cout<<"\nz equals: \n"; int z [3][3]={0}; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { for (int k=0;k<2;k++) { z[i][j]+=y[i][k]*x[k][j]; } } } for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { cout<<z[j][i]<<'\t'; } cout<<endl; } return 0; }

## Contact tutor

needs and Motaz will reply soon.