Index: /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.Designer.cs
===================================================================
--- /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.Designer.cs	(revision 11669)
+++ /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.Designer.cs	(revision 11670)
@@ -46,6 +46,6 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
-      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SampleSizeInfluenceView));
       this.xAxisLabel = new System.Windows.Forms.Label();
@@ -55,6 +55,9 @@
       this.noRunsLabel = new System.Windows.Forms.Label();
       this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.hypergeometricCheckBox = new System.Windows.Forms.CheckBox();
+      this.label1 = new System.Windows.Forms.Label();
+      this.RecalculateButton = new System.Windows.Forms.Button();
       this.sampleSizeTextBox = new System.Windows.Forms.TextBox();
-      this.xAxisComboBox = new System.Windows.Forms.TextBox();
+      this.xAxisTextBox = new System.Windows.Forms.TextBox();
       this.defineSampleSizeButton = new System.Windows.Forms.Button();
       this.showStatisticsCheckBox = new System.Windows.Forms.CheckBox();
@@ -62,5 +65,4 @@
       this.statisticsMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
       this.tooltip = new System.Windows.Forms.ToolTip(this.components);
-      this.label1 = new System.Windows.Forms.Label();
       ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
@@ -75,5 +77,5 @@
       this.xAxisLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
       this.xAxisLabel.AutoSize = true;
-      this.xAxisLabel.Location = new System.Drawing.Point(139, 256);
+      this.xAxisLabel.Location = new System.Drawing.Point(438, 277);
       this.xAxisLabel.Name = "xAxisLabel";
       this.xAxisLabel.Size = new System.Drawing.Size(62, 13);
@@ -106,16 +108,16 @@
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-      chartArea1.Name = "ChartArea1";
-      this.chart.ChartAreas.Add(chartArea1);
+      chartArea2.Name = "ChartArea1";
+      this.chart.ChartAreas.Add(chartArea2);
       this.chart.Location = new System.Drawing.Point(6, 30);
       this.chart.Name = "chart";
-      series1.ChartArea = "ChartArea1";
-      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.BoxPlot;
-      series1.IsVisibleInLegend = false;
-      series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
-      series1.Name = "DataSeries";
-      series1.YValuesPerPoint = 6;
-      this.chart.Series.Add(series1);
-      this.chart.Size = new System.Drawing.Size(534, 217);
+      series2.ChartArea = "ChartArea1";
+      series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.BoxPlot;
+      series2.IsVisibleInLegend = false;
+      series2.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
+      series2.Name = "DataSeries";
+      series2.YValuesPerPoint = 6;
+      this.chart.Series.Add(series2);
+      this.chart.Size = new System.Drawing.Size(833, 238);
       this.chart.TabIndex = 17;
       this.chart.Text = "chart";
@@ -127,5 +129,5 @@
       this.noRunsLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
       this.noRunsLabel.AutoSize = true;
-      this.noRunsLabel.Location = new System.Drawing.Point(212, 122);
+      this.noRunsLabel.Location = new System.Drawing.Point(361, 133);
       this.noRunsLabel.Name = "noRunsLabel";
       this.noRunsLabel.Size = new System.Drawing.Size(138, 13);
@@ -142,6 +144,9 @@
       // splitContainer.Panel1
       // 
+      this.splitContainer.Panel1.Controls.Add(this.hypergeometricCheckBox);
+      this.splitContainer.Panel1.Controls.Add(this.label1);
+      this.splitContainer.Panel1.Controls.Add(this.RecalculateButton);
       this.splitContainer.Panel1.Controls.Add(this.sampleSizeTextBox);
-      this.splitContainer.Panel1.Controls.Add(this.xAxisComboBox);
+      this.splitContainer.Panel1.Controls.Add(this.xAxisTextBox);
       this.splitContainer.Panel1.Controls.Add(this.defineSampleSizeButton);
       this.splitContainer.Panel1.Controls.Add(this.showStatisticsCheckBox);
@@ -155,31 +160,61 @@
       // 
       this.splitContainer.Panel2.Controls.Add(this.statisticsGroupBox);
-      this.splitContainer.Size = new System.Drawing.Size(543, 416);
-      this.splitContainer.SplitterDistance = 277;
+      this.splitContainer.Size = new System.Drawing.Size(851, 447);
+      this.splitContainer.SplitterDistance = 297;
       this.splitContainer.TabIndex = 23;
       // 
