1) What is the minimum value of random samples generated by the following MATLAB code?: 5*(2*rand-1)
2) What is the mean value of random samples generated by the following MATLAB code?: 3*randn-2
3) What is the mean value of random samples generated by the following MATLAB code?: 5*(2*rand-1)
In: Electrical Engineering
A construction crane collapsed while working on a new building for Metro City. A pedestrian was killed. The husband of the victim is suing Metro City and the construction company. The city attorney, in consultation the city’s liability insurer and the construction company, has offered two out-of-court settlements to the husband of the victim. Here are the settlement options
Option 1: Four annual payments of $225,000 with the first payment one year from today.
Option 2: Five Payments of $200,000 with the payments one year, three years, five years, seven years, and nine years from today.
Assuming a 6% discount rate, which settlement option is the best from the perspective of Metro City?
In: Finance
In: Finance
In: Accounting
Write a C program to implement Jacobi iterative method for sovling a system of linear equations. Use the skeleton code.
skeleton code:
/*
CS288 HOMEWORK 8
Your program will take in two command-line parameters: n and error
command: jacobi 5 0.0001
command: jacobi 10 0.000001
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <math.h>
#define N 100
#define MAX_ITER 10000
int jacobi();
void init();
int convergence();
void srand();
void print_vector();
void print_equation();
float a[N][N], b[N];
float x[N], buf[N];
int n;
float error;
int main(int argc, char **argv){
int n_iter; /* number of iterations */
n = atoi(argv[1]);
error = atof(argv[2]);
init(); /* initalize a, x0 and b - DO not change */
n_iter = jacobi();
return 0;
}
int jacobi(){
int i,j,k;
float sum;
// ...
// ...
// ...
return k;
}
// returns 1 if converged else 0
int convergence(int iter){
int i,j,k,flag=1;
// ...
// ...
// ...
return flag;
}
// Try not to change this. Use it as is.
void init(char **argv){
int i,j,k,flag=0;
float sum;
int seed = time(0) % 100; /* seconds since 1/1/1970 */
srand(seed);
for (i=0;i<n;i++) {
for (j=0;j<n;j++) {
a[i][j] = rand() & 0x7;
if (rand() & 0x1) a[i][j] = -a[i][j];
}
sum = 0;
for (j=0;j<n;j++) if(i!=j) sum = sum + abs(a[i][j]);
if (a[i][i] < sum) a[i][i] = sum + a[i][i];
}
for (i=0;i<n;i++) x[i]=1;
srand(seed);
for (i=0;i<n;i++){
b[i]=rand() & 0x7;
if (rand() & 0x1) b[i] = -b[i];
}
print_equation();
}
void print_equation(){
int i,j;
printf("A*x=b\n");
for (i=0;i<n;i++) {
for (j=0;j<n;j++) printf("%2d ",(int)(a[i][j]));
printf(" * x%d = %d\n",i,(int)(b[i]));
}
printf("\n");
}
void print_vector(float *l){
int i;
for (i=0; i<n; i++) printf("%.6f ",l[i]);
printf("\n");
}
// end of fileIn: Computer Science
According to the editor of Beautiful Bride magazine, Betty Bridegroom, the average age of a groom is now 26.2 years (µ = 26.2). A sample of 16 prospective grooms (n = 16) in Chicago revealed that their average age was 28.2 years (X = 28.2) with a standard deviation of 5.3 years (s = 5.3). Is there enough evidence to claim that the Chicago groom’s age is greater than the age reported by Betty?
Conduct a hypothesis test, use the traditional method to solve this problem using α = 0.01.
Make sure you provide all 5 steps of your hypothesis test.
In: Statistics and Probability
Suppose that 1 US$ = 1.5 South African Rand. Also, suppose that the representative good, peanut butter, is $3 per jar in the US and 4 Rand per jar in SA. How will this situation affect the exchange market for U.S. dollars? Explain/show the effect(s) of these prices. Include the initial effect(s), the market adjustment(s), and the final result(s) on equilibrium. (9 pts.)
In: Economics
you own a 15 - year 100 par bond. The coupon rate is an annual 9% payable annually. The price of the bond is 95.50
D. Calculate the approximate change in price of the bond if the yield rate increas by 0.5% using First Order Macaulay Approximation
E. Calculate the approximate change in price of the bond if the yield rate increase by 0.5% using First Order Modified Approximation
F. Calculate the exact change in price of the bond
In: Finance
Please program in C++
Create two classes, HUSBAND (Family Member 1) and WIFE (Family Member 2). Make WIFE as friend class of HUSBAND. The structure of classes are given below.
class WIFE;
class HUSBAND
{
private:
string Husband_fname;
string Husband_lname;
int Husband_income;
public:
HUSBAND(string f1, string l1, int inc):Husband_fname(f1), Husband_lname(l1), Husband_income(inc);
HUSBAND();
{
// Default initializations of data members
}
int getIncome();
};
class WIFE
{
private:
string Wife_fname;
string Wife_lname;
int Wife_income;
int tax_rate;
public:
WIFE(string f2, string l2, int inc, int tr) ;
WIFE()
{
//Default initializations of private data members;
}
float calcTax(HUSBAND &f);
float getTaxRate();
int getIncome();
};
int main()
{
HUSBAND obj1("Albert","John",55026);
WIFE obj2("Mary","Chin",120000,5);
//Task1: Display the tax rate;
// Task2: Display income of HUSBAND;
// Task3: Display income of WIFE;
// Task4: Display total family income;
// Task5: Display total Tax Amount;
system("pause");
return 0;
}
In: Computer Science
In: Economics