Questions
A poll surveyed people in six countries to assess attitudes toward a variety of alternate forms...

A poll surveyed people in six countries to assess attitudes toward a variety of alternate forms of energy. Suppose the data in the following table are a portion of the poll's findings concerning whether people favor or oppose the building of new nuclear power plants.

Response Country
Great
Britain
France Italy Spain Germany United
States
Strongly favor 133 298 161 141 128 204
Favor more than oppose 222 309 367 348 272 326
Oppose more than favor 311 219 334 381 322 316
Strongly oppose 443 220 215 217 389 174

(a)

How large was the sample in this poll?

(b)

Conduct a hypothesis test to determine whether people's attitude toward building new nuclear power plants is independent of country.

State the null and alternative hypotheses.

H0: The attitude toward building new nuclear power plants is mutually exclusive of the country.
Ha: The attitude toward building new nuclear power plants is not mutually exclusive of the country.

H0: The attitude toward building new nuclear power plants is not independent of the country.
Ha: The attitude toward building new nuclear power plants is independent of the country.

H0: The attitude toward building new nuclear power plants is independent of the country.
Ha: The attitude toward building new nuclear power plants is not independent of the country.

H0: The attitude toward building new nuclear power plants is not mutually exclusive of the country.
Ha: The attitude toward building new nuclear power plants is mutually exclusive of the country.

Find the value of the test statistic. (Round your answer to two decimal places.)

Find the p-value. (Round your answer to four decimal places.)

p-value =

State your conclusion.

Do not reject H0. We conclude that the attitude toward building new nuclear power plants is not independent of the country.

Reject H0. We conclude that the attitude toward building new nuclear power plants is not independent of the country.   

Do not reject H0. We cannot conclude that the attitude toward building new nuclear power plants is independent of the country.

Reject H0. We cannot conclude that the attitude toward building new nuclear power plants is independent of the country.

(c)

Using the percentage of respondents who "strongly favor" and "favor more than oppose," which country has the most favorable attitude toward building new nuclear power plants?

Great Britain or France or Italy or Spain or Germany or United States

Which country has the least favorable attitude?

Great Britain or France or Italy or Spain or Germany or United States

In: Statistics and Probability

A poll surveyed people in six countries to assess attitudes toward a variety of alternate forms...

A poll surveyed people in six countries to assess attitudes toward a variety of alternate forms of energy. Suppose the data in the following table are a portion of the poll's findings concerning whether people favor or oppose the building of new nuclear power plants.

Response Country
Great
Britain
France Italy Spain Germany United
States
Strongly favor 298 161 141 128 133 204
Favor more than oppose 309 367 348 272 222 326
Oppose more than favor 219 334 381 322 311 316
Strongly oppose 220 215 217 389 443 174

(a)

How large was the sample in this poll?

(b)

Conduct a hypothesis test to determine whether people's attitude toward building new nuclear power plants is independent of country.

State the null and alternative hypotheses.

H0: The attitude toward building new nuclear power plants is not mutually exclusive of the country.
Ha: The attitude toward building new nuclear power plants is mutually exclusive of the country.H0: The attitude toward building new nuclear power plants is not independent of the country.
Ha: The attitude toward building new nuclear power plants is independent of the country.    H0: The attitude toward building new nuclear power plants is mutually exclusive of the country.
Ha: The attitude toward building new nuclear power plants is not mutually exclusive of the country.H0: The attitude toward building new nuclear power plants is independent of the country.
Ha: The attitude toward building new nuclear power plants is not independent of the country.

Find the value of the test statistic. (Round your answer to two decimal places.)

Find the p-value. (Round your answer to four decimal places.)

p-value =

State your conclusion.

Do not reject H0. We cannot conclude that the attitude toward building new nuclear power plants is independent of the country.Reject H0. We conclude that the attitude toward building new nuclear power plants is not independent of the country.    Reject H0. We cannot conclude that the attitude toward building new nuclear power plants is independent of the country.Do not reject H0. We conclude that the attitude toward building new nuclear power plants is not independent of the country.

