In: Physics
Project 1: Frequent Flyer Miles Calculator
Write a Ruby program that calculates how many frequent flyer
miles are needes for a free ticket on a new startup airline,
CorsairAir. Frequent flyer miles are charged for a free ticket
depending on the class of service (more for first class, less for
coach), depending on the day flying (more if flying on Friday,
Saturday or Monday, less for other days of the week), depending on
the distance traveled, and a surcharge if flying to Canada, Mexico
or the Carribean. Tickets start with a cost of 10,000 frequent
flyer miles. Then, you should calculate the distance charge which
is 1,000 frequent flyer miles for each 250 miles flown. Then, you
should charge an additional 40% charge of frequent flyer miles if
the passenger wants to fly first class. If flying on a Friday,
Saturday or Monday, the ticket will cost an additional 5,000
frequent flyer miles. Travel to Canada, Mexico or the Carribean
needs to cost an additional 7,500 frequent flyer miles. Be sure
your program does not allow for negative miles flown or incorrect
answers to the yes/no questions asked.
The sample program dialogs below should help you to see how to
perform this calculation.
CorsairAir Calculator
How far are your flying:-20
Sorry Charlie!
Continue(y/n)? y
How far are you flying (in
miles):500
Want first class (y/n):y
Flying on a Friday, Saturday or Monday
(y/n):n
Flying to Canada, Mexico or the Carribean
(y/n):n
10000 base cost
2000 distance charge
4800 First class charge
You will need 16800 frequent flyer miles for this ticket. Enjoy
your trip!
Continue(y/n)? y
How far are you flying (in
miles):500
Want first class (y/n):n
Flying on a Friday, Saturday or Monday
(y/n):y
Flying to Canada, Mexico or the Carribean
(y/n):n
10000 base cost
2000 distance charge
5000 day of the week charge
You will need 17000 frequent flyer miles for this ticket. Enjoy
your trip!
Continue(y/n)? y
How far are you flying (in
miles):500
Want first class (y/n):n
Flying on a Friday, Saturday or Monday
(y/n):y
Flying to Canada, Mexico or the Carribean
(y/n):foobar
Sorry Charlie!
Continue(y/n)? y
How far are you flying (in
miles):500
Want first class (y/n):n
Flying on a Friday, Saturday or Monday
(y/n):n
Flying to Canada, Mexico or the Carribean
(y/n):n
10000 base cost
2000 distance charge
You will need 12000 frequent flyer miles for this ticket. Enjoy
your trip!
Continue(y/n)? n
In: Computer Science
Given the monthly returns that follow, find the R2, alpha, and beta of the portfolio. Compute the average return differential with and without sign. Do not round intermediate calculations. Round your answers to two decimal places. Month Portfolio Return S&P 500 Return January 5.3 % 5.5 % February -2.4 -2.9 March -1.8 -1.1 April 2.5 2.0 May 0.9 0.5 June -1.1 -0.5 July 0.2 0.4 August 1.3 1.7 September -0.8 -0.1 October -3.2 -3.8 November 2.8 2.3 December 0.8 0.3
R2:
Alpha: %
Beta:
Average return difference (with signs): %
Average return difference (without signs) %
In: Finance
The following table gives the total area in square miles (land and water) of seven states. Complete parts (a) through (c).
State Area
1 52,300
2 615,400
3 115,000
4 53,600
5 159,500
6 104,800
7 6,100
a. Find the mean area and median area for these states.
The mean is __ square miles.
(Round to the nearest integer as needed.)
The median is ___ square miles.
b. Which state is an outlier on the high end? If you eliminate this state, what are the new mean and median areas for this data set?
State___ is an outlier on the high end.
The new mean is_____square miles.
(Round to the nearest integer as needed.)
The new median is____square miles.
(Round to the nearest integer as needed.)
c. Which state is an outlier on the low end? If you eliminate this state, what are the new mean and median areas for this data set?
State____is an outlier on the low end.
The new mean is_____square miles.
(Round to the nearest integer as needed.)
The new median is_____square miles.
(Round to the nearest integer as needed.)
In: Statistics and Probability
A leasing firm claims that the mean number of miles driven annually, μ, in its leased cars is less than 12700 miles. A random sample of 25 cars leased from this firm had a mean of 12031 annual miles driven. It is known that the population standard deviation of the number of miles driven in cars from this firm is 2800 miles. Assume that the population is normally distributed. Is there support for the firm's claim at the 0.01 level of significance? Perform a one-tailed test. Then fill in the table below. Carry your intermediate computations to at least three decimal places, and round your responses as specified in the table. (If necessary, consult a list of formulas.)
|
||||||||||||||||||||||||||||||||
In: Math
Among the fun details in the article are the following estimates of price elasticity of demand:
|
Cigarettes (US) • −0.3 to −0.6 (General) • −0.6 to −0.7 (Youth) |
Rice • −0.8 (Bangladesh) • −0.8 (China) • −0.25 (Japan) |
|
Cannabis (US) • −0.655 |
Soft drinks • −0.8 to −1.0 (general) • −3.8 (Coca-Cola) • −4.4 (Mountain Dew) |
A. Explain why the different estimates of price elasticity of demand for cigarettes regarding youth as opposed to all smokers in general either does or doesn’t seem to make sense.
B. Assuming that Japan is a wealthier country than either Bangladesh or China, why would demand for rice be less elastic in Japan than in either of the two other countries?
C. Why is demand for Coke and Mountain Dew more elastic than the demand for soft drinks in general?
D. If the price elasticity of supply for cannabis is 0.4, who would bear most of the burden of a cannabis tax, consumers or suppliers? Explain why.
In: Economics
2. The percentage of people in a population with a certain ailment (Ailment A) is 7.3%.
a. If you select a sample of 10 people from this population, what is the probability that at most two of them will have Ailment A ?
b. What is the probability that at least 3 of them would have this ailment ?
c. If you select a sample of 200 people, what is the probability that less than 10 will have ailment A ? Use the normal approximation technique.
d. What is the probability, in your sample of 200, that at least 20 will have Ailment A ?
4. The accumulated miles between repairs for vehicle engines is 24,000 miles with a standard deviation of 2000 miles. The accumulated miles, which have been recorded over time, follow a normal distribution.
a. Find the probability that an engine you just received will last longer than 26,000 miles.
b. Find the probability that the mean accumulated mileage from a sample of 10 engines exceeds 26,000 miles.
c. Find the 1st, 2nd, and 3rdquartiles for the accumulated miles between repairs.
d. Now, you are looking at vehicle transmissions. The historical data for transmission mileages indicates a population mean of 16,000 miles with a standard deviation of 2600 miles. The mileage for transmissions does not follow a normal distribution. Find the probability that, in a large train shipment of 40 transmissions, the average mileage for this sample will be less than 15,000 miles.
e. If the average for your transmission sample of 40 falls below the bottom 10%, you are going to declare a stand-down of the workforce to determine what is going wrong. What is the cutoff number of miles for the bottom 10% of your sample average?
f. Back to the engines . . . If a single engine is considered a “failure” if it doesn’t accumulate at least 22,000 miles between repairs, what is the chance that an engine will fail to meet its anticipated mileage accumulation?
g. Given the criteria just stated, what would be the “expected number" of failures in the next 1000 engines that are placed into vehicles?
In: Statistics and Probability
the lifetimes of its tires follow a normal distribution with
mean 48,000 miles and standard deviation 5,000 miles.
·a well-labeled sketch of this normal distribution
·the z-score corresponding to 55,000 miles
·the probability that a randomly selected tire lasts for more than 55,000 miles
·the manufacturer wants to issue a guarantee so that 99% of its tires last for longer than the guaranteed lifetime, what z-score should it use to determine that guaranteed lifetime
·the manufacturer wants to issue a guarantee so that 99% of its tires last for longer than the guaranteed lifetime, how many miles should it advertise as its guaranteed lifetime
In: Economics
In: Statistics and Probability
An individual wanted to determine the relation that might exist between speed and miles per gallon of an automobile. Let X be the average speed of a car on the highway measured in miles per hour and let Y represent the miles per gallon of the automobile. The following data is collected: X 40 45 45 50 50 52 55 55 Y 28 26 25 22 20 20 17 15
a. In the space below, draw a scatterplot of the bivariate data set.
b. What is the value for r? Interpret this value, would you say that the correlation is positive or negative? Strong or Weak? How do you know?
c. From the regression equation given above, what value is the slope of the line? Interpret this slope, what does it tell us about the relationship between average speed and miles per gallon?
d. Predict the miles per gallon of a car traveling 61 miles per hour. e. Predict the average speed of a car whose fuel mileage is 25 miles per gallon. f. Find r squared. What does this statistic tell us about between average speed and miles per gallon?
In: Statistics and Probability