Questions
Suppose that six cards are selected at random from a standard 52-card deck, what is the...

Suppose that six cards are selected at random from a standard 52-card deck, what is the probability that two of the selected cards are less than 5 and neither of them is black and two cards are greater than 10 neither of them is red, and the last two cards are any cards?

In: Statistics and Probability

The owner of Maumee Ford-Volvo wants to study the relationship between the age of a car...

The owner of Maumee Ford-Volvo wants to study the relationship between the age of a car and its selling price. Listed below is a random sample of 12 used cars sold at the dealership during the last year.

Car Age (years) Selling Price ($000)
1 11 12.1
2 8 10.5
3 14 5.7
4 17 4.9
5 9 5.0
6 8 13.4
7 10 10.5
8 14 9.0
9 13 9.0
10 17 4.5
11 6 12.5
12 6 11.5

1-Determine the regression equation.

a=

b=

2- Estimate the selling price of an 7-year-old car (in $000).

3-Interpret the regression equation (in dollars).

In: Statistics and Probability

Given any positive integer n, the hailstone sequence starting at n is obtained as follows. You...

Given any positive integer n, the hailstone sequence starting at n is obtained as follows. You write a sequence of numbers, one after another. Start by writing n. If n is even, then the next number is n/2. If n is odd, then the next number is 3n + 1. Continue in this way until you write the number 1.

For example, if you start at 7, then the next number is 22 (3 × 7 + 1). The next number after 22 is 11.

  • The hailstone sequence starting at 7 is [7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1] and its length is 17.

  • The hailstone sequence starting at 6 is [6, 3, 10, 5, 16, 8, 4, 2, 1] and its length is 9.

  • The hailstone sequence starting at 1 is [1] and its length is 1.

The Assignment

Write and test a C++ program that reads a number n from the standard input (after giving a suitable prompt) and then writes the following information on the standard output:

  1. the entire hailstone sequence starting at n, all on one line, with the numbers separated by spaces;

  2. the length of the hailstone sequence that starts with n;

  3. the largest number in the hailstone sequence that starts with n;

  4. an indication of whether the hailstone sequence that starts with n contains a number that is greater than 1000.

  5. the length of the longest hailstone sequence that starts with a number from 1 to n;

  6. the starting number of the longest hailstone sequence that starts with a number from 1 to n;

  7. the largest number that occurs in any hailstone sequence that starts with a number from 1 to n.

  8. the start value, from 1 to n, of the hailstone sequence that contains largest number reported in the previous step.

For this program, use loops. Do not use recursion. Use type int for all of the integers. Do not use any of

  • arrays.
  • call-by-reference,
  • any features of the C++ Standard Template Library,
  • default parameters,
  • global or static variables

The main function must not contain any loops. You can use the <cstdio>, <iostream> and <algorithm> libraries for this assignment.

The output needs to be sensible and easy to read, not just numbers. It must follow the general template below, with all numeric results lined up (approximately) vertically. Each part of the output should be on a separate line. Parts in black are written by the program.

  What number shall I start with?  7
  The hailstone sequence starting at 7 is:
  7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1
  Sequence length:                                      17
  Largest number:                                       52
  Contains a number >1000?                              no
  Greatest length starting with 1 to 7:                 17
  Start value of sequence of length 17:                  7
  Largest value in a sequence starting with 1 to 7:     52
  Start value of sequence containing 52:                 7

In: Computer Science

For c++, please do not recycle other peoples code as they do not satisfy the requirements....

For c++, please do not recycle other peoples code as they do not satisfy the requirements.

Write a program for sorting a list of integers in ascending order using the bubble sort algorithm.

Requirements
Implement the following functions:

  1. Implement a function called readData
    int readData( int *arr)
    arr is a pointer for storing the integers. The function returns the number of integers.
    The function readData reads the list of integers from a file call data.txt into the array arr. The first integer number in the file is the number of intergers. After the first number, the file lists the integers line by line.
  2. void bsort(int *arr, int last)
    arr is a pointer to an array of integers to be sorted. last is the number of elements in the array. The function bsort sorts the list of integers in ascending order.
  3. writeToConsole(int * arr, int last)
    arr is a pointer to an array of integers. last is the number of elements in the array. The function writeToConsole displays the sorted list.
  4. Do not use the array notation in your solution.