(c)

Using the percentage of respondents who "strongly favor" and "favor more than oppose," which country has the most favorable attitude toward building new nuclear power plants?

Great BritainFrance    ItalySpainGermanyUnited States

Which country has the least favorable attitude?

Great BritainFrance    ItalySpainGermanyUnited States

In: Math

A poll surveyed people in six countries to assess attitudes toward a variety of alternate forms...

A poll surveyed people in six countries to assess attitudes toward a variety of alternate forms of energy. Suppose the data in the following table are a portion of the poll's findings concerning whether people favor or oppose the building of new nuclear power plants.

Response Country
Great
Britain
France Italy Spain Germany United
States
Strongly favor 141 133 128 161 298 204
Favor more than oppose 348 222 272 367 309 326
Oppose more than favor 381 311 322 334 219 316
Strongly oppose 217 443 389 215 220 174

(a)

How large was the sample in this poll?

(b)

Conduct a hypothesis test to determine whether people's attitude toward building new nuclear power plants is independent of country.

State the null and alternative hypotheses.

H0: The attitude toward building new nuclear power plants is mutually exclusive of the country.
Ha: The attitude toward building new nuclear power plants is not mutually exclusive of the country.H0: The attitude toward building new nuclear power plants is not mutually exclusive of the country.
Ha: The attitude toward building new nuclear power plants is mutually exclusive of the country.    H0: The attitude toward building new nuclear power plants is not independent of the country.
Ha: The attitude toward building new nuclear power plants is independent of the country.H0: The attitude toward building new nuclear power plants is independent of the country.
Ha: The attitude toward building new nuclear power plants is not independent of the country.

Find the value of the test statistic. (Round your answer to two decimal places.)

Find the p-value. (Round your answer to four decimal places.)

p-value =

State your conclusion.

Do not reject H0. We conclude that the attitude toward building new nuclear power plants is not independent of the country.Do not reject H0. We cannot conclude that the attitude toward building new nuclear power plants is independent of the country.    Reject H0. We conclude that the attitude toward building new nuclear power plants is not independent of the country.Reject H0. We cannot conclude that the attitude toward building new nuclear power plants is independent of the country.

(c)

Using the percentage of respondents who "strongly favor" and "favor more than oppose," which country has the most favorable attitude toward building new nuclear power plants?

Great BritainFrance    ItalySpainGermanyUnited States

Which country has the least favorable attitude?

Great BritainFrance    ItalySpainGermanyUnited States

In: Math

Instruction This task is about using the Java Collections Framework to accomplish some basic textprocessing tasks....

Instruction

This task is about using the Java Collections Framework to accomplish some basic textprocessing tasks. These questions involve choosing the right abstraction (Collection, Set, List, Queue, Deque, SortedSet, Map, or SortedMap) to efficiently accomplish the task at hand. The best way to do these is to read the question and then think about what type of Collection is best to use to solve it. There are only a few lines of code you need to write to solve each of them. Unless specified otherwise, sorted order refers to the natural sorted order on Strings, as defined by String.compareTo(s). Part 0 in the assignment is an example specification and solution.

Part0

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Part0 {
  
   /**
   * Read lines one at a time from r. After reading all lines, output
   * all lines to w, outputting duplicate lines only once. Note: the order
   * of the output is unspecified and may have nothing to do with the order
   * that lines appear in r.
   * @param r the reader to read from
   * @param w the writer to write to
   * @throws IOException
   */
   public static void doIt(BufferedReader r, PrintWriter w) throws IOException {
Set<String> s = new HashSet<>();

for (String line = r.readLine(); line != null; line = r.readLine()) {
s.add(line);
}

for (String text : s) {
w.println(text);
}
   }

   /**
   * The driver. Open a BufferedReader and a PrintWriter, either from System.in
   * and System.out or from filenames specified on the command line, then call doIt.
   * @param args
   */
   public static void main(String[] args) {
       try {
           BufferedReader r;
           PrintWriter w;
           if (args.length == 0) {
               r = new BufferedReader(new InputStreamReader(System.in));
               w = new PrintWriter(System.out);
           } else if (args.length == 1) {
               r = new BufferedReader(new FileReader(args[0]));
               w = new PrintWriter(System.out);              
           } else {
               r = new BufferedReader(new FileReader(args[0]));
               w = new PrintWriter(new FileWriter(args[1]));
           }
           long start = System.nanoTime();
           doIt(r, w);
           w.flush();
           long stop = System.nanoTime();
           System.out.println("Execution time: " + 10e-9 * (stop-start));
       } catch (IOException e) {
           System.err.println(e);
           System.exit(-1);
       }
   }
}

