Required information For four independent projects, the investment limit is $350, and the following project selection restriction applies: project 2 can be selected only if project 3 is selected.
| Project | Initial Investment, $ |
| 1 | 250 |
| 2 | 150 |
| 3 | 75 |
| 4 | 235 |
1) Determine all the acceptable mutually exclusive bundles from the following.
2) Determine all the nonacceptable mutually exclusive bundles from the following.
In: Economics
5 students attending an exam. Let Si be the event of student i passes an exam. S1 and S2 may or may not be independent of each other. Let random variable X be total number of students who pass the exam. P(S1) = P(S2) = 2/3. X = 0, 1, 2, 3, 4, 5.
1) E(X)
2) What is the min and max of var(X)
In: Statistics and Probability
Problem Title : Magical Cave
Lili, a great magician, has a mission to enter a cave to get treasure inside. The cave only has 1 path without branches. But the cave is not safe because there are some traps inside that can reduce Lili’s life points. But in addition to traps, the cave also has potions that can increase Lili’s life points. Before entering the cave, Lili casts magic that can reveal all the traps and potions inside the cave. But before entering the cave, Lili must prepare her life points first because in the cave because Lili cannot use her magic to add life points or destroy the traps. What is the minimum life point that Lili must prepare so that her life point is always positive during the trip inside the cave.
Note: if Lili's point drops to 0 or negative before entering and during the trip inside the cave, then Lili is declared dead.
Format Input
There are T test cases. Each testcase contains an integer N which represents the length of the cave. On the next line there are N numbers represents the value of trap and potion. Traps are marked with numbers that are negative and potions are marked with numbers that are positive.
Format Output
Output T line with format “Case #X: ”, where X represents the testcase number and Y represents the initial life points that Lili has to prepare.
Constraints
Sample Input & Output (standard input & output)
2
5
1 2 -3 4 -5
Case #1: 2
5
-1 -1 -1 -2 9
Case #2: 6
Explanation
In case 1, the minimum life points that Lili must prepare is 2.
With a simulation like the following.
At position 1, Lili’s life point increased by 1 to 3.
At position 2, Lili’s life point increased by 2 to 5.
At position 3, Lili’s life point is reduced by 3 to 2.
At position 4, Lili’s life point increased to 4 to 6.
At position 5, Lili’s life point is reduced by 5 to 1.
In each position Lili’s life points are Positive so the
answer is Valid. if the initial life
prepared by Lili is 1, then Lili will die in fifth position with a
life point of 0.
In: Computer Science
This is Using MATLAB:
I am trying to store the solution of this matrix because I want to do something with the result like find the norm of that answer however I am stuck and cannot seem to be able to. Help would be appreciated!
---------------------------------------------
MATLAB CODE:
close all
clear
clc
A = [1 -1 2 -1;
2 -2 2 -3;
1 1 1 0;
1 -1 4 5];
b = [-8 -20 -2 4]';
x = gauss_elim(A,b)
function x = gauss_elim(A, b)
[nrow, ~] = size(A);
nb = length(b);
x = zeros(1,nrow);
% Gaussian elimination
for i = 1:nrow-1
if A(i,i) == 0
t = min(find(A(i+1:nrow,i) ~= 0) + i);
if isempty(t)
disp ('Error: A matrix is singular');
return
end
temp = A(i,:); tb = b(i);
A(i,:) = A(t,:); b(i) = b(t);
A(t,:) = temp; b(t) = tb;
end
for j = i+1:nrow
m = -A(j,i) / A(i,i);
A(j,i) = 0;
A(j,i+1:nrow) = A(j,i+1:nrow) + m*A(i,i+1:nrow);
b(j) = b(j) + m*b(i);
end
end
% Back substitution
x(nrow) = b(nrow) / A(nrow,nrow);
fprintf('\n\nHas exact solution:\n')
for i = nrow-1:-1:1
x(i) = (b(i) - sum(x(i+1:nrow) .* A(i,i+1:nrow))) / A(i,i);
end
end
In: Advanced Math
Performance Lawn Equipment (PLE)
PLE, headquartered in St. Louis, Missouri, is a privately-owned designer and producer of traditional lawn mowers used by homeowners. Annual sales are approximately $180 million. Both end users and institutions (organizations) are important customers for PLE. This case is ONLY about organizations (such as retail outlets) that buy from PLE. There are two type of organizations that are PLE customers: (1) dealerships or retail stores that in-turn sell to end-customers, and (2) organizations that buy products to use in their operations (such as golf courses or professional lawn care businesses). A purchasing manager in such organizations makes the decisions about which brand of lawn mowers to buy and how many to buy.
Elizabeth Burke has recently joined the PLE management team to oversee production operations. She has asked you to analyze results of a survey of purchasing managers in PLE’s institutional customers.
The worksheet Purchasing Survey in the Performance Lawn Care database provides data obtained from a survey of purchasing managers of institutional customers. Respondents rated PLE on the following seven attributes:
Delivery speed-the amount of time it takes to deliver the product once an order is confirmed
Price level-the perceived level of price charged by PLE
Price flexibility-the perceived willingness of PLE representatives to negotiate price on all types of purchases
Manufacturing image-the overall image of the manufacturer
Overall service-the overall level of Service necessary for maintaining a satisfactory relationship between PLE and the purchaser
Sales force image—the overall image of the PLE’s Sales force
Product quality-perceived level of quality
Responses to these Seven Variables were obtained using a graphic rating Scale, where a 10-centimeter line was drawn between endpoints labeled "poor and 'excellent." Respondents indicated their perceptions using a mark on the line, which was measured from the left endpoint. The result was a scale from 0 to 10 rounded to One decimal place.
Two measures were obtained that reflected the outcomes of the respondent's purchase relationships with PLE:
Usage level-how much of the firm's total product is purchased from PLE, measured on a 100-point Scale, ranging from 0% to 100%
Satisfaction level-how satisfied the purchaser is with past purchases from PLE, measured on the same graphic rating scale as perceptions 1 through 7
The data also include four characteristics of the responding firms:
Size of firm-size relative to others in this market (O = Small; 1 = large)
Purchasing structure-the purchasing method used in a particular company (1 = centralized procurement, 0 = decentralized procurement)
Industry-the industry classification of the purchaser l = retail (stores that resell to end consumers such as Home Depot), 0 = private (nonresale, Such as a profession lawn care business)
Buying type-a Variable that has three categories (1 = new purchase, 2 = modified rebuy, 3 = Straight rebuy)
Elizabeth Burke would like to understand what she learned from this data.
Cluster Analysis:
Apply cluster analysis to analyze the data to create a segmentation of institutional customers. For example, can PLE segment customers into groups with similar perceptions about the company? Do not use “Usage level” or “Satisfaction level” in making the clusters. Check to see if the clusters differ on usage level and satisfaction or not. Which clusters have high usage and satisfaction and which ones do not? Suggest actions management can take to increase usage and satisfaction for the different clusters.
Regression Analysis:
Can regression models provide insight about the drivers of satisfaction and usage level? What are the most important variables that need to be influenced to increase satisfaction and usage level? Suggest ways management can do so.
Summarize your results in a report to Ms. Burke.
| Purchasing Survey | ||||||||||||
| Delivery speed | Price level | Price flexibility | Manufacturing image | Overall service | Salesforce image | Product quality | Usage Level | Satisfaction Level | Size of firm | Purchasing Structure | Industry | Buying Type |
| 4.1 | 0.6 | 6.9 | 4.7 | 2.4 | 2.3 | 5.2 | 32 | 4.2 | 0 | 0 | 1 | 1 |
| 1.8 | 3 | 6.3 | 6.6 | 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| 4.2 | 3.3 | 1.4 | 5.8 | 39 | 5.5 | 0 | 0 | 0 | 2 |
| 3.1 | 4.2 | 5.1 | 7.8 | 3.6 | 4 | 5.9 | 43 | 5.2 | 0 | 1 | 1 | 2 |
| 1.9 | 2.7 | 5 | 4.9 | 2.2 | 2.5 | 8.2 | 36 | 3.6 | 1 | 1 | 0 | 1 |
| 4 | 0.5 | 6.7 | 4.5 | 2.2 | 2.1 | 5 | 31 | 4 | 0 | 0 | 1 | 1 |
| 0.6 | 1.6 | 6.4 | 5 | 0.7 | 2.1 | 8.4 | 25 | 3.4 | 1 | 1 | 1 | 1 |
| 6.1 | 0.5 | 9.2 | 4.8 | 3.3 | 2.8 | 7.1 | 60 | 5.2 | 0 | 0 | 1 | 3 |
| 2 | 2.8 | 5.2 | 5 | 2.4 | 2.7 | 8.4 | 38 | 3.7 | 1 | 1 | 0 | 1 |
| 3.1 | 2.2 | 6.7 | 6.8 | 2.6 | 2.9 | 8.4 | 42 | 4.3 | 1 | 1 | 0 | 1 |
| 2.5 | 1.8 | 9 | 5 | 2.2 | 3 | 6 | 33 | 4.4 | 0 | 0 | 0 | 1 |
In: Statistics and Probability
Question 1 (1 point)
Saved
Accountants are permitted to perform audit and non-audit work for publicly traded companies.
Question 1 options:
| A) True | |
| B) False |
Question 2 (1 point)
Saving...
An accountant’s duty of care is established by a standard of care, knowledge and judgment generally accepted by members of the accounting profession.
Question 2 options:
| A) True | |
| B) False |
Question 3 (1 point)
Saved
A contract for the sale of goods also includes services.
Question 3 options:
| A) True | |
| B) False |
Question 4 (1 point)
Saved
Which of the following is not required to have a valid contract for the sale of goods?
Question 4 options:
|
|||
|
|||
|
|||
|
|||
|
Question 5 (1 point)
Saved
There are two primary types of warranties, express and implied.
Question 5 options:
| A) True | |
| B) False |
In: Operations Management
A.) myNums is an array of 50 elements of type int and k is an int variable. For which one we get the index of out of bounds?
|
a. |
for (k = 0; k <= 49; k++) cout << myNums[k] << " "; |
|
b. |
for (k = 1; k < 50; k++) cout << myNums[k] << " "; |
|
c. |
for (k = 0; k <= 50; k++) cout << myNums[k] << " "; |
|
d. |
for (k = 0; k <= 48; k++) cout << myNums[k] << " "; |
B.)
if we have int myNums[4] = {10, 20, 30, 40};. Which one is equivalent to this statement?
|
a. |
int myNums[] = {10, 20, 30, 40}; |
|
b. |
int myNums[] = {10 20 30 40}; |
|
c. |
int myNums[4] = [10, 20, 30, 40]; |
|
d. |
int myNums[] = (10, 20, 30, 40); |
C.)
The C-string cityName[30] can contain ________.
A) thirty characters
B) thirty one characters
C) twenty nine characters and the null terminator
D) thirty characters and the null terminator
E) None of the above
D.)
What is the output of the following C++ code?
int nums[5] = {0, 5, 10, 15, 20};
int j;
for (j = 1; j <= 4; j++)
cout << nums[j] << " ";
cout << endl;
|
a. |
0 5 10 15 |
c. |
5 10 15 20 |
|
b. |
10 15 20 0 |
d. |
Code results in index out-of-bounds |
D.)
What is the output of the following C++ code?
int nums[5] = {2, 4, 6, 8, 10};
int j;
for (j = 3; j >= 0; j--)
cout << nums[j] << " ";
cout << endl;
|
a. |
4 6 8 10 |
c. |
6 4 2 0 |
|
b. |
3 2 1 0 |
d. |
8 6 4 2 |
In: Computer Science
In: Chemistry
main() module
Display "Welcome to my Guess the number program!"
while true
display_menu()
Get input
if(option==1)
user_guess()
elif(option==2)
computer_guess()
else
break
user_guess() module
random mynumber
count=1
userGuesses=[]
while True
try
Display "Guess a number between 1 and 10"
Get guess
while guess<1 or guess>10
Display "Guess a number between 1 and 10"
Get guess
except
Display "numbers only"
continue
userGuesses.append(guess)
if (guess<mynumber)
Display "Too low"
count=count+1
else if (guess>mynumber)
Display "Too high"
count=count+1
else if (guess==mynumber)
Display "You guessed it in "+ count + " attempts"
Display "you picked the following numbers: " +userGuesses
computer_guess() module
Get number from user
count=1
computerGuesses=[]
while True
Get randomval from computer
computerGuesses.append(randomval)
if (number<randomval)
Display "Too low"
count=count+1
else if (number>randomval)
Display "Too high"
count=count+1
else if (number==randomval)
Display "The computer guessed it in "+ count + " attempts. The number was "+randomval
Display "The computer guessed the following numbers "+computerGuesses
else
break
When you run the program you should see the following:
Welcome to my Guess the number program!
What is your choice: 1
Please guess a number between 1 and 10: 5
Too high
Please guess a number between 1 and 10: 4
Too high
Please guess a number between 1 and 10: 3
Too high
Please guess a number between 1 and 10: 2
Too high
Please guess a number between 1 and 10: 1
You guessed it! It took you 5 attempts
You picked the following numbers: [5, 4, 3, 2, 1]
What is your choice: 2
Please enter a number between 1 and 10 for the computer to guess: 5
The computer guessed 8 which is too high
The computer guessed 7 which is too high
The computer guessed 4 which is too low
The computer guessed 7 which is too high
The computer guessed 4 which is too low
The computer guessed 7 which is too high
The computer guessed 2 which is too low
The computer guessed 1 which is too low
The computer guessed 7 which is too high
The computer guessed 6 which is too high
The computer guessed 3 which is too low
The computer guessed it! It took 12 attempts
The computer guessed the following numbers: [8, 7, 4, 7, 4, 7, 2, 1, 7, 6, 3, 5]
What is your choice: 3
Thank you for playing the guess the number game!
Be sure to submit your assignment
Don't forget this code so your program will start and call the main() function when you run it.
if __name__ == "__main__":
main();
Python Programming!
In: Computer Science
40 individuals were surveyed and asked the following question: How many days a week do you typically exercise? The table below shows the responses. Use the following table to answer the questions below.
|
Names |
How many times a week do you typically exercise? |
|
1 |
6 |
|
2 |
5 |
|
3 |
6 |
|
4 |
4.5 |
|
5 |
5 |
|
6 |
6 |
|
7 |
5 |
|
8 |
3 |
|
9 |
6 |
|
10 |
4 |
|
11 |
5 |
|
12 |
6 |
|
13 |
4 |
|
14 |
6 |
|
15 |
6 |
|
16 |
3 |
|
17 |
3 |
|
18 |
5 |
|
19 |
5 |
|
20 |
6 |
|
21 |
3 |
|
22 |
3 |
|
23 |
5 |
|
24 |
6 |
|
25 |
6 |
|
26 |
5 |
|
27 |
5 |
|
28 |
5 |
|
29 |
5 |
|
30 |
5 |
|
31 |
8 |
|
32 |
5 |
|
33 |
5 |
|
34 |
6 |
|
35 |
4 |
|
36 |
5 |
|
37 |
3 |
|
38 |
3 |
|
39 |
4 |
|
40 |
4 |
1. Calculate the average and standard deviation of the responses.
Average = ________
Standard Deviation = ________
2. Calculate the appropriate SE based on the number of individuals who responded and #1 above. SHOW THE CALCULATION.
3. Calculate a 90% confidence interval for the average value of the table above. SHOW ALL CALCULATIONS.
4. Interpret the full meaning of the confidence interval you have in #3. Remember to include all four components to an interpretation.
In: Statistics and Probability