Here is the content of the file data.txt.
9
8
4
7
2
9
5
6
1
3

Then reimpelment a function called bubble_sort that has the following prototype.

bubble_sort(int *array, int size, pointer to a function)
Pre condition
array - a pointer to an array of size element.
pointer to function - a pointer to a function that compares two values (depending on sorting in ascending order or descending order)
Post condition
Sort the array in ascending or descending based on the the pointer to a function.

Write the main function to perform the following:

  • Dynamic input array of n integer elements
  • Call the function bubble_sort to sort the array in ascending
  • Display the sorting array.
  • Call the function bubble_sort to sort the array in descending
  • Display the sorting array.

In: Computer Science

How do i change the vector v to size 20 in C++. Also given the following,...

How do i change the vector v to size 20 in C++.

Also given the following, which line of code stores 40 into the 4th column of the 6th row of array dataVals?

const int rows = 7;
const int cols = 5;
int dataVals[rows][cols];

Select one:

a. dataVals[5, 3] = 40;

b. dataVals[5 * 3] = 40;

c. dataVals[3][5] = 40;

d. dataVals[5][3] = 40;

In: Computer Science

You are the manager of a 40 head broodmare farm. The mare’s average weight is 1,000...

You are the manager of a 40 head broodmare farm. The mare’s average weight is 1,000 lbs. ➢ You know the mares in early lactation require: 28.3 Mcal DE, 3 lbs Crude protein, 50 g Ca, 34 g P. ➢ You go to the local feed store and purchase a feed that sells of $8.50/50 lb bag. ➢ The nutrient make up of the feed is: 13.5% CP, 0.5% Ca, and 0.44% P. By the fiber content you estimate the DE to be around 1.3 Mcal/lb. ➢ You feed 1% bwt in grass hay (7% CP, 0.8 Mcal DE/lb, 0.4% Ca, 0.2% P) A. How much of the commercial feed must you feed to meet the mares’ requirements (per head, per day)? 21.76 B. If the hay costs $40/ton, what is the monthly cost to feed these 40 mares, in early lactation (grain cost is given above)? a. Hay b. Grain c. Total

In: Physics

HOMEWORK 1 This assignment is designed to illustrate how a software package such as Microsoft Excel...

HOMEWORK 1

This assignment is designed to illustrate how a software package such as Microsoft Excel supplemented by an add-in such as PHStat can enable one to calculate minimum sample sizes necessary in order to construct confidence intervals for both population means and proportions and to construct these types of confidence intervals. You should use PHStat in order to accomplish all parts of this assignment. You should not only find the required information, but you should explain the meanings of your results for each problem and part of each problem in the context of the problem. You also should provide business implications of the results at which you arrive for one part of either problems two and three and for problem five.

Scenario of the Problem:

  1. You have been asked by a certain political party to study the mean age of the supporters of a certain candidate who is running for public office in an upcoming election. A random sample of those who have demonstrated their support for the candidate will be chosen in order to accomplish the desired study. In order to provide estimates of the population mean age of the supporters of this candidate, what minimum sample sizes will be necessary under the following conditions?                          
  1. The estimate desired will need to be computed with 98% confidence to within ±2 years when it is felt that the population standard deviation in the ages of the supporters of the candidate is 7.5 years.            
  2. The estimate desired will now need to be computed with 95% confidence to within ±2 years when the population standard deviation is 7.5 years.                                                                          
  3. The estimate desired will now need to be computed with 98% confidence to within ±2 years when the population standard deviation is 6 years.                                                                              
  4. The estimate desired will now need to be computed with 98% confidence to within ±3 years when the population standard deviation is 7.5 years.                                                                          