+      // hypergeometricCheckBox
+      // 
+      this.hypergeometricCheckBox.AutoSize = true;
+      this.hypergeometricCheckBox.Location = new System.Drawing.Point(332, 7);
+      this.hypergeometricCheckBox.Name = "hypergeometricCheckBox";
+      this.hypergeometricCheckBox.Size = new System.Drawing.Size(100, 17);
+      this.hypergeometricCheckBox.TabIndex = 28;
+      this.hypergeometricCheckBox.Text = "Hypergeometric";
+      this.hypergeometricCheckBox.UseVisualStyleBackColor = true;
+      this.hypergeometricCheckBox.CheckedChanged += new System.EventHandler(this.hypergeometricCheckBox_CheckedChanged);
+      // 
+      // label1
+      // 
+      this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.label1.AutoSize = true;
+      this.label1.Location = new System.Drawing.Point(566, 6);
+      this.label1.Name = "label1";
+      this.label1.Size = new System.Drawing.Size(143, 13);
+      this.label1.TabIndex = 26;
+      this.label1.Text = "Recommended Sample Size:";
+      // 
+      // RecalculateButton
+      // 
+      this.RecalculateButton.Location = new System.Drawing.Point(251, 3);
+      this.RecalculateButton.Name = "RecalculateButton";
+      this.RecalculateButton.Size = new System.Drawing.Size(75, 23);
+      this.RecalculateButton.TabIndex = 27;
+      this.RecalculateButton.Text = "Recalculate";
+      this.RecalculateButton.UseVisualStyleBackColor = true;
+      this.RecalculateButton.Click += new System.EventHandler(this.RecalculateButton_Click);
+      // 
       // sampleSizeTextBox
       // 
-      this.sampleSizeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-      this.sampleSizeTextBox.Location = new System.Drawing.Point(400, 3);
+      this.sampleSizeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.sampleSizeTextBox.Location = new System.Drawing.Point(724, 3);
       this.sampleSizeTextBox.Name = "sampleSizeTextBox";
       this.sampleSizeTextBox.ReadOnly = true;
-      this.sampleSizeTextBox.Size = new System.Drawing.Size(140, 20);
+      this.sampleSizeTextBox.Size = new System.Drawing.Size(124, 20);
       this.sampleSizeTextBox.TabIndex = 26;
       // 
-      // xAxisComboBox
-      // 
-      this.xAxisComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-      this.xAxisComboBox.Location = new System.Drawing.Point(207, 253);
-      this.xAxisComboBox.Name = "xAxisComboBox";
-      this.xAxisComboBox.Size = new System.Drawing.Size(238, 20);
-      this.xAxisComboBox.TabIndex = 25;
-      this.xAxisComboBox.TextChanged += new System.EventHandler(this.xAxisComboBox_TextChanged);
+      // xAxisTextBox
+      // 
+      this.xAxisTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+      this.xAxisTextBox.Location = new System.Drawing.Point(506, 274);
+      this.xAxisTextBox.Name = "xAxisTextBox";
+      this.xAxisTextBox.Size = new System.Drawing.Size(238, 20);
+      this.xAxisTextBox.TabIndex = 25;
+      this.xAxisTextBox.TextChanged += new System.EventHandler(this.xAxisTextBox_TextChanged);
       // 
       // defineSampleSizeButton
       // 
       this.defineSampleSizeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-      this.defineSampleSizeButton.Location = new System.Drawing.Point(451, 252);
+      this.defineSampleSizeButton.Location = new System.Drawing.Point(750, 273);
       this.defineSampleSizeButton.Name = "defineSampleSizeButton";
       this.defineSampleSizeButton.Size = new System.Drawing.Size(89, 21);
@@ -196,5 +231,5 @@
       this.showStatisticsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
       this.showStatisticsCheckBox.Image = HeuristicLab.Common.Resources.VSImageLibrary.Properties;
-      this.showStatisticsCheckBox.Location = new System.Drawing.Point(6, 245);
+      this.showStatisticsCheckBox.Location = new System.Drawing.Point(6, 267);
       this.showStatisticsCheckBox.Name = "showStatisticsCheckBox";
       this.showStatisticsCheckBox.Size = new System.Drawing.Size(24, 24);
@@ -212,5 +247,5 @@
       this.statisticsGroupBox.Location = new System.Drawing.Point(3, 3);
       this.statisticsGroupBox.Name = "statisticsGroupBox";
