Program: 109980
Project: 109980
Buggy source:
public ArrayList<SurveyResponse> entropyBootstrap(Survey s,ArrayList<SurveyResponse> responses){
  double fraction=((double)responses.size()) / ((double)responses.size() - 1);
  double multiplier=Math.pow(fraction,responses.size());
  double numBootstraps=1000 * multiplier;
  int n=responses.size();
  final int THRESHOLD=5;
  Random r=new Random();
  ArrayList<Double> bootstrapStats=new ArrayList<Double>((int)numBootstraps);
  ArrayList<ArrayList<Double>> responseEntropies=new ArrayList<ArrayList<Double>>();
  for (int x=0; x < n; x++) {
    responseEntropies.add(new ArrayList<Double>());
  }
  boolean[] included;
  double entropy=0;
  for (int x=0; x < numBootstraps; x++) {
    included=new boolean[n];
    ArrayList<SurveyResponse> temp=new ArrayList<SurveyResponse>();
    for (int y=0; y < n; y++) {
      int randIndex=r.nextInt(n);
      SurveyResponse sr=responses.get(randIndex);
      temp.add(sr);
      included[randIndex]=true;
    }
    entropy=surveyEntropy(s,temp);
    bootstrapStats.add(entropy);
    for (int z=0; z < n; z++) {
      if (!included[z])       responseEntropies.get(z).add(entropy);
    }
  }
  double bootstrapMean=Stat.mean(bootstrapStats);
  double bootstrapSD=Stat.stddev(bootstrapStats);
  double responseMean=0;
  double responseSD=0;
  double t;
  ArrayList<SurveyResponse> outliers=new ArrayList<SurveyResponse>();
  for (int x=0; x < n; x++) {
    responseMean=Stat.mean(responseEntropies.get(x));
    responseSD=Stat.stddev(responseEntropies.get(x));
    t=(bootstrapMean - responseMean) / Math.sqrt((Math.pow(bootstrapSD,2)) / n + (Math.pow(responseSD,2)) / responseEntropies.get(x).size());
    if (t > THRESHOLD)     outliers.add(responses.get(x));
  }
  return responses;
}

Fixed version (ground truth):
public ArrayList<SurveyResponse> entropyBootstrap(Survey s,ArrayList<SurveyResponse> responses){
  double fraction=((double)responses.size()) / ((double)responses.size() - 1);
  double multiplier=Math.pow(fraction,responses.size());
  double numBootstraps=10000 * multiplier;
  int n=responses.size();
  final int THRESHOLD=5;
  System.out.println(numBootstraps);
  System.out.println();
  Random r=new Random();
  ArrayList<Double> bootstrapStats=new ArrayList<Double>((int)numBootstraps);
  ArrayList<ArrayList<Double>> responseEntropies=new ArrayList<ArrayList<Double>>();
  for (int x=0; x < n; x++) {
    responseEntropies.add(new ArrayList<Double>());
  }
  boolean[] included;
  double entropy=0;
  for (int x=0; x < numBootstraps; x++) {
    included=new boolean[n];
    ArrayList<SurveyResponse> temp=new ArrayList<SurveyResponse>();
    for (int y=0; y < n; y++) {
      int randIndex=r.nextInt(n);
      SurveyResponse sr=responses.get(randIndex);
      temp.add(sr);
      included[randIndex]=true;
    }
    entropy=surveyEntropy(s,temp);
    bootstrapStats.add(entropy);
    for (int z=0; z < n; z++) {
      if (!included[z])       responseEntropies.get(z).add(entropy);
    }
  }
  double bootstrapMean=Stat.mean(bootstrapStats);
  System.out.println("String_Node_Str" + bootstrapMean);
  double bootstrapSD=Stat.stddev(bootstrapStats);
  System.out.println("String_Node_Str" + bootstrapSD);
  double responseMean=0;
  double responseSD=0;
  double t;
  ArrayList<SurveyResponse> outliers=new ArrayList<SurveyResponse>();
  for (int x=0; x < n; x++) {
    responseMean=Stat.mean(responseEntropies.get(x));
    responseSD=Stat.stddev(responseEntropies.get(x));
    t=(bootstrapMean - responseMean) / Math.sqrt((Math.pow(bootstrapSD,2)) / n + (Math.pow(responseSD,2)) / responseEntropies.get(x).size());
    if (t > THRESHOLD)     outliers.add(responses.get(x));
  }
  return responses;
}