In: Statistics and Probability
You have an experiment with 7 factors (ABCDEFG). The design would be run in 8 blocks. When you know that CDEF, ABC, CDEF are generators 1) define the blocks regarding your generators.
2) define which block contain these treatments: bd,bdeg, def, abcdg.
3) Write the defining relationship and alias relationship for A.
4) Are these generators good? Why?
Main Class
--------------------------------------------------
import java.util.Scanner;
import java.util.ArrayList;
import java.io.FileNotFoundException;
import java.io.File;
import java.io.PrintWriter;
public class Main {
public static void main(String[] args) throws
FileNotFoundException {
Main mainObject = new
Main();
mainObject.run();
}
private void run() throws FileNotFoundException {
final String UP =
"RunsUp";
final String DOWN =
"RunsDown";
ArrayList<Integer> list = inFileToList("p01-in.txt");
ArrayList<Integer> listRunsUpCount = new
ArrayList<>();
ArrayList<Integer>
listRunsDnCount = new ArrayList<>();
ArrayList<Integer>
listRunsCount = new ArrayList<>();
listRunsUpCount =
findRuns(list, UP);
listRunsDnCount =
findRuns(list, DOWN);
listRunsCount =
merge(listRunsUpCount, listRunsDnCount);
output("p01-runs.txt",
listRunsCount);
}
/**
* This method creates an ArrayList
object.
*/
public static ArrayList<Integer>
arrayListCreate(int pSize, int pInitValue) {
ArrayList<Integer>
list = new ArrayList<>();
for (int i = 0; i <
pSize; i++) {
list.add(pInitValue);
}
return list;
}
/**
* This method reads a file and puts
integers into an ArrayList object.
*/
public static ArrayList<Integer>
inFileToList(String fileToParse) throws FileNotFoundException
{
ArrayList<Integer>
listOfIntegers = new ArrayList<>();
File fileInput = new
File(fileToParse);
Scanner scan = new
Scanner(fileInput);
while
(scan.hasNextInt()) {
listOfIntegers.add(scan.nextInt());
}