Consider the following time series data:
Month 1 2 3 4 5 6 7
Value 23 15 20 12 18 22 15
| (b) | Develop a three-month moving average for this time series. Compute MSE and a forecast for month 8. |
| If required, round your answers to two decimal places. Do not round intermediate calculation. | |
| MSE: | |
| The forecast for month 8: | |
| (c) | Use α = 0.2 to compute the exponential smoothing values for the time series. Compute MSE and a forecast for month 8. |
| If required, round your answers to two decimal places. Do not round intermediate calculation. | |
| MSE: | |
| The forecast for month 8: | |
| (e) | Use trial and error to find a value of the exponential smoothing coefficient α that results in the smallest MSE. |
| If required, round your answer to two decimal places. | |
| α = |
In: Math
complete java binary search tree
/*
* Complete the printInLevelOrder() method
* Complete the visuallyIdentical(A4BST rhs) method
* No other methods/variables should be added/modified
*/
public class A4BST<E extends Comparable<? super E>>
{
/*
* Grading:
* Correctly prints values in level order - 1.5pt
* Runs in O(N) - 1.5pt
*/
public String printInLevelOrder()
{
String content = "";
/*
* Add items from the tree to
content one level at a time
* No line breaks are required
between levels
* Ensure method runs in O(N) - does
not revisit any node
*/
return content;
}
/*
* Grading:
* Correctly compares the structure of both trees -
3pts
*/
public boolean visuallyIdentical(A4BST rhs)
{
/*
* Check if the structure of the
local tree and the rhs tree are identical
* This means they have the same
left/right connections
* This means there are no extra
connections in either tree
* The values at each position do
not need to match, only the structure of the tree
* Think about if you drew both
trees on paper, would they visually look the same (besides
values)
*/
return false;
}
private Node root;
public A4BST()
{
root = null;
}
public String printTree()
{
return printTree(root);
}
private String printTree(Node current)
{
String content = "";
if(current != null)
{
content +=
"Current:"+current.data.toString();
if(current.left
!= null)
{
content += "; Left
side:"+current.left.data.toString();
}
if(current.right
!= null)
{
content += "; Right
side:"+current.right.data.toString();
}
content+="\n";
content+=printTree(current.left);
content+=printTree(current.right);
}
return content;
}
public String printInOrder()
{
return printInOrder(root);
}
private String printInOrder(Node current)
{
String content = "";
if(current != null)
{
content +=
printInOrder(current.left);
content +=
current.data.toString()+",";
content +=
printInOrder(current.right);
}
return content;
}
public boolean contains(E val)
{
Node result = findNode(val,
root);
if(result != null)
return
true;
else
return
false;
}
private Node findNode(E val, Node current)
{
//base cases
if(current == null)
return
null;
if(current.data.equals(val))
return
current;
//recursive cases
int result =
current.data.compareTo(val);
if(result < 0)
return
findNode(val, current.right);
else
return
findNode(val, current.left);
}
public E findMin()
{
Node result = findMin(root);
if(result == null)
return
null;
else
return
result.data;
}
private Node findMin(Node current)//used in findMin
and delete
{
while(current.left != null)
{
current =
current.left;
}
return current;
}
public E findMax()
{
Node current = root;
while(current.right != null)
{
current =
current.right;
}
return current.data;
}
public void insert(E val)
{
root = insertHelper(val,
root);
}
public Node insertHelper(E val, Node current)
{
if(current == null)
{
return new
Node(val);
}
int result =
current.data.compareTo(val);
if(result < 0)
{
current.right =
insertHelper(val, current.right);
}
else if(result > 0)
{
current.left =
insertHelper(val, current.left);
}
else//update
{
current.data =
val;
}
return current;
}
public void remove(E val)
{
root = removeHelper(val,
root);
}
private Node removeHelper(E val, Node current)
{
if(current.data.equals(val))
{
if(current.left
== null && current.right == null)//no children
{
return null;
}
else
if(current.left != null && current.right != null)//two
children
{
Node result = findMin(current.right);
result.right = removeHelper(result.data,
current.right);
result.left = current.left;
return result;
}
else//one
child
{
return (current.left != null)? current.left :
current.right;
}
}
int result =
current.data.compareTo(val);
if(result < 0)
{
current.right =
removeHelper(val, current.right);
}
else if(result > 0)
{
current.left =
removeHelper(val, current.left);
}
return current;
}
private class Node
{
E data;
Node left, right;
public Node(E d)
{
data = d;
left =
null;
right =
null;
}
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public class A4Driver {
public static void main(String[] args) {
A4BST<Integer> tree1 = new
A4BST<>();
tree1.insert(5);
tree1.insert(3);
tree1.insert(1);
tree1.insert(2);
tree1.insert(9);
tree1.insert(10);
tree1.insert(25);
A4BST<Integer> tree2 = new
A4BST<>();
tree2.insert(8);
tree2.insert(5);
tree2.insert(1);
tree2.insert(3);
tree2.insert(15);
tree2.insert(20);
tree2.insert(25);
A4BST<Integer> tree3 = new
A4BST<>();
tree3.insert(1);
tree3.insert(2);
tree3.insert(3);
tree3.insert(5);
tree3.insert(9);
tree3.insert(10);
tree3.insert(25);
System.out.println(tree1.printInLevelOrder());//5, 3, 9, 1, 10, 2,
25
System.out.println(tree2.printInLevelOrder());//8, 5, 15, 1, 20, 3,
25
System.out.println(tree3.printInLevelOrder());//1, 2, 3, 4, 5, 9,
10, 25
System.out.println(tree1.visuallyIdentical(tree2));//true
System.out.println(tree1.visuallyIdentical(tree3));//false
}
}
In: Computer Science
A student is interested in the sleep quality of students. That student selects a random sample of 21 students (age 19-24 years) from each four undergraduate years (Freshman, Sophomore, Junior and Senior), and applies Pittsburgh Sleep Quality Index (PSQI) and obtains their responses. PSQI includes 19 self-reported items and is designed to evaluate overall sleep quality (Data are presented in Table 1 below). The student is interested in determining whether there is any evidence of a difference in sleep quality across the groups of students representing each of the four different years.
|
Table 1. Sleep quality of undergraduate students |
|||
|
Freshman |
Sophomore |
Junior |
Senior |
|
12 |
14 |
11 |
13 |
|
14 |
18 |
10 |
7 |
|
14 |
10 |
9 |
17 |
|
11 |
3 |
4 |
12 |
|
5 |
6 |
4 |
13 |
|
12 |
4 |
9 |
10 |
|
8 |
7 |
13 |
18 |
|
6 |
9 |
17 |
9 |
|
12 |
9 |
9 |
6 |
|
12 |
8 |
9 |
10 |
|
16 |
11 |
12 |
18 |
|
11 |
8 |
8 |
10 |
|
8 |
7 |
6 |
3 |
|
4 |
13 |
12 |
6 |
|
3 |
11 |
12 |
4 |
|
11 |
12 |
10 |
9 |
|
8 |
16 |
15 |
12 |
|
7 |
8 |
10 |
8 |
|
13 |
7 |
7 |
6 |
|
11 |
8 |
6 |
12 |
|
8 |
3 |
4 |
12 |
In: Statistics and Probability
Assume a computer with a cache that holds 64 bytes and has a block size of 32 bytes. Direct address mapping is used and from the beginning the cache is empty. The following program sequence is executed:
for (col = 0; col < 2; col++) {
for (row = 0; row < 4; row++)
A[row][col] = B[row] * C[col]; }
Assume that for the variables row and col registers are
used.
The matrix A consists of 4 rows and 4 columns with integers (one
word long). A is located in the RAM with start address 0 and is
stored in rows (A [0] [0], A [0] [1], ... ).
Array B consists of 4 integers (one word long). B is located in RAM
with start address 64.
The arrayC consists of 4 integers (one word long). C is located in
RAM with start address 80.
What will be the hit probability for the program sequence? What
will be the hit probability if 2-way set associative address
mapping (with LRU when changing blocks) is used instead of direct
address mapping? Also write explanations of how the calculations
are done and interpret the results. (Note that the outer loop runs
twice and the inner one four times. There will be a total of 24
memory references.)
In: Computer Science
A criminal is sentenced to 3 years in jail for robbing a gas station. Their annual income working at their day job as a dog walker is $21,000. Currently, the annual interest rate in the market is 7%. What is the present value of their lost earnings, due to being incarcerated, rounded to the nearest dollar? Select one: a. $68,081 b. $55,111 c. $65,341 d. $57,261
In: Economics
A 40-year-old male meter technician had just completed a seven-week basic lineman training course. He worked as a meter technician during normal working hours and as a line during unplanned outages. One evening, he was called to repair a power outage at your company. By the time he arrived at the site of the outage, he had already worked two hours of overtime and worked 14 straight hours the day before. At the site, a tree limb had fallen across an overhead power line. The neutral wire in the line was severed and the two energized 120-volt wires were disconnected. The worker removed the tree limb and climbed up a power pole to reconnect the three wires. He was wearing insulated gloves, a hard hat, and safety glasses. He prepared the wires to be connected. While handling the wires, one of the energised wires caught the cuff of his left glove and pulled the cuff down. The conductor contacted the victim's forearm near the wrist. He was electrocuted and fell backwards. Paramedics arrived five minutes after the contact. Firefighters lowered his dead body 30 minutes later. Based on the report, it is vital that this kind of accident should never have happened again. The upper management wants you to create based on the incident that happened, formulate a 10 Step Safety Operating Procedure (SOP) that can cover the element of hazard and mistakes being done. The SOP should have their own justification on why it is needed.
In: Psychology
For all the baseball fans out there: Assuming that two teams are evenly matched in the World Series (a championship series of at most 7 games; the first team to win 4 games wins the Series) so that the probability of each team winning each game is 50%, and assuming each game is independent of each other game, what is the probability that the Series will be won in exactly 4 games? 5? 6? that the Series goes to game 7?
In: Statistics and Probability
Determine the overall heat transfer coefficient (U) in a heat exchanger that uses steam to heat water to the point of vaporization (in vacuum.) The system is non-insulated, so the heat lost to the surroundings must be taken into consideration. While I know that the heat Q = mCdT and the heat transfer rate q = UAdT(Log-mean), I am struggling to equate the two due to the heat lost to the surroundings. How do I go about determining the overall heat transfer coefficient in a system like this?
In: Other
Beth is a second-grader who sells lemonade on a street corner in
your neighborhood. Each cup of lemonade costs Beth $0.90 to
produce; she has no fixed costs. The reservation prices for the 10
people who walk by Beth's lemonade stand each day are listed in the
following table.
| Person | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|
Reservation price |
$1.50 | $1.40 | $1.30 | $1.20 | $1.10 | $1.00 | $0.90 | $0.80 | $0.70 | $0.60 |
Beth knows the distribution of reservation prices (that is, she
knows that one person is willing to pay $1.50, another $1.40, and
so on), but she does not know any specific individual’s reservation
price.
a. Calculate the marginal revenue of selling an additional cup of
lemonade. (Start by figuring out the price Beth would charge if she
produced only one cup of lemonade, and calculate the total revenue;
then find the price Beth would charge if she sold two cups of
lemonade; and so on.)
Instructions: If you are entering any negative
numbers be sure to include a negative sign (-) in front of those
numbers. Enter your responses rounded to two decimal
places.
| Price | Quantity |
Total revenue ($ per day) |
Marginal revenue ($ per cup) |
| 1.50 | 1 | ||
| 1.40 | 2 | ||
| 1.30 | 3 | ||
| 1.20 | 4 | ||
| 1.10 | 5 | ||
| 1.00 | 6 | ||
| 0.90 | 7 | ||
| 0.80 | 8 | ||
| 0.70 | 9 | ||
| 0.60 | 10 |
b. What is Beth’s profit-maximizing price?
Instructions: Enter your response rounded to two
decimal places.
$ .
c. At that price, what are Beth’s economic profit and total
consumer surplus?
Instructions: Enter your responses rounded to two
decimal places.
Economic profit: $ per day.
Consumer surplus: $ per day.
d. What price should Beth charge if she wants to maximize total
economic surplus?
Instructions: Enter your response rounded to two
decimal places.
Price to maximize total economic surplus: $
In: Economics
write an application that inputs a telephone number as a string in the form (555) 555_5555. the application should use string method split to extract the area code as a token. the first three digits of the phone number as a token and the last four digits of the phone number as a token. the seven digits of the phone number should be concatenated into one string. Both the area code and the phone number should be printed. Remember that you'll have to change delimiter characters during the tokenization process.
In: Computer Science