Questions
1) What is the minimum value of random samples generated by the following MATLAB code?: 5*(2*rand-1)...

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...

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

Jasmine and her husband are considering trading up their home by selling their current house and...

  1. Jasmine and her husband are considering trading up their home by selling their current house and buying a new house at a price of $250,000. They plan to sell their current house for $120,000 and use the money for a down payment. They will take out a mortgage to cover the remaining balance. The interest rate for such a mortgage amortized over a 20-year period is 7.75%, compounded monthly. (Note that the Canadian mortgages are calculated differently than other types of loans. Here we will treat it like a loan. If you take Fin2360, you will see how to make adjustments for the Canadian mortgage law).
    1. What will Jasmine’s monthly mortgage loan payment be?
    2. What will be the total interest that Jasmine and her husband will pay over the 20-year life of the loan?
    3. How much of her 1st payment is towards interest, and how much is applied against the principal of the mortgage loan?
    4. Use Excel to construct an amortization table for the first 3 payments, and print out the table with your name and ID.   You can also do this by hand.
    5. How much does she still owe after making five years of payment?
    6. How much of the 61st payment is towards interest, and how much is applied against the principal of the mortgage loan?

In: Finance

Jasmine and her husband are considering trading up their home by selling their current house and...

  1. Jasmine and her husband are considering trading up their home by selling their current house and buying a new house at a price of $250,000. They plan to sell their current house for $120,000 and use the money for a down payment. They will take out a mortgage to cover the remaining balance. The interest rate for such a mortgage amortized over a 20-year period is 7.75%, compounded monthly. (Note that the Canadian mortgages are calculated differently than other types of loans. Here we will treat it like a loan. If you take Fin2360, you will see how to make adjustments for the Canadian mortgage law).
    1. What will Jasmine’s monthly mortgage loan payment be?
    2. What will be the total interest that Jasmine and her husband will pay over the 20-year life of the loan?
    3. How much of her 1st payment is towards interest, and how much is applied against the principal of the mortgage loan?
    4. Use Excel to construct an amortization table for the first 3 payments, and print out the table with your name and ID.   You can also do this by hand.
    5. How much does she still owe after making five years of payment?
    6. How much of the 61st payment is towards interest, and how much is applied against the principal of the mortgage loan?

In: Accounting

Write a C program to implement Jacobi iterative method for sovling a system of linear equations....

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 file

In: Computer Science

According to the editor of Beautiful Bride magazine, Betty Bridegroom, the average age of a groom...

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...

  1. 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%...

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)....

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

Two firms produce a homogeneous product with an inverse market demand given by P = 100...

  1. Two firms produce a homogeneous product with an inverse market demand given by P = 100 – 2Q, where Q = q1+q2. The first firm has a cost function given by C1=12q1and the second firm has a cost function given by C2=20q2. The firms make simultaneous output choices to maximize profit. Determine the equilibrium values of firm outputs, market output, price, and firm profits.
  2. With reference to question 1, now assume that decision-making is sequential with firm 1 choosing its output first (leader) and firm 2 choosing second (follower). Determine the equilibrium values of firm outputs, market output, price, and firm profit levels.
  3. In the above question, there is clearly an advantage to the firm that chooses first. How should we measure the value of the first-mover advantage? Calculate this value for the first firm relative to values in question 1.
  4. Return to the situation in question 1. Suppose demand increases by 100 units at each price. Solve for the equilibrium values of firm outputs, market output, price and firm profits.

In: Economics