JAVA
/**
* posOfLargestElementLtOeT returns the position of the
largest element in the
* array that is less than or equal to the limit
parameter if all values are
* greater than limit, return -1;
*
* Precondition: the array is nonempty and all elements
are unique. Your
* solution must go through the array exactly
once.
*
* <pre>
* 0 == posOfLargestElementLtOeT(3, new double[] { -7
}) // value:-7 is in pos 0
* 5 == posOfLargestElementLtOeT(3, new double[] { 11,
-4, -7, 7, 8, 1 }), // value:1 is in pos 5
* -1 == posOfLargestElementLtOeT(-7, new double[] { 1,
-4, -5, 7, 8, 11 }), // all elements are > -7
*
* The code below is a stub version, you should replace
the line of code
* labeled TODO with code that achieves the above
specification
* </pre>
*/
public static int posOfLargestElementLtOeT(double
limit, double[] list) {
return -2; // TODO 2: fix this
code
}
In: Computer Science
Two stocks has the following year-end stock prices and dividends:
| Stock 1 | Stock 2 | |||
| Year | Price | Dividend | Price | Dividend |
| 1 | $70 | $150 | ||
| 2 | $75 | $1 | $163 | $2 |
| 3 | $74 | $1 | $156 | $2 |
| 4 | $80 | $2 | $173 | $1 |
Which stock has a higher annual average capital gain yield over the four years? Which stock has a higher average dividend yield?If T-bill rate is 2.0 percent, which stock has a higher average nominal risk premium based on the annual average total return?What are the two primary lessons learned from capital market history? Provide evidence
Thanks
In: Finance
Trace the following code segment
1. use the red numbers under each statement to show the order that you execute the code by.
For example: (1) means int p=3; (2) means p<10; (3) means p+=3;
(1)(2)(3) means you execute int p=3 then p<10 then P+=3;
(2)(1)(3) means you execute p<10 then int p =3 then P+=3;
2. show its output
for (int p = 3 ; p <10; p += 3 )
(1) (2) (3)
{
for ( int m = 3 ; m < 6 ; m++)
(4) (5) (6)
cout<< (p * m) << “ “;
(7)
cout << “$” << endl;
(8)
}
In: Computer Science
Drew works at Baseball Inc., a seller of high-quality baseballs. He is interested in forecasting demand for his baseballs that are sold weekly to University of Miami using exponential smoothing.
Assume an initial forecast of 175 and the demand data below:
|
Week |
Demand |
Forecast |
|
1 |
180 |
175 |
|
2 |
168 |
|
|
3 |
159 |
|
|
4 |
175 |
You want to use simple exponential smoothing. In case 1 you take alpha = 0.7 and in case 2 you take alpha = 0.3. Which of the following has an acceptable tracking signal, i.e., model does not need to be re-evaluated?
Answer Options:
In: Operations Management
In: Statistics and Probability
Prove or disprove the statements: (a) If x is a real number such that |x + 2| + |x| ≤ 1, then x 2 + 2x − 1 ≤ 2.
(b) If x is a real number such that |x + 2| + |x| ≤ 2, then x 2 + 2x − 1 ≤ 2.
(c) If x is a real number such that |x + 2| + |x| ≤ 3, then x 2 + 2x − 1 ≤ 2.
(d) If x is a real number such that |x + 2| + |x| ≤ 5, then x 2 + 2x − 1 ≤ 2.
(2) Prove or disprove the statements: (a) If z is a complex number such that |z + 1| + |z − 1| ≤ 3, then |z 2 − 1| ≤ 2.
(b) If z is a complex number such that if |z 2 − 1| ≤ 2, then |z + 1| + |z − 1| ≤ 3.
(3) A clock with a face that has the numbers 1 through 12 has three hands that indicate the second, minute and hour of the day.
Assume that the center of the clock is at position (0, 0), and at noon the end points of the hands are (respectively) at (0, 1), (0, 3/4), (0, 1/2).
(a) Give the position of the end points of each of the hands at time t where t represents the number of seconds after noon in both polar and rectangular coordinates (make sure that you label which you are using clearly).
(b) At what times do your equations say that the hands of the clock will all align?
In: Advanced Math
Imagine a basketball player named Shack. He is getting old, doesn’t run too well and has always been a poor free-throw shooter. He decides to work on the last of these as follows:Five times per day for the next 80 days he will shoot four free throws and count thenumber of successes that he achieves.Thus, Shack will collect n = 400 numerical values, with each value being one of: 0, 1, 2, 3 or 4.Shack wants to use the Goodness of Fit Test to test whether these 400 values behave as if they come from a binomial distribution. Note p is unknown.His O’s are below.Outcome01234Oi251181399325(1)State the null hypothesis and alternative hypothesis. (2)Estimateπ.(3)Fill the following table and carry out a multinomial 2test with =0.05 BY HAND. Remember to state your conclusions.
Outcome 0 1 2 3 4
Oi 25 118 139 93 25
Pi
Ei
Oi-Ei
(Oi-Ei)2
(Oi-Ei)2/Ei
In: Math
The table below gives the list price and the number of bids received for five randomly selected items sold through online auctions. Using this data, consider the equation of the regression line, yˆ=b0+b1x, for predicting the number of bids an item will receive based on the list price. Keep in mind, the correlation coefficient may or may not be statistically significant for the data given. Remember, in practice, it would not be appropriate to use the regression line to make a prediction if the correlation coefficient is not statistically significant.
Price in Dollars Number of Bids
27 1
28 2
31 4
35 5
42 6
Summation Table
| x | y | xy | x2 | y2 | |
|---|---|---|---|---|---|
| Sum | 163 | 18 | 634 | 5463 | 82 |
| Bid 1 | 27 | 1 | 27 | 729 | 11 |
| Bid 2 | 28 | 2 | 56 | 784 | 44 |
| Bid 3 | 31 | 4 | 124 | 961 | 16 |
| Bid 4 | 35 | 5 | 175 | 1225 | 25 |
| Bid 5 | 42 | 66 | 252 | 1764 | 36 |
Step 1 of 6:
Find the estimated slope. Round your answer to three decimal places.
Step 2 of 6:
Find the estimated y-intercept. Round your answer to three decimal places.
Step 3 of 6:
Substitute the values you found in steps 1 and 2 into the equation for the regression line to find the estimated linear model. According to this model, if the value of the independent variable is increased by one unit, then find the change in the dependent variable yˆy^.
Step 4 of 6:
Determine if the statement "Not all points predicted by the linear model fall on the same line" is true or false.
Step 5 of 6:
Determine the value of the dependent variable yˆy^ at x=0.
Step 6 of 6:
Find the value of the coefficient of determination. Round your answer to three decimal places.
In: Statistics and Probability
The trading possibilities for two nations, Portugal and Italy are given below. Assume that prior to specialization and trade Italy is at position C and Portugal is at position C.
A B C D E F
Italy Loaves 30 24 18 10 6 0
Fishes 0 6 12 18 24 30
A B C D E F
Portugal Loaves 10 8 6 4 2 0
Fishes 0 4 8 12 18 20 Before specialization, the cost ratio, loaves per fishes in Italy is
| 18 loaves = 12 fishes |
| 0 loaves = 0 fishes |
| 1 loaf = 1 fish |
| 1 loaves = 2 fishes |
Flag this Question
Question 423 pts
A B C D E F
Italy Loaves 30 24 18 10 6 0
Fishes 0 6 12 18 24 30
A B C D E F
Portugal Loaves 10 8 6 4 2 0
Fishes 0 4 8 12 18 20
Before specialization, the cost ratio, loaves per fishes in Portugal is
| 1 loaf = 2 fishes |
| 2 loaves = 1 fish |
| 0 loaves = 0 fishes |
| 6 loaves = 8 fishes |
Flag this Question
Question 433 pts
Italy should specialize in.
| Both loaves and fishes |
| fishes |
| loaves |
| nothing |
Flag this Question
Question 443 pts
Portugal should specialize in
| both loaves and fishes |
| loaves |
| fishes |
| nothing |
Flag this Question
Question 453 pts
After specialization the gains to the world will gain
| zero loaves and zero fishes |
| 0 loaves and 6 fishes |
| 6 loaves and 0 fishes |
| 18 loaves and 6 fishes |
In: Economics
A real estate developer wishes to study the relationship between the size of home a client will purchase (in square feet) and other variables. Possible independent variables include the family income, family size, whether there is a senior adult parent living with the family (1 for yes, 0 for no), and the total years of education beyond high school for the husband and wife. The sample information is reported below.
| Family | Square Feet | Income (000s) | Family Size | Senior Parent | Education | ||||||
| 1 | 2,240 | 60.8 | 2 | 0 | 4 | ||||||
| 2 | 2,380 | 68.4 | 2 | 1 | 6 | ||||||
| 3 | 3,640 | 104.5 | 3 | 0 | 7 | ||||||
| 4 | 3,360 | 89.3 | 4 | 1 | 0 | ||||||
| 5 | 3,080 | 72.2 | 4 | 0 | 2 | ||||||
| 6 | 2,940 | 114 | 3 | 1 | 10 | ||||||
| 7 | 4,480 | 125.4 | 6 | 0 | 6 | ||||||
| 8 | 2,520 | 83.6 | 3 | 0 | 8 | ||||||
| 9 | 4,200 | 133 | 5 | 0 | 2 | ||||||
| 10 | 2,800 | 95 | 3 | 0 | 6 | ||||||
Click here for the Excel Data File
In: Statistics and Probability