According to Harper's Index, 40% of all federal inmates are serving time for drug dealing. A random sample of 16 federal inmates is selected.
(a) What is the probability that 11 or more are serving time for drug dealing? (Round your answer to three decimal places.)
(b) What is the probability that 5 or fewer are serving time for drug dealing? (Round your answer to three decimal places.)
(c) What is the expected number of inmates serving time for drug dealing? (Round your answer to one decimal place.)
In: Math
he number of chocolate chips in an 18-ounce bag of chocolate chip cookies is approximately normally distributed with a mean of 1252 chips and standard deviation 129 chips.
(a) What is the probability that a randomly selected bag contains between 1100 and 1400 chocolate chips, inclusive?
(b) What is the probability that a randomly selected bag contains fewer than 1025 chocolate chips?
(c) What proportion of bags contains more than 1200 chocolate chips?
(d) What is the percentile rank of a bag that contains 1050 chocolate chips?
In: Math
According to Harper's Index, 50% of all federal inmates are serving time for drug dealing. A random sample of 15 federal inmates is selected.
(a) What is the probability that 10 or more are serving time for
drug dealing? (Round your answer to three decimal places.)
(b) What is the probability that 6 or fewer are serving time for
drug dealing? (Round your answer to three decimal places.)
(c) What is the expected number of inmates serving time for drug
dealing? (Round your answer to one decimal place.)
In: Math
During the last 10 hours a total of 23 patients arrived at an emergency clinic with one doctor. The average time for the doctor to examine a patient is 21.5 minutes.
Please provide the answer as:
In: Operations Management
3. From 2000-2019 there were a total of 3071 earthquakes worldwide with a magnitude of 6 or greater, or an average of about 0.42 such earthquakes per day.* Assume that moving forward the total number of such earthquakes to occur over any time period follows a Poisson distribution with an average of 0.42 earthquakes per day. For the remainder of this question, “earthquake” will mean an earthquake with a magnitude of 6 or greater. Define a new random variable as necessary in each part of this question.
(a) What is the probability that there are no earthquakes during a single day?
(b) What is the probability that there are at least three earthquakes during a single week?
FUN FACT: When the number of events over any time interval follow a Poisson distribution, the time between any two events follows an exponential distribution with a mean equal to the reciprocal of the mean for the Poisson distribution. Therefore the time between two earthquakes follows an exponential distribution with an average of about 2.38 days. Answer the following three questions using the exponential distribution.
(c) What is the probability that the time between two earthquakes will be less than three days?
(d) If an earthquake just occurred, what is the probability that the time until the next earthquake will be more than 12 hours but less than 24 hours? (e) What is the median time between two earthquakes?
*https://www.usgs.gov/natural-hazards/earthquake-hazards/lists-maps-and-statistics
In: Statistics and Probability
Here is a simple probability model for multiple-choice tests. Suppose that each student has probability p of correctly answering a question chosen at random from a universe of possible questions. (A strong student has a higher p than a weak student.) The correctness of answers to different questions are independent. Jodi is a good student for whom p = 0.83. (a) Use the Normal approximation to find the probability that Jodi scores 79% or lower on a 100-question test. (Round your answer to four decimal places.) (b) If the test contains 250 questions, what is the probability that Jodi will score 79% or lower? (Use the normal approximation. Round your answer to four decimal places.) (c) How many questions must the test contain in order to reduce the standard deviation of Jodi's proportion of correct answers to half its value for a 100-item test? questions (d) Laura is a weaker student for whom p = 0.78. Does the answer you gave in (c) for standard deviation of Jodi's score apply to Laura's standard deviation also? Yes, the smaller p for Laura has no effect on the relationship between the number of questions and the standard deviation. No, the smaller p for Laura alters the relationship between the number of questions and the standard deviation. Please at least circle the correct answer and answer all the questions. Thanl you.
In: Statistics and Probability
The following table shows the percentage of on-time arrivals, the number of mishandled baggage reports per 1,000 passengers, and the number of customer complaints per 1,000 passengers for 10 airlines.
| Airline | On-Time
Arrivals (%) |
Mishandled
Baggage per 1,000 Passengers |
Customer
Complaints per 1,000 Passengers |
|---|---|---|---|
| Airline 1 | 83.3 | 0.79 | 1.50 |
| Airline 2 | 79.1 | 1.91 | 0.80 |
| Airline 3 | 86.9 | 1.64 | 0.95 |
| Airline 4 | 86.5 | 2.13 | 0.76 |
| Airline 5 | 87.2 | 3.04 | 0.47 |
| Airline 6 | 78.2 | 2.21 | 1.11 |
| Airline 7 | 83.1 | 3.18 | 0.23 |
| Airline 8 | 85.7 | 2.19 | 1.70 |
| Airline 9 | 77.1 | 2.89 | 1.77 |
| Airline 10 | 77.2 | 3.79 | 4.29 |
(a)
If you randomly choose an Airline 4 flight, what is the probability that this individual flight has an on-time arrival?
(b)
If you randomly choose one of the 10 airlines for a follow-up study on airline quality ratings, what is the probability that you will choose an airline with less than two mishandled baggage reports per 1,000 passengers?
(c)
If you randomly choose 1 of the 10 airlines for a follow-up study on airline quality ratings, what is the probability that you will choose an airline with more than one customer complaint per 1,000 passengers?
(d)
What is the probability that a randomly selected Airline 3 flight will not arrive on time?
In: Math
You may need to use the appropriate appendix table to answer this question.
Alexa is the popular virtual assistant developed by Amazon. Alexa interacts with users using artificial intelligence and voice recognition. It can be used to perform daily tasks such as making to-do lists, reporting the news and weather, and interacting with other smart devices in the home. In 2018, the Amazon Alexa app was downloaded some 2,800 times per day from the Google Play store.† Assume that the number of downloads per day of the Amazon Alexa app is normally distributed with a mean of 2,800 and standard deviation of 860.
(a)
What is the probability there are 2,100 or fewer downloads of Amazon Alexa in a day? (Round your answer to four decimal places.)
(b)
What is the probability there are between 1,400 and 2,600 downloads of Amazon Alexa in a day? (Round your answer to four decimal places.)
(c)
What is the probability there are more than 3,100 downloads of Amazon Alexa in a day? (Round your answer to four decimal places.)
(d)
Suppose that Google has designed its servers so there is probability 0.02 that the number of Amazon Alexa app downloads in a day exceeds the servers' capacity and more servers have to be brought online. How many Amazon Alexa app downloads per day are Google's servers designed to handle? (Round your answer to the nearest integer.)
downloads per day
In: Math
Recall that the population average of the heights in the file "pop1.csv" is μ = 170.035. Using simulations we found that the probability of the sample average of the height falling within 1 centimeter of the population average is approximately equal to 0.626. From the simulations we also got that the standard deviation of the sample average is (approximately) equal to 1.122. In the next 3 questions you are asked to apply the Normal approximation to the distribution of the sample average using this information. The answer may be rounded up to 3 decimal places of the actual value:
1- Using the Normal approximation, the probability that sample average of the heights falls within 1 centimeter of the population average is _________
2- Using the Normal approximation we get that the central region that contains 95% of the distribution of the sample average is of the form 170.035 ± z · 1.122. The value of z is ________
3- Using the Normal approximation, the probability that sample average of the heights is less than 168 is ______
4- According to the Internal Revenue Service, the average length of time for an individual to complete (record keep, learn, prepare, copy, assemble and send) IRS Form 1040 is 10.53 hours (without any attached schedules). The distribution is unknown. Let us assume that the standard deviation is 2 hours. Suppose we randomly sample 36 taxpayers and compute their average time to completing the forms. Then the probability that the average is more than 11 hours is approximately equal to (The answer may be rounded up to 3 decimal places of the actual value.)
_____________
Suppose that a category of world class runners are known to run a marathon (26 miles) in an expectation of 145 minutes with a standard deviation of 14 minutes. Consider 49 of the races. In the next 3 questions you are asked to apply the Normal approximation to the distribution of the sample average using this information. The answer may be rounded up to 3 decimal places of the actual value:
5- The probability that the runner will average between 142 and 146 minutes in these 49 marathons is ______
6- The 0.80-percentile for the average of these 49 marathons is_____
7- The median of the average running time is_____
8- The time to wait for a particular rural bus is distributed uniformly from 0 to 75 minutes. 100 riders are randomly sampled and their waiting times are measured. The 90th percentile of the average waiting time (in minutes) for a sample of 100 riders is (approximately):
Select one:
a. 315.0
b. 40.3
c. 38.5
d. 65.2
______________
A switching board receives a random number of phone calls. The expected number of calls is 5.3 per minute. Assume that the distribution of the number of calls is Poisson. The average number of calls per minute is recorded by counting the total number of calls received in one hour, divided by 60, the number of minutes in an hour. In the next 4 questions you are asked to apply the Normal approximation to the distribution of the sample average using this information. The answer may be rounded up to 3 decimal places of the actual value:
9- The expectation of the average is____
10- The standard deviation of the average is____
11- The probability that the average is less than 5 _____
12- The probability that number of calls in a random minute is less than 5 is _____ (Note, the question is with respect to a random minute, and not the average.)
______________
It is claimed that the expected length of time some computer part may work before requiring a reboot is 2 months. In order to examine this claim 80 identical parts are set to work. Assume that the distribution of the length of time the part can work (in months) is Exponential. In the next 4 questions you are asked to apply the Normal approximation to the distribution of the average of the 80 parts that are examined. The answer may be rounded up to 3 decimal places of the actual value:
13- The expectation of the average is______
14- The standard deviation of the average is_____
15- The central region that contains 90% of the distribution of the average is of the form E(X) ± c, where E(X) is the expectation of the sample average. The value of c is ______
16- The probability that the average is more than 2.5 months is ______
In: Statistics and Probability
Author code
/**
* LinkedList class implements a doubly-linked list.
*/
public class MyLinkedList<AnyType> implements Iterable<AnyType>
{
/**
* Construct an empty LinkedList.
*/
public MyLinkedList( )
{
doClear( );
}
private void clear( )
{
doClear( );
}
/**
* Change the size of this collection to zero.
*/
public void doClear( )
{
beginMarker = new Node<>( null, null, null );
endMarker = new Node<>( null, beginMarker, null );
beginMarker.next = endMarker;
theSize = 0;
modCount++;
}
/**
* Returns the number of items in this collection.
* @return the number of items in this collection.
*/
public int size( )
{
return theSize;
}
public boolean isEmpty( )
{
return size( ) == 0;
}
/**
* Adds an item to this collection, at the end.
* @param x any object.
* @return true.
*/
public boolean add( AnyType x )
{
add( size( ), x );
return true;
}
/**
* Adds an item to this collection, at specified position.
* Items at or after that position are slid one position higher.
* @param x any object.
* @param idx position to add at.
* @throws IndexOutOfBoundsException if idx is not between 0 and size(), inclusive.
*/
public void add( int idx, AnyType x )
{
addBefore( getNode( idx, 0, size( ) ), x );
}
/**
* Adds an item to this collection, at specified position p.
* Items at or after that position are slid one position higher.
* @param p Node to add before.
* @param x any object.
* @throws IndexOutOfBoundsException if idx is not between 0 and size(), inclusive.
*/
private void addBefore( Node<AnyType> p, AnyType x )
{
Node<AnyType> newNode = new Node<>( x, p.prev, p );
newNode.prev.next = newNode;
p.prev = newNode;
theSize++;
modCount++;
}
/**
* Returns the item at position idx.
* @param idx the index to search in.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public AnyType get( int idx )
{
return getNode( idx ).data;
}
/**
* Changes the item at position idx.
* @param idx the index to change.
* @param newVal the new value.
* @return the old value.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public AnyType set( int idx, AnyType newVal )
{
Node<AnyType> p = getNode( idx );
AnyType oldVal = p.data;
p.data = newVal;
return oldVal;
}
/**
* Gets the Node at position idx, which must range from 0 to size( ) - 1.
* @param idx index to search at.
* @return internal node corresponding to idx.
* @throws IndexOutOfBoundsException if idx is not between 0 and size( ) - 1, inclusive.
*/
private Node<AnyType> getNode( int idx )
{
return getNode( idx, 0, size( ) - 1 );
}
/**
* Gets the Node at position idx, which must range from lower to upper.
* @param idx index to search at.
* @param lower lowest valid index.
* @param upper highest valid index.
* @return internal node corresponding to idx.
* @throws IndexOutOfBoundsException if idx is not between lower and upper, inclusive.
*/
private Node<AnyType> getNode( int idx, int lower, int upper )
{
Node<AnyType> p;
if( idx < lower || idx > upper )
throw new IndexOutOfBoundsException( "getNode index: " + idx + "; size: " + size( ) );
if( idx < size( ) / 2 )
{
p = beginMarker.next;
for( int i = 0; i < idx; i++ )
p = p.next;
}
else
{
p = endMarker;
for( int i = size( ); i > idx; i-- )
p = p.prev;
}
return p;
}
/**
* Removes an item from this collection.
* @param idx the index of the object.
* @return the item was removed from the collection.
*/
public AnyType remove( int idx )
{
return remove( getNode( idx ) );
}
/**
* Removes the object contained in Node p.
* @param p the Node containing the object.
* @return the item was removed from the collection.
*/
private AnyType remove( Node<AnyType> p )
{
p.next.prev = p.prev;
p.prev.next = p.next;
theSize--;
modCount++;
return p.data;
}
/**
* Returns a String representation of this collection.
*/
public String toString( )
{
StringBuilder sb = new StringBuilder( "[ " );
for( AnyType x : this )
sb.append( x + " " );
sb.append( "]" );
return new String( sb );
}
/**
* Obtains an Iterator object used to traverse the collection.
* @return an iterator positioned prior to the first element.
*/
public java.util.Iterator<AnyType> iterator( )
{
return new LinkedListIterator( );
}
/**
* This is the implementation of the LinkedListIterator.
* It maintains a notion of a current position and of
* course the implicit reference to the MyLinkedList.
*/
private class LinkedListIterator implements java.util.Iterator<AnyType>
{
private Node<AnyType> current = beginMarker.next;
private int expectedModCount = modCount;
private boolean okToRemove = false;
public boolean hasNext( )
{
return current != endMarker;
}
public AnyType next( )
{
if( modCount != expectedModCount )
throw new java.util.ConcurrentModificationException( );
if( !hasNext( ) )
throw new java.util.NoSuchElementException( );
AnyType nextItem = current.data;
current = current.next;
okToRemove = true;
return nextItem;
}
public void remove( )
{
if( modCount != expectedModCount )
throw new java.util.ConcurrentModificationException( );
if( !okToRemove )
throw new IllegalStateException( );
MyLinkedList.this.remove( current.prev );
expectedModCount++;
okToRemove = false;
}
}
/**
* This is the doubly-linked list node.
*/
private static class Node<AnyType>
{
public Node( AnyType d, Node<AnyType> p, Node<AnyType> n )
{
data = d; prev = p; next = n;
}
public AnyType data;
public Node<AnyType> prev;
public Node<AnyType> next;
}
private int theSize;
private int modCount = 0;
private Node<AnyType> beginMarker;
private Node<AnyType> endMarker;
}
class TestLinkedList
{
public static void main( String [ ] args )
{
MyLinkedList<Integer> lst = new MyLinkedList<>( );
for( int i = 0; i < 10; i++ )
lst.add( i );
for( int i = 20; i < 30; i++ )
lst.add( 0, i );
lst.remove( 0 );
lst.remove( lst.size( ) - 1 );
System.out.println( lst );
java.util.Iterator<Integer> itr = lst.iterator( );
while( itr.hasNext( ) )
{
itr.next( );
itr.remove( );
System.out.println( lst );
}
}
}
In this project you will add methods to an existing linked list class.
Description:
Modify the author's "MyLinkedList" class to add the following methods.
Perform checking of the parameters and throw exceptions where appropriate.
10 points each (a-h)
a. itemCount
receives a value and returns a count of the number of times this item
is found in the list.
b. swap
receives two index positions as parameters and swaps the two nodes
(the nodes, not just the values inside) at these positions, provided
both positions are within the current size.
c. sublist
receives two indexes and returns an ArrayList of node values from the first
index to the second index, provided the indexes are valid.
d. select
receives a variable number of indexes, and returns an ArrayList of node values
corresponding to each index given, provided the indexes are valid.
e. reverse
returns a new MyLinkedList that has the elements in reverse order.
f. erase
receives an index position and number of elements as parameters, and
removes elements beginning at the index position for the number of
elements specified, provided the index position is within the size
and together with the number of elements does not exceed the size.
g. insertList
receives a List and an index position as parameters, and copies all of the
passed list into the existing list at the position specified by the parameter,
provided the index position does not exceed the size.
h. shift
receives an integer and shifts the list this many nodes forward or backward,
for example, if passed 2, the first two nodes move to the tail, or if
passed -3, the last three nodes move to the front.
+2: abcde -> cdeab -3: abcde -> cdeab
20 points
i. main
change the main method to demonstrate each of your methods.
Submit to eLearning:
MyLinkedList.java
In: Computer Science