7. A number of minor automobile accidents occur at various high-risk intersections in Teton County despite traffic lights. The Traffic Department claims that a modification in the type of light will reduce these accidents. The county commissioners have agreed to a proposed experiment. Eight intersections were chosen at random, and the lights at those intersections were modified. At the .01 significance level, is it reasonable to conclude that the modification reduced the number of traffic accidents?
| No. accidents | |
| Before | After |
| 5 | 3 |
| 7 | 7 |
| 6 | 7 |
| 4 | 0 |
| 8 | 4 |
| 9 | 6 |
| 8 | 8 |
| 10 | 2 |
In: Math
The Japanese government was pressured by the U.S. government to place limits on the number of vehicles exported to the United States by Japanese automobile producers in 1981. This is an example of
A. tariff rate quota
B, Specific tariffs
C. Voluntary export restraint
D. Ad valorem tariff
In: Economics
In: Economics
Using python!!!!
1. Copy the file web.py from class (or class notes) into your working folder.
2. Include the following imports at the top of your module (hopefully this is sufficient):
from web import LinkCollector # make sure you did 1
from html.parser import HTMLParser
from urllib.request import urlopen
from urllib.parse import urljoin
from urllib.error import URLError
3. Implement a class ImageCollector. This will be similar to the LinkCollector, given a string containing the html for a web page, it collects and is able to supply the (absolute) urls of the images on that web page. They should be collected in a set that can be retrieved with the method getImages (order of images will vary). Sample usage:
>>> ic =
ImageCollector('http://www2.warnerbros.com/spacejam/movie/jam.htm')
>>> ic.feed(
urlopen('http://www2.warnerbros.com/spacejam/movie/jam.htm').read().decode())
>>> ic.getImages()
{'http://www2.warnerbros.com/spacejam/movie/img/p-sitemap.gif', …,
'http://www2.warnerbros.com/spacejam/movie/img/p-jamcentral.gif'}
>>> ic = ImageCollector('http://www.kli.org/')
>>> ic.feed(
urlopen('http://www.kli.org/').read().decode())
>>> ic.getImages()
{'http://www.kli.org/wp-content/uploads/2014/03/KLIbutton.gif',
'http://www.kli.org/wp-content/uploads/2014/03/KLIlogo.gif'}
4. Implement a class ImageCrawler that will inherit from the Crawler developed in amd will both crawl links and collect images. This is very easy by inheriting from and extending the Crawler class. You will need to collect images in a set. Hint: what does it mean to extend? Implementation details:
a. You must inherit from Crawler. Make sure that the module web.py is in your working folder and make sure that you import Crawler from the web module.
b. __init__ - extend’s Crawler’s __init__ by adding an set attribute that will be used to store images
c. Crawl – extends Crawler’s crawl by creating an image collector, opening the url and then collecting any images from the url in the set of images being stored. I recommend that you collect the images before you call the Crawler’s crawl method.
d. getImages – returns the set of images collected
>>> c = ImageCrawler()
>>>
c.crawl('http://www2.warnerbros.com/spacejam/movie/jam.htm',1,True)
>>> c.getImages()
{'http://www2.warnerbros.com/spacejam/movie/img/p-lunartunes.gif',
…
'http://www2.warnerbros.com/spacejam/movie/cmp/pressbox/img/r-blue.gif'}
>>> c = ImageCrawler()
>>> c.crawl('http://www.pmichaud.com/toast/',1,True)
>>> c.getImages()
{'http://www.pmichaud.com/toast/toast-6a.gif',
'http://www.pmichaud.com/toast/toast-2c.gif',
'http://www.pmichaud.com/toast/toast-4c.gif',
'http://www.pmichaud.com/toast/toast-6c.gif',
'http://www.pmichaud.com/toast/ptart-1c.gif',
'http://www.pmichaud.com/toast/toast-7b.gif',
'http://www.pmichaud.com/toast/krnbo24.gif',
'http://www.pmichaud.com/toast/toast-1b.gif',
'http://www.pmichaud.com/toast/toast-3c.gif',
'http://www.pmichaud.com/toast/toast-5c.gif',
'http://www.pmichaud.com/toast/toast-8a.gif'}
5. Implement a function scrapeImages: Given a url, a filename, a depth, and Boolean (relativeOnly)., this function starts at url, crawls to depth, collects images, and then writes an html document containing the images to filename. This is not hard, use the ImageCrawler from the prior step. For example:
>>> scrapeImages('http://www2.warnerbros.com/spacejam/
movie/jam.htm','jam.html',1,True)
>>> open('jam.html').read().count('img')
62
>>>
scrapeImages('http://www.pmichaud.com/toast/',
'toast.html',1,True)
>>> open('toast.html').read().count('img')
11
link to web.py https://www.dropbox.com/s/obiyi7lnwc3rw0d/web.py?dl=0
In: Computer Science
Five different experiments are carried out. In each experiment,
a block is attached to a horizontal spring. The block is pulled
back a certain distance and released. The block oscillates back and
forth on a frictionless surface. Rank the amplitude of oscillation
for each of the following situations. (Rank the smallest amplitude
as 1).
1) A block of mass M is attached to a spring with a spring constant
k, pulled back a distance 2d, and released.
2) A block of mass M is attached to a spring with a spring constant
2k, pulled back a distance (1/2)d, and released.
3) A block of mass (1/2)M is attached to a spring with a spring
constant k, pulled back a distance d, and released.
4) A block of mass M is attached to a spring with a spring constant
2k, pulled back a distance d, and released.
5) A block of mass M is attached to a spring with a spring constant
k, pulled back a distance d, and released.
In: Physics
True or False
Decreasing long-run average costs for a firm as it expands plant size and output result from increasing returns to scale
In: Economics
Consider “Major Molineux” as a coming of age story. How does Robin “grow up” from beginning to end of thestory? What does he learn about himself, the world he lives in, and his place in it? Be sure to includediscussion of the ways the story’s depiction of the city (as particular place and as imaginative construct)contribute to Robin’s coming of age story.
In: Psychology
What is your understanding of the role of government in mitigating market failure?
Do you think it is the best remedy for the nation and the economy to allow government to manage the economy in this way? Why or why not?
In: Economics
Calculate the vapor pressure at 25 C of an aqueous solution that
is 5.50% NaCl by mass. (Assume complete dissociation of the
solute)
Please explain thoroughly.
In: Chemistry
Concepts: Classes, Objects, Inheritance, Method overriding (toString), polymorphic methods, Array of objects, loops
1. (Classes and Objects) Hand-write a complete Java class that can be used to create a Car object as described below.
a. A Vehicle has-a: i. Registration number ii. Owner name iii. Price iv. Year manufactured
b. Add all instance variables
c. The class must have getters and setters for all instance variables
d. The class must have two constructors, a no-args and a constructor that receives input parameters for each instance variable.
2. (Inheritance) Hand-write two Java classes, Car and Truck. They are both subclasses of Vehicle.
a. A car has an additional instance variable, number of doors.
b. A truck has an additional instance variable, number of axles
c. Write a constructor that requires input for the instance variables of each class (including registration number and owner name).
d. Write getters and setters for all instance variables for both classes.
3. (Array of objects) The array of Vehicles below, write the static method, findMin which returns the lowest price of any Vehicle in the Array Vehicle [] myVehicles = new Vehicle[10]; public static double findMin(Vehicle [] theVehicles) { }
4.Write a class, TestVehicle, which does the following: 1. Creates one Car object from information entered by the user. 2. Creates one Truck object from information entered by the user. 3. Creates an Array of Vehicles that can hold 10 objects. 4. It creates up to 10 Vehicles objects from information entered by the user 5. Prints the information about each object in the format shown below using the toString methods of the classes
*****PLEASE USE THE CODE BELOW I HAVE SO FAR TO COMPLETE THE PROGRAM****
****************************************************************************************
public class Vehicle {
//Instance Variables
private int
registrationNumber;
private String ownerName;
private double price;
private int yearManufactured;
//Constructors
public Vehicle (){
this.registrationNumber=0;
this.ownerName=
" ";
this.price=0;
this.yearManufactured=0;
}
public Vehicle (int
newRegisteration, String newName, double newPrice, int newMnf)
{
this.registrationNumber = newRegisteration;
this.ownerName =
newName;
this.price =
newPrice;
this.yearManufactured = newMnf;
}
//Get methods
public int getRegistration ()
{
return
this.registrationNumber;
}
public String getName () {
return
this.ownerName;
}
public double getPrice () {
return
this.price;
}
public int getYearManufactured () {
return
this.yearManufactured;
}
//Mutators or
Setters
public void
setRegistration (int newRegistration) {
this.registrationNumber=newRegistration;
}
public void setName (String newName) {
this.ownerName=newName;
}
public void
setPrice (double newPrice) {
this.price=newPrice;
}
public void setYearManufactured (int newYearManufactured) {
this.yearManufactured=newYearManufactured;
}
public String toString () {
return "
Vehicle: \nRegistration Number: " +registrationNumber
+ " Owner Name: "+ownerName+
" Price: "+price+ " Year Manufactured: " +yearManufactured;
}
}//end of class
**********************************************************************************************
public class Car extends Vehicle {
//Instance Variables
private int numOfDoors;
//Constructors
public Car() {
super();
}
}//end of class
In: Computer Science
|
One particular morning, the length of time spent in the examination rooms is recorded for each patient seen by each physician at an orthopedic clinic. |
| Time in Examination Rooms (minutes) | |||
| Physician 1 | Physician 2 | Physician 3 | Physician 4 |
| 36 | 34 | 17 | 27 |
| 22 | 34 | 28 | 30 |
| 29 | 33 | 29 | 33 |
| 32 | 29 | 26 | 25 |
| 25 | 44 | 31 | 33 |
| 33 | 35 | 26 | 35 |
| 19 | 27 | 42 | |
| 30 | |||
|
Fill in the missing data. (Round your p-value to 4 decimal places, mean values to 1 decimal place, and other answers to 3 decimal places.) |
| Treatment | Mean | n | Std. Dev |
| Physician 1 | |||
| Physician 2 | |||
| Physician 3 | |||
| Physician 4 | |||
| Total | |||
| One-Factor ANOVA | |||||
| Source | SS | df | MS | F | p-value |
| Treatment | |||||
| Error | |||||
| Total | |||||
| (a) |
Based on the given hypotheses, choose the correct option. |
| H0: μ1 = μ2 = μ3 = μ4 | |
| H1: Not all the means are equal | |
| α = 0.05 | |
|
| (b) |
Calculate the F for one factor. (Round your answer to 2 decimal places.) |
| F for one factor is |
| (c) |
On the basis of the above findings, we reject the null hypothesis. Is the statement true? |
|
In: Math
How much heat (in kJ) is required to warm 11.0 g of ice, initially at -13.0 ∘C, to steam at 113.0 ∘C? The heat capacity of ice is 2.09 J/g⋅∘C and that of steam is 2.01 J/g⋅∘C.
In: Chemistry
Take a single example and elaborate the replacement algorithms?
In: Computer Science
1.A cylinder of radius a = 7 cm and height h = 11.6 cm is aligned with its axis along the y-axis as shown. What is the total flux ? that passes through the cylindrical surface? Enter a positive number if the net flux leaves the cylinder and a negative number if the net flux enters the cylnder.
2.Another infinite line of charge with charge density ?2 = -14.7 ?C/cm parallel to the y-axis is now added at x = 3.5 cm as shown.
3.What is the new value for Ex(P), the x-component of the electric field at point P?
4.What is the total flux ? that now passes through the cylindrical surface? Enter a positive number if the net flux leaves the cylinder and a negative number if the net flux enters the cylnder.
5. The initial infinite line of charge is now moved so that it is parallel to the y-axis at x = -3.5cm.What is the new value for Ex(P), the x-component of the electric field at point P?
6. What is the total flux ? that now passes through the cylindrical surface? Enter a positive number if the net flux leaves the cylinder and a negative number if the net flux enters the cylnder.
In: Physics
(SQL Coding)
Create a READ ONLY view called: VIEW_EMP_SAL_INFO
Calculate the following: The minimum, average, maximum, and sum of all salaries, and a count to show the records used. Have the calculations grouped by department name. (You will need to join with the departments table.) Round the functions to two decimal points. Give the read only constraint the name of vw_emp_sal_info_readonly.
In: Computer Science