Question 6

[5 marks] Read the input one line at a time and output the current line if and only if it is not a suffix of some previous line. For example, if the some line is "0xdeadbeef" and some subsequent line is "beef", then the subsequent line should not be output.

Template code

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Part6 {
  
   /**
   * Your code goes here - see Part0 for an example
   * @param r the reader to read from
   * @param w the writer to write to
   * @throws IOException
   */
   public static void doIt(BufferedReader r, PrintWriter w) throws IOException {
       // Your code goes here - see Part0 for an example
   }

   /**
   * The driver. Open a BufferedReader and a PrintWriter, either from System.in
   * and System.out or from filenames specified on the command line, then call doIt.
   * @param args
   */
   public static void main(String[] args) {
       try {
           BufferedReader r;
           PrintWriter w;
           if (args.length == 0) {
               r = new BufferedReader(new InputStreamReader(System.in));
               w = new PrintWriter(System.out);
           } else if (args.length == 1) {
               r = new BufferedReader(new FileReader(args[0]));
               w = new PrintWriter(System.out);              
           } else {
               r = new BufferedReader(new FileReader(args[0]));
               w = new PrintWriter(new FileWriter(args[1]));
           }
           long start = System.nanoTime();
           doIt(r, w);
           w.flush();
           long stop = System.nanoTime();
           System.out.println("Execution time: " + 10e-9 * (stop-start));
       } catch (IOException e) {
           System.err.println(e);
           System.exit(-1);
       }
   }
}

In: Computer Science

Instruction This task is about using the Java Collections Framework to accomplish some basic textprocessing tasks....

Instruction

This task is about using the Java Collections Framework to accomplish some basic textprocessing tasks. These questions involve choosing the right abstraction (Collection, Set, List, Queue, Deque, SortedSet, Map, or SortedMap) to efficiently accomplish the task at hand. The best way to do these is to read the question and then think about what type of Collection is best to use to solve it. There are only a few lines of code you need to write to solve each of them. Unless specified otherwise, sorted order refers to the natural sorted order on Strings, as defined by String.compareTo(s). Part 0 in the assignment is an example specification and solution.

Part0

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Part0 {
  
   /**
   * Read lines one at a time from r. After reading all lines, output
   * all lines to w, outputting duplicate lines only once. Note: the order
   * of the output is unspecified and may have nothing to do with the order
   * that lines appear in r.
   * @param r the reader to read from
   * @param w the writer to write to
   * @throws IOException
   */
   public static void doIt(BufferedReader r, PrintWriter w) throws IOException {
Set<String> s = new HashSet<>();

for (String line = r.readLine(); line != null; line = r.readLine()) {
s.add(line);
}

for (String text : s) {
w.println(text);
}
   }

   /**
   * The driver. Open a BufferedReader and a PrintWriter, either from System.in
   * and System.out or from filenames specified on the command line, then call doIt.
   * @param args
   */
   public static void main(String[] args) {
       try {
           BufferedReader r;
           PrintWriter w;
           if (args.length == 0) {
               r = new BufferedReader(new InputStreamReader(System.in));
               w = new PrintWriter(System.out);
           } else if (args.length == 1) {
               r = new BufferedReader(new FileReader(args[0]));
               w = new PrintWriter(System.out);              
           } else {
               r = new BufferedReader(new FileReader(args[0]));
               w = new PrintWriter(new FileWriter(args[1]));
           }
           long start = System.nanoTime();
           doIt(r, w);
           w.flush();
           long stop = System.nanoTime();
           System.out.println("Execution time: " + 10e-9 * (stop-start));
       } catch (IOException e) {
           System.err.println(e);
           System.exit(-1);
       }
   }
}

