1.In this problem and the next one, we’re going to make a very simple spam checker program by just looking
...
ooking at how likely a given email is to be spam based on the words it contains. In particular, in this problem we’re going to count how often words are present in spam emails within some set of training data (which here means a set of emails that have already been marked as spam or not spam manually).
We have already started to write a function spam_score(spam_file, not_file, word), which takes in two filenames, along with a target word (a lowercase string). Both filenames refer to text files which must be in the same directory as hw07.py (we’ve provided several such files in hw07files.zip). The text files contain one email per line (really just the subject line to keep things simple) - you can assume that these emails will be a series of words separated by spaces with no punctuation. The first file contains emails that have been identified as spam, the second contains emails that have been identified as not spam.
Since you haven’t learned File I/O yet, we’ve provided code that opens the two files and puts the data into two lists of strings (where each element is one line - that is, one email). You then must complete the function, so that it returns the spam score for the target word. The spam score is an integer representing the total number of times the target word occurs across all the spam emails, minus the total number of times the word occurs in not-spam emails. Convert all words to lowercase before counting, to ensure capitalization does not throw off the count.
View More
2.
The marketing research department for the company that manufactures and sells “notebook” computers established the following price – demand function:
p(x)
...
ters established the following price – demand function:
p(x) = 10 – 0,001x, where p(x) is the wholesale price in dollars at which x thousand computers can be sold.
Total cost (in dollars) of producing x items is given by C(x) = 7000 + 2x.
A) Find the revenue function and state its domain.
B) Find the marginal revenue function. Find R´(4000) and R´(6000). Interpret the results.
C) Evaluate the approximate revenue and exact revenue of producing 101-th notebook.
D) Find the profit function
E) Find the marginal profit function.
F) Evaluate the approximate profit and exact profit of producing 101-th notebook.
G) Find P´(5000) and P´(7000). Interpret the results.
View More
3.Let X_1, X_2, ... , X_n be i.i.d. with probability density function
f(x | theta) = theta*x^(-theta - 1); I{x>1}, theta
...
- 1); I{x>1}, theta > 1.
(a) Show that log Xi has an exponential distribution with a mean of 1/theta.
(b) Find the form for a UMP test of H_0: theta <= theta_0 vs. H_a : theta > theta_0.
(c) Give formula for nding the rejection region for a given value of alpha.
Hint: use the result from (a) to find the distribution of the test statistic.
(d) Conduct the test in (b) with alpha = 0.05 and theta_0 = 1:5 using the dataset: {1.2, 2.4, 1.3, 1.7, 1.9}.
(e) Find the form of a UMPU test for testing H_0 : theta = theta_0 vs. H_a : theta_0 != theta_0.
(f) Use the data in (d) to conduct the test in (e) with alpha = 0.05 and theta_0 = 1.5.
View More
4.Let X_1, X_2, ... , X_n be i.i.d. with probability density function
f(x | theta) = theta*x^(-theta - 1); I{x>1}, theta
...
- 1); I{x>1}, theta > 1.
(a) Show that log Xi has an exponential distribution with a mean of 1/theta.
(b) Find the form for a UMP test of H_0: theta <= theta_0 vs. H_a : theta > theta_0.
(c) Give formula for nding the rejection region for a given value of alpha.
Hint: use the result from (a) to find the distribution of the test statistic.
(d) Conduct the test in (b) with alpha = 0.05 and theta_0 = 1:5 using the dataset: {1.2, 2.4, 1.3, 1.7, 1.9}.
(e) Find the form of a UMPU test for testing H_0 : theta = theta_0 vs. H_a : theta_0 != theta_0.
(f) Use the data in (d) to conduct the test in (e) with alpha = 0.05 and theta_0 = 1.5.
View More
5.Let X_1, X_2, ... , X_n be i.i.d. with probability density function
f(x | theta) = theta*x^(-theta - 1); I{x>1}, theta
...
- 1); I{x>1}, theta > 1.
(a) Show that log Xi has an exponential distribution with a mean of 1/theta.
(b) Find the form for a UMP test of H_0: theta <= theta_0 vs. H_a : theta > theta_0.
(c) Give formula for nding the rejection region for a given value of alpha.
Hint: use the result from (a) to find the distribution of the test statistic.
(d) Conduct the test in (b) with alpha = 0.05 and theta_0 = 1:5 using the dataset: {1.2, 2.4, 1.3, 1.7, 1.9}.
(e) Find the form of a UMPU test for testing H_0 : theta = theta_0 vs. H_a : theta_0 != theta_0.
(f) Use the data in (d) to conduct the test in (e) with alpha = 0.05 and theta_0 = 1.5.
View More
8.Directions: You are part of a fireworks crew assembling a local fireworks display.
There are two parts to the fireworks platforms:
...
rts to the fireworks platforms: one part is on the ground and the
other part is on top of a building. You are going to graph all of your results on one
coordinate plane. Make sure to label each graph with its equation. Use the following
equations to assist with this assignment.
• The function for objects dropped from a height where t is the time in
seconds, h is the height in feet at time it t, and 0 h is the initial height is
2
0 ht t h ( ) 16 =− + .
• The function for objects that are launched where t is the time in seconds, h is
the height in feet at time t, 0 h is the initial height, and 0 v is the initial velocity
in feet per second is 2
0 0 ht t vt h ( ) 16 =− + + .
Select the link below to access centimeter grid paper for your portfolio.
Centimeter Grid Paper
Task 1
First, conduct some research to help you with later portions of this portfolio
assessment.
• Find a local building and estimate its height. How tall do you think the
building is?
• Use the Internet to find some initial velocities for different types of fireworks.
What are some of the initial velocities that you found?
Task 2
Respond to the following items.
1. While setting up a fireworks display, you have a tool at the top of the
building and need to drop it to a coworker below.
a. How long will it take the tool to fall to the ground? (Hint: use the first
equation that you were given above, 2
0 ht t h ( ) 16 =− + . For the building’s
height, use the height of the building that you estimated in Task 1.)
b. Draw a graph that represents the path of this tool falling to the
ground. Be sure to label your axes with a title and a scale. Your graph
should show the height of the tool, h, after t seconds have passed.
Label this line “Tool”.
View More
11.The supply for a particular item is given by the function
S
(
x
)
=
15
+
7
x
. Find the producer's surplus if the equilibrium
...
producer's surplus if the equilibrium price of a unit
$
99
.A retailer anticipates selling
7600
units of its product at a uniform rate over the next year. Each time the retailer places an order for
x
units, it is charged a flat fee of
$
100
. Carrying costs are
$
38
per unit per year. How many times should the retailer reorder each year and what should be the lot size to minimize inventory costs? What is the minimum inventory cost?
For a particular commodity, the demand function is
q
=
1
4
(
400
−
p
2
)
.
a
.
Find
ε
when
p
=
8
.A hotel rents
240
rooms at a rate of
$
60
per day. For each
$
1
increase in the rate, three fewer rooms are rented. Find the room rate that maximizes daily revenue.
View More
13.A GRAPHING CALCULATOR IS REQUIRED FOR THIS QUESTION.
You are permitted to use your calculator to solve an equation, find the
...
lve an equation, find the derivative of a function at a point, or calculate the value of a definite integral. However, you must clearly indicate the setup of your question, namely the equation, function, or integral you are using. If you use other built-in features or programs, you must show the mathematical steps necessary to produce your results. Your work must be expressed in standard mathematical notation rather than calculator syntax.
Show all of your work, even though the question may not explicitly remind you to do so. Clearly label any functions, graphs, tables, or other objects that you use. Justifications require that you give mathematical reasons, and that you verify the needed conditions under which relevant theorems, properties, definitions, or tests are applied. Your work will be scored on the correctness and completeness of your methods as well as your answers. Answers without supporting work will usually not receive credit.
Unless otherwise specified, answers (numeric or algebraic) need not be simplified. If your answer is given as a decimal approximation, it should be correct to three places after the decimal point.
Unless otherwise specified, the domain of a function f is assumed to be the set of all real numbers x for which f(x) is a real number.
Let f be a twice-differentiable function such that f′(2)=0 . The second derivative of f is given by f′′(x)=x2e2−x−1 for 0≤x≤6 .
(a) On what open intervals contained in 0
View More