In your memo, be sure to comment on the differences found in the calculation of the minimum sample sizes in the various parts of the above problem. Explain why differences in your answers exist. In doing so, make all comparisons relative to the answer found in the first part of the problem.                                                                                        

  1. You now need to construct a confidence interval for the mean age of the supporters of the candidate. You select a random sample of 80 identified supporters of the candidate. You find that their mean age is 44.57 years. You believe that the population standard deviation of the ages of the supporters of the candidate is 7.5 years. Construct both 98% and 95% confidence intervals for the mean age of the supporters of the candidate. In your explanation, comment upon the effect of the change in confidence level on the width of your interval.
  1. You no longer believe that the population standard deviation in the ages of the supporters of the candidate is a known quantity. You therefore will use the sample standard deviation of the ages of the supporters as an estimate of this unknown population standard deviation. You collect data from a random sample of supporters of the candidate. The data identifies the ages of a sample of the supporters of the candidate. This data is shown in appendix one below. Construct both 98% and 95% confidence intervals for the mean age of the supporters of the candidate for this situation. At each confidence level, comment upon the change in the results of this problem from the results of the previous problem.

            Appendix One: (Age of Supporters)

            40        32        60        58        22        28        66        70        71        55        59        58        62        44        89        48        56        33        46            39        39        44        32        48        49        50        51        18        28        23        34        54        28        76        35        77        38        21            59        51        54        38        45        39        19        90        37        46        22        26        27        39        30        45        27       

  1. You also need to estimate the population proportion of supporters of the candidate that are usually loyal supporters of the political party that this candidate represents based upon their attesting to this fact and their previous voting record. What minimum sample sizes will be necessary in order to estimate the desired population proportion under the following conditions?
  1. The estimate is desired to within ±8% with 98% confidence when the population proportion of supporters of the party is thought to equal 80%.
  2. The estimate is desired to within ±8% with 98% confidence when the population proportion of supporters of the party is unknown.
  3. The estimate is desired to within ±8% with 98% confidence when the population proportion of supporters of the party is thought to equal 95%.

Comment on the changes in the minimum sample sizes you have computed based upon the changes in the information given in the three parts of this problem.

  1. You now need to estimate with 98% confidence the population proportion of supporters of the candidate that describes itself as loyal to the political party represented by the candidate. You randomly sample the population of supporters of the candidate and ascertain whether each one has been a loyal party supporter. The results of that sampling process are shown in appendix two below. Using this information, construct the required confidence interval.

Appendix Two: (Loyal Party Supporter? (Y = yes, N = no))

Y         Y         Y         Y         N         N         Y         Y         Y         Y         N

Y         N         Y         Y         Y         Y         Y         Y         Y         N         Y

N         Y         Y         Y         Y         Y         Y         Y         Y         Y         Y

Y         Y         N         N         N         Y         Y         Y         Y         Y         Y        

Y         Y         Y         Y         Y         Y         N         Y         N         N         Y        

N         Y         Y         Y         Y         Y         Y         Y         Y         N         Y

Y         Y         Y         N         Y         Y         Y         Y         Y         Y         N

N         Y         Y         Y         Y         Y         Y         Y         Y         Y         Y  

In: Math

HOMEWORK 1 This assignment is designed to illustrate how a software package such as Microsoft Excel...

HOMEWORK 1

This assignment is designed to illustrate how a software package such as Microsoft Excel supplemented by an add-in such as PHStat can enable one to calculate minimum sample sizes necessary in order to construct confidence intervals for both population means and proportions and to construct these types of confidence intervals. You should use PHStat in order to accomplish all parts of this assignment. You should not only find the required information, but you should explain the meanings of your results for each problem and part of each problem in the context of the problem. You also should provide business implications of the results at which you arrive for one part of either problems two and three and for problem five.

Scenario of the Problem:

  1. You have been asked by a certain political party to study the mean age of the supporters of a certain candidate who is running for public office in an upcoming election. A random sample of those who have demonstrated their support for the candidate will be chosen in order to accomplish the desired study. In order to provide estimates of the population mean age of the supporters of this candidate, what minimum sample sizes will be necessary under the following conditions?                          
  1. The estimate desired will need to be computed with 98% confidence to within ±2 years when it is felt that the population standard deviation in the ages of the supporters of the candidate is 7.5 years.            
  2. The estimate desired will now need to be computed with 95% confidence to within ±2 years when the population standard deviation is 7.5 years.                                                                          
  3. The estimate desired will now need to be computed with 98% confidence to within ±2 years when the population standard deviation is 6 years.                                                                              
  4. The estimate desired will now need to be computed with 98% confidence to within ±3 years when the population standard deviation is 7.5 years.                                                                          