Question 6

[5 marks] Read the input one line at a time and output the current line if and only if it is not a suffix of some previous line. For example, if the some line is "0xdeadbeef" and some subsequent line is "beef", then the subsequent line should not be output.

Template code

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Part6 {
  
   /**
   * Your code goes here - see Part0 for an example
   * @param r the reader to read from
   * @param w the writer to write to
   * @throws IOException
   */
   public static void doIt(BufferedReader r, PrintWriter w) throws IOException {
       // Your code goes here - see Part0 for an example
   }

   /**
   * The driver. Open a BufferedReader and a PrintWriter, either from System.in
   * and System.out or from filenames specified on the command line, then call doIt.
   * @param args
   */
   public static void main(String[] args) {
       try {
           BufferedReader r;
           PrintWriter w;
           if (args.length == 0) {
               r = new BufferedReader(new InputStreamReader(System.in));
               w = new PrintWriter(System.out);
           } else if (args.length == 1) {
               r = new BufferedReader(new FileReader(args[0]));
               w = new PrintWriter(System.out);              
           } else {
               r = new BufferedReader(new FileReader(args[0]));
               w = new PrintWriter(new FileWriter(args[1]));
           }
           long start = System.nanoTime();
           doIt(r, w);
           w.flush();
           long stop = System.nanoTime();
           System.out.println("Execution time: " + 10e-9 * (stop-start));
       } catch (IOException e) {
           System.err.println(e);
           System.exit(-1);
       }
   }
}

In: Computer Science

Explain how Franklin Roosevelt and the New Deal attempted to solve the Great Depression. Who supported...

Explain how Franklin Roosevelt and the New Deal attempted to solve the Great Depression. Who supported the New Deal? Who criticized it? In what ways did the New Deal succeed? In what ways did it fail? ESSAY QUESTION PLEASE ANSWER FULLY.

In: Psychology

The average tensile strength of carbon fiber cloth is 600 MPa. You are testing a new...

The average tensile strength of carbon fiber cloth is 600 MPa. You are testing a new weaving pattern for the carbon fiber threads and want to know if this new weave causes a difference in the tensile strength. After testing 18 samples of the new weave, you found a sample average of 585 MPa with a standard deviation of 34 MPa. At a significance level of 0.05, test to see if this new weave has a different mean than 600 MPa.

In: Statistics and Probability

5. A company is researching the effectiveness of a new website design to decrease the time...

5. A company is researching the effectiveness of a new website design to decrease the time to access a website. Five website users were randomly selected and their times (in seconds) to access the website with the old and new designs were recorded. The results follow.

  

Let α = 0.05. Is the mean time to access the new website design shorter, or is (time for the old design - time for the new design) greater than zero? Express your answer in terms of the null hypothesis.

In: Statistics and Probability

When new technologies arrive, only a few customers adopt such technologies. A large number of customer...

When new technologies arrive, only a few customers adopt such technologies. A large number of customer remain sceptical about the product. The cost of the new technology remain high. As a result it take long time for the businesses to focus on the new technology until the dominant design comes and the price become affordable by the large number of consumers. From your point of view, what might be the reasons established firms might resist adopting a new technology.

In: Computer Science

Second National Bank is considering adding 5 new ATM machines. Each machine costs $25,000 and installation...

Second National Bank is considering adding 5 new ATM machines. Each machine costs $25,000 and installation costs are $15,000 per machine. Second National Bank expects the new machines to save $0.33 per transaction on 250,000 transactions per year on the new machines. It also expects the new machines to last for 15 years. If the bank needs to earn 14 percent return on this investment, what is the net present value of this investment?

In: Finance