For this lab, you will write a C++ program that will calculate the
matrix inverse of a matrix no bigger than 10x10. I will guarantee
that the matrix will be invertible and that you will not have a
divide by 0 problem.
For this program, you are required to use the modified Gaussian
elimination algorithm. Your program should ask for the size (number
of rows only) of a matrix. It will then read the matrix, calculate
the inverse, and print the inverse, and quit. I do not care if you
use two separate matrices one for the original and one for the
inverse or if you combine the two. Note: the matrix should be a
float, and you will need to use the cmath round function to get the
output below.
Sample Run:
./a.out input row size 3 input the matrix to invert -1 2 -3 2 1 0 4 -2 5 the inverse is: -5 4 -3 10 -7 6 8 -6 5
In: Computer Science
For this lab, you will write a C++ program that will calculate
the matrix inverse of a matrix no bigger than 10x10. I will
guarantee that the matrix will be invertible and that you will not
have a divide by 0 problem.
For this program, you are required to use the modified Gaussian
elimination algorithm. Your program should ask for the size (number
of rows only) of a matrix. It will then read the matrix, calculate
the inverse, and print the inverse, and quit. I do not care if you
use two separate matrices one for the original and one for the
inverse or if you combine the two. Note: the matrix should be a
float, and you will need to use the cmath round function to get the
output below.
Sample Run:
./a.out input row size 3 input the matrix to invert -1 2 -3 2 1 0 4 -2 5 the inverse is: -5 4 -3 10 -7 6 8 -6 5
In: Computer Science
List and explain the seven (7) ways MNE’s handle employee relations.
In: Operations Management
In: Nursing
. Dice rolling: In c++Write a program that simulates the rolling of two dice. The sum of the two values should then be calculated. [Note: Each die can show an integer value from 1 to 6, so the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums.] The following table shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000,000 times. Use a onedimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also determine if the totals are reasonable (i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7).
In: Computer Science
|
Randomly Chosen Cash Withdrawals ($) |
|||||
|
Friday |
Monday |
||||
|
250 |
10 |
10 |
40 |
30 |
10 |
|
20 |
10 |
30 |
100 |
70 |
370 |
|
110 |
20 |
10 |
20 |
20 |
10 |
|
40 |
20 |
40 |
30 |
50 |
30 |
|
70 |
10 |
10 |
200 |
20 |
40 |
|
20 |
20 |
400 |
20 |
30 |
20 |
|
10 |
20 |
10 |
10 |
20 |
100 |
|
50 |
20 |
10 |
30 |
40 |
20 |
|
100 |
20 |
20 |
50 |
10 |
20 |
|
20 |
60 |
70 |
60 |
10 |
20 |
In: Statistics and Probability
Many standard statistical methods that you will study in Part II of this book are intended for use with distributions that are symmetric and have no outliers. These methods start with the mean and standard deviation, x and s. For example, standard methods would typically be used for the IQ and GPA data here data457.dat.
(a) Find x and s for the IQ data. (Round your answers to two decimal places.)
| x | = |
| s | = |
(b) Find the median IQ score. It is, as we expect, close to the
mean.
(c) Find the mean and median for the GPA data. The two measures of
center differ a bit. (Round your answers to two decimal
places.)
| mean | = |
| median | = |
What feature of the data (make a stemplot or histogram to see)
explains the difference?
obs gpa iq gender concept 1 10.38 111 2 67 2 3.53 101 2 43 3 9.37 96 2 52 4 8.83 117 2 66 5 9.06 109 1 58 6 10.41 104 2 51 7 9.04 127 2 71 8 4.45 119 2 51 9 9.66 67 1 49 10 9.43 104 2 51 11 8.49 132 1 35 12 10.93 70 1 54 13 9.96 104 2 54 14 8.19 131 1 64 15 7.17 93 1 56 16 10.53 83 1 69 17 6.39 115 1 55 18 7.67 88 1 65 19 4.75 63 2 40 20 6.64 106 1 66 21 8.27 88 2 55 22 5.21 75 2 20 24 7.47 91 1 56 26 9.05 70 2 68 27 8.99 103 1 69 28 6.76 80 2 70 29 6.72 107 2 80 30 10.69 112 2 53 31 7.49 103 2 65 32 9.35 125 1 67 33 9.49 80 1 62 34 9.49 112 1 39 35 8.94 84 2 71 36 10.75 100 2 59 37 8.96 85 1 60 38 8.35 106 2 64 39 9.78 109 2 71 40 7.72 84 1 72 41 10.98 83 1 54 43 10.75 111 2 64 44 8.06 98 2 58 45 10.25 87 2 70 46 7.43 119 2 72 47 10.06 114 2 70 48 7.05 77 2 47 50 6.53 113 2 52 51 7.17 89 1 46 52 6.8 113 2 66 53 5.67 68 2 67 54 7.84 137 2 63 55 8.68 98 2 53 56 8.9 123 2 67 57 10.41 111 2 61 58 9.62 96 1 54 59 8.77 99 1 60 60 10.72 95 1 60 61 3.49 105 2 63 62 10.02 92 2 30 63 4.01 97 2 54 64 7.52 94 2 66 65 4.12 94 2 44 68 9.06 113 2 49 69 10.23 94 1 44 71 10.57 89 2 67 72 4.4 83 1 64 74 9.99 107 2 73 76 10.17 122 2 59 77 9.64 113 1 37 78 10.54 121 1 63 79 9.88 112 2 36 80 7.32 88 1 64 83 8.3 76 2 42 84 10.92 91 1 28 85 4.48 79 1 60 86 9.93 111 1 70 87 7.77 102 2 51 88 9.19 86 1 21 89 9.87 107 2 56
In: Statistics and Probability
Many standard statistical methods that you will study in Part II of this book are intended for use with distributions that are symmetric and have no outliers. These methods start with the mean and standard deviation, x and s. For example, standard methods would typically be used for the IQ and GPA data here data211.dat.
(a) Find x and s for the IQ data. (Round your answers to two decimal places.)
x =
s =
(b) Find the median IQ score. It is, as we expect, close to the mean.
(c) Find the mean and median for the GPA data. The two measures of center differ a bit. (Round your answers to two decimal places.)
mean =
median =
What feature of the data (make a stemplot or histogram to see) explains the difference?
obs gpa iq gender concept
1 6.78 99 2 67
2 9.48 76 2 43
3 8.94 128 2 52
4 10.76 122 2 66
5 5.84 88 1 58
6 5.51 106 2 51
7 8.23 108 2 71
8 5.25 61 2 51
9 10.28 117 1 49
10 8.71 89 2 51
11 9.8 112 1 35
12 7.57 108 1 54
13 5.85 111 2 54
14 9.94 82 1 64
15 9.22 87 1 56
16 7.47 89 1 69
17 10.18 89 1 55
18 9.45 97 1 65
19 9.97 116 2 40
20 10.37 102 1 66
21 8.37 95 2 55
22 6.31 107 2 20
24 10.9 89 1 56
26 10.82 110 2 68
27 5.8 83 1 69
28 4.69 111 2 70
29 9.06 87 2 80
30 9.71 99 2 53
31 6.46 113 2 65
32 4.16 94 1 67
33 9.18 94 1 62
34 5.09 89 1 39
35 8.4 98 2 71
36 7.24 97 2 59
37 9.34 89 1 60
38 5.97 64 2 64
39 10.26 112 2 71
40 8.94 93 1 72
41 9.11 99 1 54
43 9.72 94 2 64
44 4.64 110 2 58
45 8.57 77 2 70
46 5.45 126 2 72
47 10.07 131 2 70
48 9.63 131 2 47
50 4.83 80 2 52
51 5.61 107 1 46
52 9.53 97 2 66
53 10.11 117 2 67
54 8.54 124 2 63
55 9.36 97 2 53
56 10.6 91 2 67
57 9.75 96 2 61
58 7.82 97 1 54
59 9.02 83 1 60
60 5.45 89 1 60
61 9.25 104 2 63
62 8.82 95 2 30
63 5.71 117 2 54
64 9.37 89 2 66
65 10.8 86 2 44
68 9.67 111 2 49
69 7.97 106 1 44
71 9.12 92 2 67
72 7.68 116 1 64
74 10.07 108 2 73
76 10.45 103 2 59
77 8.22 103 1 37
78 9.57 87 1 63
79 6.84 87 2 36
80 6.51 102 1 64
83 10.11 113 2 42
84 10.6 114 1 28
85 9.14 113 1 60
86 7.18 124 1 70
87 7.91 95 2 51
88 3.89 95 1 21
89 8.24 87 2 56
In: Statistics and Probability
Total revenue for producing 10 units of output is $5. Total revenue for producing 11 units of output is $9. Given this information, the
Average revenue for producing 11 units is $2.
Average revenue for producing 11 units is $4
Marginal revenue for producing the 11th unit is $2.
Marginal revenue for producing the 11th unit is $4.
|
Output |
Total Cost |
|
0 |
40 |
|
1 |
80 |
|
2 |
110 |
|
3 |
130 |
|
4 |
160 |
|
5 |
200 |
|
6 |
250 |
|
7 |
320 |
Refer to the above data. If product price is $30, the firm
will:
A. shut down.
B. produce 4 units and realize a $40 economic profit.
C. produce 6 units and realize a $70 loss.
D. produce 5 units and incur a $60 loss.
In: Economics
PROBLEM: c++ code
You are to write a program to tell you how many months it will take to pay off a loan, as well as the total amount of interest paid over the life of the loan.
You have just purchased a stereo system that costs $1000 on the following credit plan: No down payment, an interest rate of 18% per year (and hence 1.5% per month), and monthly payments of $50. The monthly payment of $50 is used to pay the interest and whatever is left is used to pay part of the remaining debt. Hence, the first month you pay 1.5% of $1000 in interest. That is $15 in interest. So, the remaining $35 is deducted from your debt which leaves you with a debt of $965.00. The next month you pay interest of 1.5% of $965.00, which is $14.48. Hence, you can deduct $35.52 (which is $50 - $14.48) from the amount you owe.
Write a program that will tell you how many months it will take you to pay off the loan, as well as the total amount of interest paid over the life of the loan. Use a loop to calculate the amount of interest and the size of the debt after each month. Put out the monthly amount of interest paid and remaining debt. Use a variable to count the number of loop iterations and hence the number of months until the debt is zero. You may want to use other variables as well.
You are to hand in:
A sample session may run as follows:
Enter the amount of the loan 1000.00
Enter the yearly interest rate 18.0
Enter the monthly amount paid 50.00
Month Principle Interest Principle Remaining
Paid Paid Balance
1 1000.00 15.00 35.00 965.00
2 965.00 14.48 35.52 929.48
3 929.48 13.94 36.06 893.42
.
.
24 47.12 0.71 49.29 -2.17
Number of months to pay of the loan: 24
Total interest paid on loan: 197.83
You have a credit of: -2.17
In: Computer Science