In: Computer Science
Ashcroft Airlines flies a six-passenger commuter flight once a day to Gainesville, Florida. A non-refundable one-way fare with a reservation costs $129. The daily demand for this flight is given in the table below, along with the probability distribution of no-shows. A no-show has a reservation but does not arrive on time at the gate and forfeits the fare. Ashcroft currently overbooks at most three passengers per flight. If there are not enough seats for all the passengers at the gate, each passenger that cannot board the flight is refunded the passenger’s fare and also $150 voucher good on any other trip. The fixed cost for a flight is $450.
|
Demand |
Probability |
No-shows |
Probability |
|
|
5 |
0.05 |
0 |
0.15 |
|
|
6 |
0.11 |
1 |
0.25 |
|
|
7 |
0.20 |
2 |
0.26 |
|
|
8 |
0.18 |
3 |
0.23 |
|
|
9 |
0.16 |
4 |
0.11 |
|
|
10 |
0.12 |
|||
|
11 |
0.10 |
|||
|
12 |
0.08 |
i) Set up a flow chart showing the logical sequence of events for simulating Ashcroft’s expected profit for this flight. Provide all the details of the formulas used for relevant calculations. [20%]
ii) Using the two-digit random numbers below (in the order as they appear), calculate Ashcroft’s profit per flight and replicate your calculations 10 times. Organise all your calculation in a table. Calculate the expected profit, the occupancy rate of the plane and the probability that Ashcroft profit per flight is higher than $400? Briefly comment on the reliability of your results. [50%]
Random number sequence: 69 56 30 32 66 79 55 24 80 35 10 98 92 92 88 82 13 04 86 31 12 23 40 93 13 42 51 16 17 29 62 08 59 41 47 72 25 96 58 14 68 15 18 99 13 05 03 83 34 78 50 89 98 93 70 11
iii) Explain how you could use this model to investigate Ashroft’s overbooking strategy (no calculations required). [15%]
In: Statistics and Probability
Question 3B
CWD Electronics sells Televisions (TV), which it orders from the USA. Because of shipping and handling costs, each order must be for 10 TVs. Because of the time it takes to receive an order, the company places an order every time the present stock drops to 5 TVs. It costs $50 to place an order. It costs the company $200 in lost sales when a customer asks for a TV and the warehouse is out of stock. It costs $50 to keep each TV stored in the warehouse. If a customer cannot purchase a TV when it is requested, the customer will not wait until one comes in but will go to a competitor. The following probability distribution for demand for TV has been and the time required to receive an order once it is placed (lead time) has the following probability distribution:
|
Lead time (weeks) |
Probability |
Demand/week |
Probability |
|
1 |
0.45 |
1 |
0.15 |
|
2 |
0.30 |
2 |
0.25 |
|
3 |
0.25 |
3 |
0.40 |
|
4 |
4 |
0.20 |
The company has 10 TVs in stock. Orders are always received at the beginning of the week.
Note that a lead time of 2 weeks imply that an order placed in week one will arrive in week 4.
Hint. No order is placed until the current order has arrived. Usage of all random numbers for lead time depend on stock arrivals in the model hence all numbers may not be used.
Required
a) Construct the appropriate random number mappings for the random variables starting with .00. (2.5 marks for demand and 1.5 mark for lead time)
b) Simulate CWD's ordering and sales policy for 20 weeks.
c) Compute the average cost of the policy ( 4 marks)
|
Demand |
.15 |
.84 |
.16 |
.12 |
.55 |
.16 |
.84 |
.63 |
.33 |
.57 |
.18 |
.26 |
.23 |
.52 |
.37 |
.70 |
.56 |
.99 |
.16 |
.31 |
|
Lead time |
.47 |
.74 |
.35 |
.56 |
.64 |
.21 |
.55 |
.01 |
.40 |
Use the following headings
|
Month |
OI |
UR |
AI |
RN |
D |
DF |
EI |
SO |
order |
RN |
Lead-time |
IC |
SOC |
OC |
TC |
In: Statistics and Probability
In each of the following problems, identify a probability question and a statistics question associated with the given information.
(a) It has been reported that 81%81% of U.S. Americans have a social media profile. Consider a random sample of 100100 U.S. Americans.
(b) In general, 36%36% of all people use the same password for everything. Consider a random sample of 50 people.50 people.
(c) In Norway, 52%52% of all passenger cars are plug‑in electric vehicles.
(d) Fifty‑four percent of all injuries due to snow shoveling fall into the category of pulled muscles.
WHICH OF THESE IS THE PROBABILITY QUESTIONS AND WHICH OF THESE IS THE STATISTICS QUESTIONS ? (IDENTIFY)
prob - stat -
In: Statistics and Probability
Demand for walnut fudge ice cream at the Sweet Cream Dairy can be approximated by a normal distribution with a mean of 17 gallons per week and a standard deviation of 3.2 gallons per week. The new manager desires a service level of 90 percent. Lead time is two days, and the dairy is open seven days a week. (Hint: Work in terms of weeks.)
a-1. If an ROP model is used, what ROP would be consistent with the desired service level? (Do not round intermediate calculations. Round your final answer to 2 decimal places.)
ROP ______ gallons
a-2. How many days of supply are on hand at the ROP, assuming average demand? (Do not round intermediate calculations. Round your final answer to 2 decimal places.)
Days _______
b-1. If a fixed-interval model is used instead of an ROP model, what order size would be needed for the 90 percent service level with an order interval of 7 days and a supply of 8 gallons on hand at the order time? (Do not round intermediate calculations. Round your final answer to the nearest whole number.)
Order size _______ gallons
b-2. What is the probability of experiencing a stockout before this order arrives? (Do not round intermediate calculations. Round your final answer to the nearest whole percent. Omit the "%" sign in your response.)
Probability _________ %
c. Suppose the manager is using the ROP model described in part a. One day after placing an order with the supplier, the manager receives a call from the supplier that the order will be delayed because of problems at the supplier’s plant. The supplier promises to have the order there in two days. After hanging up, the manager checks the supply of walnut fudge ice cream and finds that 2 gallons have been sold since the order was placed. Assuming the supplier’s promise is valid, what is the probability that the dairy will run out of this flavor before the shipment arrives? (Do not round intermediate calculations. Round your final answer to the nearest whole percent. Omit the "%" sign in your response.)
Risk probability _________ %
In: Advanced Math
Risk analysis is one way to monitor security in an organization.
Risk analysis can be a time- consuming process; it involves a
number
of steps, some of which require “educated guessing.” Nevertheless,
the process alone raises awareness of security issues even if no
immediate actions are taken as a result. The steps are:
i. Identify assets (infrastructure, people, hardware, software, reputation, etc.).
For the rest of this list, we’ll concentrate on a single asset.
ii. Determine vulnerability (what event or events might happen to the asset. For example, the building could catch fire, the website could be hacked, etc.).
For the rest of this list, we’ll concentrate on a single asset vulnerable to a single event.
ii. Estimate the probability per year of this event (based on past data, expert estimates, etc.). Take current security measures into account.
iv. Estimate the expected cost if this event occurs (cost to repair or replace, cost of lost business, etc.).
v. Compute risk exposure 5 cost estimate 3 probability estimate.
vi. Identify any additional security measure X that would help protect against this event, determine what it would cost, and do a calculation of the risk exposure with the additional security measure X in place.
vii. Do a cost-benefit analysis:
(Risk exposure without X – Risk exposure with X) − Cost of X
You have a small web-based business that uses a single server to manage your webpage and your customer information. Over the past four years, your website has been hacked and taken down twice. You estimate that the cost of this event is $600 to clean the server and reload the webpage and $12,000 in lost business while the server is down.
You could purchase a backup server for a cost of $3,000, which you estimate would reduce the probability per year of losing your website to 0.2. Would this be a cost- effective security measure?
What if you reevaluate the probability per year with the backup server to be 0.3. Does this change your answer?
In: Computer Science
Don't attempt if you can't attempt fully, i will dislike and negative comments would be given Please it's a request.
c++
We will read a CSV files of a data dump from the GoodReads 2 web
site that contains information
about user-rated books (e.g., book title, publication year, ISBN
number, average reader rating,
and cover image URL). The information will be stored and some
simple statistics will be
calculated. Additionally, for extra credit, the program will create
an HTML web page based on
the top n highest rated books. As is typical of many subject matter
information sources, the data
in the file contains various errors. As such, we will track the
errors and create an exceptions files
to track the lines with data errors.
Develop a class, bookDataType, to provide functionality for reading
and storing book
information. The UML class specifications are provided below. A
main will be provided that
uses the bookDataType class.
●
Book Data Type Class
The class will implement the functions.
bookDataType
-COL_LIMIT = 23: static constexpr unsigned int
-TOP_LIMIT = 20: static constexpr unsigned int
-booksFileName: string
-webPageFileName: string
-exceptionsFileName: string
-bookCount: unsigned int
1 For more information, refer to:
https://en.wikipedia.org/wiki/Comma-separated_values
2 See: www.goodreads.com-topBooksLimit: unsigned int
-*topBooks: unsigned int
-struct bookErrsStruct
-bookIDErrors: unsigned int
-bookYearErrors: unsigned int
-AveRatingErrors: unsigned int
-duplicateDataErrors: unsigned int
-bookErrInfo: bookErrsStruct
-struct bookStruct
-bookTitle: string
-isbn: string
-pubYear: short
-aveRating: float
-imageURL: string
-bookID: unsigned int
-*bookInfo: bookStruct
+bookDataType()
+~bookDataType()
+getBookArguments(int, char *[], string &, bool &):
bool
+getBookFileName() const: string
+getWebPageFileName() const: string
+getExceptionsFileName() const: string
+getReadBookIDErrors() const: unsigned int
+getReadBookYearErrors() const: unsigned int
+getReadBookAveRatingErrors() const: unsigned int
+getReadBookDuplicateErrors() const: unsigned int
+getTopBooksLimit() const: unsigned int
+showBookData(unsigned int) const: void
+getBookCount() const: unsigned int
+getAverageOverallRating() const: float
+showHighestRatedBooks() const: void
+readBookData(const string): bool
+buildWebPage(const string="CS 202 Top Books") const: bool
+findHighestRatedBooks(): void
+setWebPageFileName(const string): void
+setExceptionsFileName(const string): void
+setTopBooksLimit(unsigned int): void
-parseLine(string, string []) const: void
Note, points will be deducted for insufficient commenting, poor
style, or inefficient coding. The
error messages should be prefixed with the function name (to help
better identify the source of
the error). Refer to the sample execution for error message
examples.Function Descriptions
•
The bookDataType() constructor should set the books filename to the
empty string, the
bookCount to 0, the topLimit to a default value of 5, the error
counts to 0, the web page
file name to a default value of “index.html”, and the exceptions
file to a default value of
“errors.txt”, and the pointers to the nullptr.
•
The ~bookDataType() destructor should delete the dynamically
allocated arrays, set the
other class variables to their default values (noted above).
•
The getBookArguments() function should read the command line
qualifiers in the
required format ( -i <booksFileName> [<-show|-noshow>]
) to obtain the file
name and set the show extra information flag (true/false). The data
file and show extra
flag may be in either order. The show extra flag is optional and
the “-noshow” is the
default if not specified. This includes a usage message and error
messages for both the
input file specifier and the input file name. The file name must be
at least one letter and
include a “.csv” extension (thus, the minimum length is 5). If the
file name is incorrect or
does not exist, an appropriate error message should be displayed,
the class variable
should remain unchanged, and the function should return false. To
determine if a file
exists (without opening it), you can use the access() function
(i.e,
( access(fn.c_str(), F_OK) ) which returns a 0 if the file exists
and returns a -1 if
the files does not exist. Note, the access() function requires the
#include <unistd.h>
statement. If there is an error, the function should output one of
the following error
messages:
cout
cout
cout
cout
cout
•
•
•
•
•
•
•
•
•
<<
<<
<<
<<
<<
"Usage:
"Error,
"Error,
"Error,
"Error,
./books -i <bookDataFileName> [<-show|-noshow>]"
<< endl;
invalid input file name specifier." << endl;
invalid command line options." << endl;
book data file name must be '.csv' extension." << endl;
invalid show extra information specifier." << endl;
based on the specific error.
The getBookFileName() function should return the current book file
name.
The getWebPageFileName() function should return the current web
page file name.
The getReadBookIDErrors(), getReadBookYearErrors(),
getReadBookAveRatingErrors(), and getReadBookDuplicateErrors()
functions should
return the applicable structure field.
The getExceptonsFileName() function should return the current
exceptions file name.
The setBookFileName() function should set the class variable for
the books file name to
the passed file name. The file name must be at least one letter and
include a “.csv”
extension (thus, the minimum length is 5). If the passed file name
is correct and the file
exists, the class variable should be set and a true returned. If
the file name is incorrect or
does not exist, an appropriate error message should be displayed,
the class variable
should remain unchanged, and the function should return false. To
determine if a file
exists (without opening it), you can use the access() function
(i.e,
( access(fn.c_str(), F_OK) ) which returns a 0 if the file exists
and returns a -1 if
the files does not exist..
The setWebPageFileName() function should set the class variable for
the web page file
name to the passed file name. The file name must be at least one
letter and include a
“.html” extension (thus, the minimum length is 6).
The setExceptonsFileName() function should set the class variable
for the file name to
the passed file name. The file name must be at least one letter and
include a “.txt”
extension (thus, the minimum length is 5).
The getTopBooksLimit() function should return the value for the
current number of
highest rated books to be found.
The setTopBooksLimit() function should set the class variable for
the current number of
highest rated books to be found. The value must not exceed the
TOP_LIMIT constant. If
the passed value is out of range, nothing should be changed.•
•
•
The getBookCount() should return the current number of books in the
data set.
The getAverageOverallRating() function should return the overall
average of book rating
in the entire current data set.
The showBookData() function should display the formatted book
information to the
screen in the specified format (see output example).
cout
cout
cout
cout
cout
cout
cout
•
•
•
•
•
<<
<<
<<
<<
<<
<<
<<
"Book Information:" <<
offset << "Title:
"
offset << "Book ID
"
offset << "ISBD:
"
offset << "Year:
"
offset << "Ave Rate: "
endl;
endl;
<< bookInfo[idx].bookTitle << endl;
<< bookInfo[idx].bookID << endl;
<< bookInfo[idx].isbn << endl;
<< bookInfo[idx].pubYear << endl;
<< bookInfo[idx].aveRating << endl;
The showHighestRatedBooks() function should show the topBooksLimit
number of
highest rated books using the showBookData() function from the
topBooks array. As
such, the findHighestRatedBooks() function must have been
previously called.
The findHighestRatedBooks() function should find the topBooksLimit
number of highest
rated books. This will require dynamic creation and population of
the topBooks[] array
of topBooksLimit size. The array will hold the index of the book
into the bookInfo[]
array. Due to the data size, a sort is not appropriate. The
topBooksLimit number of
highest rated books should be determined with out performing a
sort.
The parseLine() function will accept a string in comma-separated
format and break the
string into its individual comma separated fields. This includes
handling quoted fields
that may contain commas which are not field separators when inside
quotes. The
function should populate the passed array with the COL_LIMIT fields
in string format.
If the line contains more than COL_LIMIT fields, only the first
COL_LIMIT should be
returned (thus, do not over-write the array).
The readBookData() function should read the books file (CSV
format). This function
will call the private parseLine() function. From the returned
string array, the following
fields should be placed into the applicable fields of bookInfo[]
array.
•
Book title (first title), string
◦ note, of first title is empty, use second title
•
ISBN (10 digit), string
•
ImageURL (first of two), string
•
Publication Year, short
•
Book ID (good reads book ID, which is first), unsigned
integer
•
Average Rating, float
Note, since some data field may be invalid, try/catch blocks must
be used for the
conversion. The first line is a header line and must be skipped.
Blank lines should be
skipped. In order to size the bookInfo[] struct array, you will
need to read the file twice;
once to count the data lines and again to read the data. To reset
the file to the beginning,
use inFile.clear(); followed by inFile.seekg(0, ios::beg); . To
convert
string values into floats or integers, use the stoi() and stof()
functions. In order to check
for errors, these should be performed within a try/catch block.
Errors should be written
to the exceptions file with a line of 60 ‘-’s, the specific error,
the line number (from the
source data file), and on the next line the title “Row Data:”, and
on the next line the
complete row followed by a blank line. Refer to the examples for
formatting. Duplicate
rows are determined by the same book ID number and the second
occurrence written to
the exceptions file. See examples for formatting.
EXTRA CREDIT (up to 25 pts) → The buildWebPage() function should
build an HTML
web page of the top topBooksLimit number of highest rated books
including a link to the
image and the book information on the GoodReads web site. The Good
Reads link is
generated by appending the book ID to the URL"
https://www.goodreads.com/book/show/ " within an HREF tag along
with the
title. For example, <a
href=https://www.goodreads.com/book/show/24812>The
Complete
Calvin and Hobbes</a> for book ID 24812. The passed string is
the web page title
(using <title>CS 202 Top Books Page</title> in the
header block) and the initial we page
label (using an <h1>title</h1> tag) with a subtitle of
“Top Rated Books” (using an
<h2>subtitle</h2> tag). The minimum requirements for
the web page include the
title and subtitle headers, followed by the books. The books must
be numbered (1, 2, ...),
include the good reads book information link, the book cover image,
the ISBN number
(10 digit), and the book average rating. See the provided example
for a minimal required
format. The full 25 points will only be awarded if the final web
page exceeds the
minimal formatting (see example).
Refer to the example executions for output formatting. Make sure
your program includes the
appropriate documentation. See Program Evaluation Criteria for CS
202 for additional
information.
Make File:
You will need to develop a make file. You should be able to
type:
make
Which should create the executable. The makefile will be very
similar to the previous
assignment makefiles.
Submission:
● Submit a zip file of the program source files, header files, and
makefile via the on-line
submission. All necessary files must be included in the ZIP
file.
The grader will download, extract, and type make (so you must have
a valid, working makefile).
CSV Format
Fields in a CSV file are comma-separated. Typically (but not
always), the first line of the file
contains a row showing the field names. This is the case for our
data files. A field may contain
a number or may be quoted (that is, enclosed within double-quote
characters) indicating string
fields such as book titles. Such strings (names/titles) may have
embedded commas and
embedded quote characters (which must be double-quoted). For
example,
,"J.K. Rowling, Mary GrandPré, Rufus Beck",
,"A Child Called ""It"": One Child's Courage to Survive",
,"""M"" is for Malice",
,"""Who Could That Be at This Hour?""",
The double-quotes are used to mark a string field and are not
actually part of the string. For
example, the first line (above) is actually J.K. Rowling, Mary
GrandPré, Rufus Beck .
Where the double-quotes mark only the start and end. Since the
double-quote is used to mark the
start and end of a field, a double double-quote is used to signify
an actual double-quote. For
example, the second line is A Child Called "It": One Child's
Courage to
Survive , the second line is "M" is for Malice , and the third line
is "Who Could That
Be at This Hour?" .These requirements can make the reading of CSV
files a challenge. In addition, may data
sources in CSV format have imperfect data with various errors
include invalid numeric values,
too few fields, or too many fields.
Try/Catch Block Example
Below is an example of how to use the try/catch block for
conversion using the C++ stoi()
function.
unsigned int
unsigned long
string
try {
someNumber = 0;
size = 0;
badNum = "12-34";
someNumber = stoi(badNum, &size);
if (size != columns[8].size())
throw
invalid_argument("Conversion Error");
}
catch (exception &err) {
errFile << err.what() << endl;
}
In: Computer Science
High school graduates: Approximately
74%
of freshmen entering public high schools in the United States in
2005
graduated with their class in
2009
. A random sample of
175
freshmen is chosen. Use Cumulative Normal Distribution Table as needed. Round your answers to at least four decimal places if necessary.
(a)Find the mean
μp
.
| The mean
μp is . |
Part 2 of 6
(b)Find the standard deviation
σp
.
| The standard deviation
σp is . |
Part 3 of 6
(c)Find the probability that less than
75%
of freshmen in the sample graduated.
| The probability that less than
75% of freshmen in the sample graduated is . |
Part 4 of 6
(d)Find the probability that between
64%
and
78%
of freshmen in the sample graduated.
| The probability that between
64% and78% of freshmen in the sample graduated is . |
Part 5 of 6
(e)Find the probability that more than
64%
of freshmen in the sample graduated.
| The probability that more than
64% of freshmen in the sample graduated is . |
Part 6 of 6
(f)Would it be unusual if the sample proportion of freshmen in the sample graduated was more than
83%
?
| It ▼(Choose one) be
unusual if the sample proportion of freshmen in the sample
graduated was more than
83% since the probability is . |
In: Statistics and Probability
In a survey of a group of men, the heights in the 20-29 age group were normally distributed, with a mean of 67,4 inches and a standard deviation of 2.0 inches. A study participant is randomly selected. Complete parts (a) through (d) below.
(a) Find the probability that a study participant has a height
that is less than 68 inches.
The probability that the study participant selected at random is
less than 68 inches tall is
nothing. (Round to four decimal places as needed.)
(b) Find the probability that a study participant has a height
that is between 58 and 71 inches.
The probability that the study participant selected at random is
between 68 and 71 inches tall is
nothing. (Round to four decimal places as needed.)
(c) Find the probability that a study participant has a height
that is more than 71 inches.
The probability that the study participant selected at random is
more than 71 inches tall is
nothing. (Round to four decimal places as needed.)
(d) Identify any unusual events. Explain your reasoning. Choose
the correct answer below.
A. The event in part is unusual because its probability is less
than 0.05.
B. than 0.05.
C. than 0.05.
In: Statistics and Probability
In: Economics