-      this.statisticsGroupBox.Size = new System.Drawing.Size(534, 129);
+      this.statisticsGroupBox.Size = new System.Drawing.Size(833, 141);
       this.statisticsGroupBox.TabIndex = 1;
       this.statisticsGroupBox.TabStop = false;
@@ -227,15 +262,6 @@
       this.statisticsMatrixView.ShowRowsAndColumnsTextBox = false;
       this.statisticsMatrixView.ShowStatisticalInformation = false;
-      this.statisticsMatrixView.Size = new System.Drawing.Size(528, 110);
+      this.statisticsMatrixView.Size = new System.Drawing.Size(827, 122);
       this.statisticsMatrixView.TabIndex = 0;
-      // 
-      // label1
-      // 
-      this.label1.AutoSize = true;
-      this.label1.Location = new System.Drawing.Point(251, 6);
-      this.label1.Name = "label1";
-      this.label1.Size = new System.Drawing.Size(143, 13);
-      this.label1.TabIndex = 26;
-      this.label1.Text = "Recommended Sample Size:";
       // 
       // SampleSizeInfluenceView
@@ -244,8 +270,7 @@
       this.BackColor = System.Drawing.SystemColors.Window;
       this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-      this.Controls.Add(this.label1);
       this.Controls.Add(this.splitContainer);
       this.Name = "SampleSizeInfluenceView";
-      this.Size = new System.Drawing.Size(543, 416);
+      this.Size = new System.Drawing.Size(851, 447);
       ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
       this.splitContainer.Panel1.ResumeLayout(false);
@@ -256,5 +281,4 @@
       this.statisticsGroupBox.ResumeLayout(false);
       this.ResumeLayout(false);
-      this.PerformLayout();
 
     }
@@ -273,7 +297,9 @@
     protected System.Windows.Forms.CheckBox showStatisticsCheckBox;
     private System.Windows.Forms.Button defineSampleSizeButton;
-    private System.Windows.Forms.TextBox xAxisComboBox;
+    private System.Windows.Forms.TextBox xAxisTextBox;
     private System.Windows.Forms.Label label1;
     private System.Windows.Forms.TextBox sampleSizeTextBox;
+    private System.Windows.Forms.Button RecalculateButton;
+    private System.Windows.Forms.CheckBox hypergeometricCheckBox;
   }
 }
Index: /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.cs
===================================================================
--- /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.cs	(revision 11669)
+++ /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.cs	(revision 11670)
@@ -208,8 +208,9 @@
     }
 