In your memo, be sure to comment on the differences found in the calculation of the minimum sample sizes in the various parts of the above problem. Explain why differences in your answers exist. In doing so, make all comparisons relative to the answer found in the first part of the problem.                                                                                        

  1. You now need to construct a confidence interval for the mean age of the supporters of the candidate. You select a random sample of 80 identified supporters of the candidate. You find that their mean age is 44.57 years. You believe that the population standard deviation of the ages of the supporters of the candidate is 7.5 years. Construct both 98% and 95% confidence intervals for the mean age of the supporters of the candidate. In your explanation, comment upon the effect of the change in confidence level on the width of your interval.
  1. You no longer believe that the population standard deviation in the ages of the supporters of the candidate is a known quantity. You therefore will use the sample standard deviation of the ages of the supporters as an estimate of this unknown population standard deviation. You collect data from a random sample of supporters of the candidate. The data identifies the ages of a sample of the supporters of the candidate. This data is shown in appendix one below. Construct both 98% and 95% confidence intervals for the mean age of the supporters of the candidate for this situation. At each confidence level, comment upon the change in the results of this problem from the results of the previous problem.

            Appendix One: (Age of Supporters)

            40        32        60        58        22        28        66        70        71        55        59        58        62        44        89        48        56        33        46            39        39        44        32        48        49        50        51        18        28        23        34        54        28        76        35        77        38        21            59        51        54        38        45        39        19        90        37        46        22        26        27        39        30        45        27       

  1. You also need to estimate the population proportion of supporters of the candidate that are usually loyal supporters of the political party that this candidate represents based upon their attesting to this fact and their previous voting record. What minimum sample sizes will be necessary in order to estimate the desired population proportion under the following conditions?

  1. The estimate is desired to within ±8% with 98% confidence when the population proportion of supporters of the party is thought to equal 80%.
  2. The estimate is desired to within ±8% with 98% confidence when the population proportion of supporters of the party is unknown.
  3. The estimate is desired to within ±8% with 98% confidence when the population proportion of supporters of the party is thought to equal 95%.

Comment on the changes in the minimum sample sizes you have computed based upon the changes in the information given in the three parts of this problem.

  1. You now need to estimate with 98% confidence the population proportion of supporters of the candidate that describes itself as loyal to the political party represented by the candidate. You randomly sample the population of supporters of the candidate and ascertain whether each one has been a loyal party supporter. The results of that sampling process are shown in appendix two below. Using this information, construct the required confidence interval.

Appendix Two: (Loyal Party Supporter? (Y = yes, N = no))

Y         Y         Y         Y         N         N         Y         Y         Y         Y         N

Y         N         Y         Y         Y         Y         Y         Y         Y         N         Y

N         Y         Y         Y         Y         Y         Y         Y         Y         Y         Y

Y         Y         N         N         N         Y         Y         Y         Y         Y         Y        

Y         Y         Y         Y         Y         Y         N         Y         N         N         Y        

N         Y         Y         Y         Y         Y         Y         Y         Y         N         Y

Y         Y         Y         N         Y         Y         Y         Y         Y         Y         N

N         Y         Y         Y         Y         Y         Y         Y         Y         Y         Y        

In: Math

Consider a two year 6% coupon bond that sells at a discount rate of 7% APR....

Consider a two year 6% coupon bond that sells at a discount rate of 7% APR. At what price should the bond sell?

In: Finance

Two charges, q1 = 5 μC and q2 = 7 μC, are separated by 25 cm....

Two charges, q1 = 5 μC and q2 = 7 μC, are separated by 25 cm. Where should a third charge be placed on the line between them such that the resultant force on it will be zero? Does it matter if the third charge is positive or negative?

In: Physics