-    private void UpdateSampleSizes() {
+    private void UpdateSampleSizes(bool forceUpdate = false) {
       string selectedYAxis = (string)this.yAxisComboBox.SelectedItem;
 
-      if (selectedYAxis != null && xAxisComboBox.Text.Trim() == string.Empty) {
+      if (selectedYAxis != null && (xAxisTextBox.Text.Trim() == string.Empty || forceUpdate)) {
+        xAxisTextBox.Clear();
         List<double> values = new List<double>();
         foreach (IRun run in Content.Where(x => x.Visible)) {
@@ -221,9 +222,14 @@
 
         if (values.Count() > 0) {
-          xAxisComboBox.Text = "1; ";
-          xAxisComboBox.Text += ((int)(values.Count() / 4)).ToString() + "; ";
-          xAxisComboBox.Text += ((int)(values.Count() / 2)).ToString() + "; ";
-          xAxisComboBox.Text += ((int)(values.Count() / 4 * 3)).ToString() + "; ";
-          xAxisComboBox.Text += ((int)(values.Count())).ToString();
+          if (hypergeometricCheckBox.Checked) {
+            xAxisTextBox.Text += ((int)(values.Count() / 16)).ToString() + "; ";
+            xAxisTextBox.Text += ((int)(values.Count() / 8)).ToString() + "; ";
+            xAxisTextBox.Text += ((int)(values.Count() / 4)).ToString();
+          } else {
+            xAxisTextBox.Text += ((int)(values.Count() / 4)).ToString() + "; ";
+            xAxisTextBox.Text += ((int)(values.Count() / 2)).ToString() + "; ";
+            xAxisTextBox.Text += ((int)(values.Count() / 4 * 3)).ToString() + "; ";
+            xAxisTextBox.Text += ((int)(values.Count())).ToString();
+          }
         }
       }
@@ -232,5 +238,5 @@
     private void UpdateComboBoxes() {
       string selectedYAxis = (string)this.yAxisComboBox.SelectedItem;
-      this.xAxisComboBox.Text = string.Empty;
+      this.xAxisTextBox.Text = string.Empty;
       this.yAxisComboBox.Items.Clear();
       if (Content != null) {
@@ -252,19 +258,10 @@
       if (Content != null) {
         var usableRuns = Content.Where(r => r.Visible).ToList();
-        Random rand = new Random();
-
-        List<int> groupSizes = ParseGroupSizesFromText(xAxisComboBox.Text);
-        foreach (int gs in groupSizes) {
-          int idx = gs;
-          List<IRun> runGroup = new List<IRun>();
-          if (idx > usableRuns.Count()) {
-            idx = usableRuns.Count();
-          }
-
-          for (int i = 0; i < idx; i++) {
-            int r = rand.Next(usableRuns.Count());
-            runGroup.Add(usableRuns[r]);
-          }
-          runGroup.ForEach(x => AddDataPoint(x, idx));
+        List<int> groupSizes = ParseGroupSizesFromText(xAxisTextBox.Text);
+
+        if (hypergeometricCheckBox.Checked) {
+          CalculateGroupsHypergeometric(usableRuns, groupSizes);
+        } else {
+          CalculateGroups(usableRuns, groupSizes);
         }
 
@@ -285,4 +282,42 @@
       }
       UpdateNoRunsVisibleLabel();
+    }
+
+    private void CalculateGroups(List<IRun> usableRuns, List<int> groupSizes) {
+      Random rand = new Random();
+
+      foreach (int gs in groupSizes) {
+        int idx = gs;
+        List<IRun> runGroup = new List<IRun>();
+        if (idx > usableRuns.Count()) {
+          idx = usableRuns.Count();
+        }
+
+        for (int i = 0; i < idx; i++) {
+          int r = rand.Next(usableRuns.Count());
+          runGroup.Add(usableRuns[r]);
+        }
+        runGroup.ForEach(x => AddDataPoint(x, idx));
+      }
+    }
+
+    private void CalculateGroupsHypergeometric(List<IRun> usableRuns, List<int> groupSizes) {
+      Random rand = new Random();
+      var runs = new List<IRun>(usableRuns);
+
+      foreach (int gs in groupSizes) {
+        int idx = gs;
+        List<IRun> runGroup = new List<IRun>();
+        if (idx > runs.Count()) {
+          idx = runs.Count();
+        }
+
+        for (int i = 0; i < idx; i++) {
+          int r = rand.Next(runs.Count());
+          runGroup.Add(runs[r]);
+          runs.Remove(runs[r]);
+        }
+        runGroup.ForEach(x => AddDataPoint(x, idx));
+      }
     }
 
@@ -333,5 +368,5 @@
         if (datapoint != null) {
           IRun run = (IRun)datapoint.Tag;
-          string selectedAxis = xAxisComboBox.Text;
+          string selectedAxis = xAxisTextBox.Text;
           IItem value = null;
 
@@ -482,4 +517,13 @@
         splitContainer.Panel2Collapsed = true;
       }
+    }
+
+    private void RecalculateButton_Click(object sender, EventArgs e) {
+      UpdateDataPoints();
+    }
+
+    private void hypergeometricCheckBox_CheckedChanged(object sender, EventArgs e) {
+      UpdateSampleSizes(true);
+      UpdateDataPoints();
     }
 
@@ -569,5 +613,5 @@
     private void defineSampleSizeButton_Click(object sender, EventArgs e) {
       int min = 0, max = 0, step = 1;
-      var groupSizes = ParseGroupSizesFromText(xAxisComboBox.Text);
+      var groupSizes = ParseGroupSizesFromText(xAxisTextBox.Text);
       if (groupSizes.Count() > 0) {
         min = groupSizes.Min();
@@ -582,11 +626,11 @@
             newVals += v + "; ";
           }
-          xAxisComboBox.Text = newVals;
-        }
-      }
-    }
-
-    private void xAxisComboBox_TextChanged(object sender, EventArgs e) {
-      var result = ParseGroupSizesFromText(xAxisComboBox.Text, false);
+          xAxisTextBox.Text = newVals;
+        }
+      }
+    }
+
+    private void xAxisTextBox_TextChanged(object sender, EventArgs e) {
+      var result = ParseGroupSizesFromText(xAxisTextBox.Text, false);
 
       if (seriesCache.Count() == result.Count()) {
