[1;36m╔══════════════════════════╗[0m
[1;33m║     Summarized Results   ║[0m
[1;36m╚══════════════════════════╝[0m
# Experimental Results Summary

Based on the provided experimental data, I've extracted the following information about sorting algorithm performance across different input distributions.

## Experiment Setup
- The experiment tested different sorting algorithms (Quick Sort, Merge Sort, Insertion Sort, Selection Sort, Heap Sort)
- Input distributions: random, nearly sorted, reverse sorted
- Array sizes varied across experiments (500, 5000, 10000 integers)
- Performance metrics: execution time (ms), number of comparisons, number of swaps

## Control Group
**Quick Sort on Random Distribution (10,000 integers, 100 runs)**
- Average Execution Time: 25.02 ms (Std Dev: 2.48 ms)
- Average Comparisons: 143,713.99 (Std Dev: 3,212.99)
- Average Swaps: 70,653.17 (Std Dev: 3,575.75)

## Experimental Group Results (10,000 integers, 100 runs)

**Quick Sort**:
- Nearly Sorted: 22.48 ms, 142,521.36 comparisons, 48,484.54 swaps
- Reverse Sorted: 28.23 ms, 176,390.00 comparisons, 71,890.00 swaps

**Merge Sort**:
- Random: 35.04 ms, 120,462.26 comparisons, 133,616.00 swaps
- Nearly Sorted: 32.16 ms, 107,337.54 comparisons, 133,616.00 swaps
- Reverse Sorted: 28.46 ms, 64,608.00 comparisons, 133,616.00 swaps

## Experimental Group (5,000 integers, 20 runs)

**Insertion Sort**:
- Random: 939.09 ms, 6,255,379.70 comparisons, 6,255,379.60 swaps
- Nearly Sorted: 61.09 ms, 410,729.70 comparisons, 410,685.75 swaps
- Reverse Sorted: 1,832.47 ms, 12,497,500.00 comparisons, 12,502,499.00 swaps

**Selection Sort**:
- Random: 1,164.00 ms, 12,497,500.00 comparisons, 4,990.50 swaps
- Nearly Sorted: 1,135.95 ms, 12,497,500.00 comparisons, 244.10 swaps

## Additional Results (500 integers, 5 runs)

**Quick Sort, Merge Sort, Insertion Sort, Selection Sort, and Heap Sort**
- Data was collected for each algorithm with all three distributions
- Smaller array size (500 integers) with fewer runs (5)
- Consistent metrics tracking (execution time, comparisons, swaps)

These results represent the raw experimental data collected to examine how different sorting algorithms perform across various input distributions.
[1;36m╔══════════════════════╗[0m
[1;33m║     Raw Results      ║[0m
[1;36m╚══════════════════════╝[0m
Here is the experimental plan
{'control_group': {'partition_1': {'independent_vars': [{'algorithm': 'Quick Sort', 'distribution': 'random'}], 'control_experiment_filename': '/workspace/research_d9264626-f3f9-4fd3-ac04-a916cb5f17df/control_experiment_d9264626-f3f9-4fd3-ac04-a916cb5f17df_control_group_partition_1.sh', 'control_experiment_results_filename': '/workspace/research_d9264626-f3f9-4fd3-ac04-a916cb5f17df/results_d9264626-f3f9-4fd3-ac04-a916cb5f17df_control_group_partition_1.txt', 'all_control_experiment_results_filename': '/workspace/research_d9264626-f3f9-4fd3-ac04-a916cb5f17df/all_results_d9264626-f3f9-4fd3-ac04-a916cb5f17df_control_group_partition_1.txt', 'done': True}}, 'experimental_group': {'partition_1': {'independent_vars': [{'algorithm': 'Quick Sort', 'distribution': 'nearly sorted'}, {'algorithm': 'Quick Sort', 'distribution': 'reverse sorted'}, {'algorithm': 'Merge Sort', 'distribution': 'random'}, {'algorithm': 'Merge Sort', 'distribution': 'nearly sorted'}, {'algorithm': 'Merge Sort', 'distribution': 'reverse sorted'}], 'control_experiment_filename': '/workspace/research_d9264626-f3f9-4fd3-ac04-a916cb5f17df/control_experiment_d9264626-f3f9-4fd3-ac04-a916cb5f17df_experimental_group_partition_1.sh', 'control_experiment_results_filename': '/workspace/research_d9264626-f3f9-4fd3-ac04-a916cb5f17df/results_d9264626-f3f9-4fd3-ac04-a916cb5f17df_experimental_group_partition_1.txt', 'all_control_experiment_results_filename': '/workspace/research_d9264626-f3f9-4fd3-ac04-a916cb5f17df/all_results_d9264626-f3f9-4fd3-ac04-a916cb5f17df_experimental_group_partition_1.txt', 'done': True}, 'partition_2': {'independent_vars': [{'algorithm': 'Insertion Sort', 'distribution': 'random'}, {'algorithm': 'Insertion Sort', 'distribution': 'nearly sorted'}, {'algorithm': 'Insertion Sort', 'distribution': 'reverse sorted'}, {'algorithm': 'Selection Sort', 'distribution': 'random'}, {'algorithm': 'Selection Sort', 'distribution': 'nearly sorted'}], 'control_experiment_filename': '/workspace/research_d9264626-f3f9-4fd3-ac04-a916cb5f17df/control_experiment_d9264626-f3f9-4fd3-ac04-a916cb5f17df_experimental_group_partition_2.sh', 'control_experiment_results_filename': '/workspace/research_d9264626-f3f9-4fd3-ac04-a916cb5f17df/results_d9264626-f3f9-4fd3-ac04-a916cb5f17df_experimental_group_partition_2.txt', 'all_control_experiment_results_filename': '', 'done': True}, 'partition_3': {'independent_vars': [{'algorithm': 'Selection Sort', 'distribution': 'reverse sorted'}, {'algorithm': 'Heap Sort', 'distribution': 'random'}, {'algorithm': 'Heap Sort', 'distribution': 'nearly sorted'}, {'algorithm': 'Heap Sort', 'distribution': 'reverse sorted'}], 'control_experiment_filename': '', 'control_experiment_results_filename': '', 'all_control_experiment_results_filename': '', 'done': False}}, 'question': 'How does the choice of sorting algorithm impact runtime performance across different   input distributions (random, nearly sorted, reverse sorted)?', 'workspace_dir': '/workspace/research_d9264626-f3f9-4fd3-ac04-a916cb5f17df', 'hypothesis': 'Different sorting algorithms exhibit significantly different runtime performance characteristics depending on the input distribution (random, nearly sorted, reverse sorted).', 'constant_vars': ['hardware environment', 'programming language implementation', 'array size per test (10,000 elements)', 'number of test iterations (100)'], 'independent_vars': ['sorting algorithm type', 'input distribution type'], 'dependent_vars': ['execution time (milliseconds)', 'number of comparisons', 'number of swaps'], 'controlled_experiment_setup_description': 'Create arrays of 10,000 integers with three different distributions: random, nearly sorted (95% in correct position), and reverse sorted. Run each sorting algorithm on each distribution 100 times to collect reliable performance metrics. Measure execution time, number of comparisons, and number of swaps for each run.', 'priority': 1, 'plan_id': 'd9264626-f3f9-4fd3-ac04-a916cb5f17df', 'dataset_dir': None}

Here are the actual results of the experiments: 

# Sorting Algorithm Performance Experiment Results

# Control Group (Partition 1)

# Quick Sort on Random Distribution (10,000 integers)

# 100 runs



Algorithm: Quick Sort

Distribution: random

Average Execution Time: 25.02 ms

Std Dev Execution Time: 2.48 ms

Average Comparisons: 143713.99

Std Dev Comparisons: 3212.99

Average Swaps: 70653.17

Std Dev Swaps: 3575.75

# Comprehensive Sorting Algorithm Performance Experiment Results

# Array Size: 500 integers

# 5 runs per experiment



Algorithm: Quick Sort

Distribution: random

Average Execution Time: 1.76 ms

Std Dev Execution Time: 0.09 ms

Average Comparisons: 4641.20

Std Dev Comparisons: 197.40

Average Swaps: 2297.40

Std Dev Swaps: 264.39



Algorithm: Quick Sort

Distribution: nearly_sorted

Average Execution Time: 1.49 ms

Std Dev Execution Time: 0.04 ms

Average Comparisons: 4483.20

Std Dev Comparisons: 113.10

Average Swaps: 1260.00

Std Dev Swaps: 53.99



Algorithm: Quick Sort

Distribution: reverse_sorted

Average Execution Time: 1.82 ms

Std Dev Execution Time: 0.00 ms

Average Comparisons: 5149.00

Std Dev Comparisons: 0.00

Average Swaps: 2198.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: random

Average Execution Time: 2.55 ms

Std Dev Execution Time: 0.04 ms

Average Comparisons: 3842.80

Std Dev Comparisons: 8.57

Average Swaps: 4488.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: nearly_sorted

Average Execution Time: 1.74 ms

Std Dev Execution Time: 0.57 ms

Average Comparisons: 2980.40

Std Dev Comparisons: 82.17

Average Swaps: 4488.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: reverse_sorted

Average Execution Time: 0.98 ms

Std Dev Execution Time: 0.01 ms

Average Comparisons: 2216.00

Std Dev Comparisons: 0.00

Average Swaps: 4488.00

Std Dev Swaps: 0.00



Algorithm: Insertion Sort

Distribution: random

Average Execution Time: 9.22 ms

Std Dev Execution Time: 0.34 ms

Average Comparisons: 61319.40

Std Dev Comparisons: 1003.35

Average Swaps: 61317.80

Std Dev Swaps: 1002.84



Algorithm: Insertion Sort

Distribution: nearly_sorted

Average Execution Time: 1.07 ms

Std Dev Execution Time: 0.12 ms

Average Comparisons: 4410.20

Std Dev Comparisons: 532.58

Average Swaps: 4362.80

Std Dev Swaps: 533.30



Algorithm: Insertion Sort

Distribution: reverse_sorted

Average Execution Time: 18.03 ms

Std Dev Execution Time: 0.88 ms

Average Comparisons: 124750.00

Std Dev Comparisons: 0.00

Average Swaps: 125249.00

Std Dev Swaps: 0.00



Algorithm: Selection Sort

Distribution: random

Average Execution Time: 12.08 ms

Std Dev Execution Time: 0.81 ms

Average Comparisons: 124750.00

Std Dev Comparisons: 0.00

Average Swaps: 492.60

Std Dev Swaps: 2.58



Algorithm: Selection Sort

Distribution: nearly_sorted

Average Execution Time: 10.88 ms

Std Dev Execution Time: 0.04 ms

Average Comparisons: 124750.00

Std Dev Comparisons: 0.00

Average Swaps: 20.80

Std Dev Swaps: 2.23



Algorithm: Selection Sort

Distribution: reverse_sorted

Average Execution Time: 11.39 ms

Std Dev Execution Time: 0.07 ms

Average Comparisons: 124750.00

Std Dev Comparisons: 0.00

Average Swaps: 250.00

Std Dev Swaps: 0.00



Algorithm: Heap Sort

Distribution: random

Average Execution Time: 1.33 ms

Std Dev Execution Time: 0.07 ms

Average Comparisons: 7428.20

Std Dev Comparisons: 20.60

Average Swaps: 4054.60

Std Dev Swaps: 12.85



Algorithm: Heap Sort

Distribution: nearly_sorted

Average Execution Time: 1.34 ms

Std Dev Execution Time: 0.01 ms

Average Comparisons: 7724.20

Std Dev Comparisons: 3.97

Average Swaps: 4318.80

Std Dev Swaps: 7.76



Algorithm: Heap Sort

Distribution: reverse_sorted

Average Execution Time: 1.14 ms

Std Dev Execution Time: 0.02 ms

Average Comparisons: 7010.00

Std Dev Comparisons: 0.00

Average Swaps: 3676.00

Std Dev Swaps: 0.00





Here are the results from 2 separate runs of this workflow:



Result 1:

# Sorting Algorithm Performance Experiment Results

# Control Group (Partition 1)

# Quick Sort on Random Distribution (10,000 integers)

# 100 runs



Algorithm: Quick Sort

Distribution: random

Average Execution Time: 24.93 ms

Std Dev Execution Time: 2.53 ms

Average Comparisons: 143713.99

Std Dev Comparisons: 3212.99

Average Swaps: 70653.17

Std Dev Swaps: 3575.75





Result 2:

# Sorting Algorithm Performance Experiment Results

# Control Group (Partition 1)

# Quick Sort on Random Distribution (10,000 integers)

# 100 runs



Algorithm: Quick Sort

Distribution: random

Average Execution Time: 25.02 ms

Std Dev Execution Time: 2.48 ms

Average Comparisons: 143713.99

Std Dev Comparisons: 3212.99

Average Swaps: 70653.17

Std Dev Swaps: 3575.75



# Sorting Algorithm Performance Experiment Results

# Experimental Group (Partition 1)

# Array Size: 10,000 integers

# Number of Runs: 100



Algorithm: Quick Sort

Distribution: nearly_sorted

Average Execution Time: 22.48 ms

Std Dev Execution Time: 2.86 ms

Average Comparisons: 142521.36

Std Dev Comparisons: 3430.59

Average Swaps: 48484.54

Std Dev Swaps: 1773.49



Algorithm: Quick Sort

Distribution: reverse_sorted

Average Execution Time: 28.23 ms

Std Dev Execution Time: 1.36 ms

Average Comparisons: 176390.00

Std Dev Comparisons: 0.00

Average Swaps: 71890.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: random

Average Execution Time: 35.04 ms

Std Dev Execution Time: 1.64 ms

Average Comparisons: 120462.26

Std Dev Comparisons: 69.72

Average Swaps: 133616.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: nearly_sorted

Average Execution Time: 32.16 ms

Std Dev Execution Time: 1.46 ms

Average Comparisons: 107337.54

Std Dev Comparisons: 653.98

Average Swaps: 133616.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: reverse_sorted

Average Execution Time: 28.46 ms

Std Dev Execution Time: 1.64 ms

Average Comparisons: 64608.00

Std Dev Comparisons: 0.00

Average Swaps: 133616.00

Std Dev Swaps: 0.00





Here are the results from 2 separate runs of this workflow:



Result 1:

# Sorting Algorithm Performance Experiment Results

# Experimental Group (Partition 1)

# Array Size: 10,000 integers

# Number of Runs: 100



Algorithm: Quick Sort

Distribution: nearly_sorted

Average Execution Time: 22.70 ms

Std Dev Execution Time: 3.10 ms

Average Comparisons: 142521.36

Std Dev Comparisons: 3430.59

Average Swaps: 48484.54

Std Dev Swaps: 1773.49



Algorithm: Quick Sort

Distribution: reverse_sorted

Average Execution Time: 28.79 ms

Std Dev Execution Time: 1.63 ms

Average Comparisons: 176390.00

Std Dev Comparisons: 0.00

Average Swaps: 71890.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: random

Average Execution Time: 34.40 ms

Std Dev Execution Time: 1.39 ms

Average Comparisons: 120462.26

Std Dev Comparisons: 69.72

Average Swaps: 133616.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: nearly_sorted

Average Execution Time: 31.75 ms

Std Dev Execution Time: 1.72 ms

Average Comparisons: 107337.54

Std Dev Comparisons: 653.98

Average Swaps: 133616.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: reverse_sorted

Average Execution Time: 28.07 ms

Std Dev Execution Time: 1.43 ms

Average Comparisons: 64608.00

Std Dev Comparisons: 0.00

Average Swaps: 133616.00

Std Dev Swaps: 0.00







Result 2:

# Sorting Algorithm Performance Experiment Results

# Experimental Group (Partition 1)

# Array Size: 10,000 integers

# Number of Runs: 100



Algorithm: Quick Sort

Distribution: nearly_sorted

Average Execution Time: 22.48 ms

Std Dev Execution Time: 2.86 ms

Average Comparisons: 142521.36

Std Dev Comparisons: 3430.59

Average Swaps: 48484.54

Std Dev Swaps: 1773.49



Algorithm: Quick Sort

Distribution: reverse_sorted

Average Execution Time: 28.23 ms

Std Dev Execution Time: 1.36 ms

Average Comparisons: 176390.00

Std Dev Comparisons: 0.00

Average Swaps: 71890.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: random

Average Execution Time: 35.04 ms

Std Dev Execution Time: 1.64 ms

Average Comparisons: 120462.26

Std Dev Comparisons: 69.72

Average Swaps: 133616.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: nearly_sorted

Average Execution Time: 32.16 ms

Std Dev Execution Time: 1.46 ms

Average Comparisons: 107337.54

Std Dev Comparisons: 653.98

Average Swaps: 133616.00

Std Dev Swaps: 0.00



Algorithm: Merge Sort

Distribution: reverse_sorted

Average Execution Time: 28.46 ms

Std Dev Execution Time: 1.64 ms

Average Comparisons: 64608.00

Std Dev Comparisons: 0.00

Average Swaps: 133616.00

Std Dev Swaps: 0.00





# Sorting Algorithm Performance Experiment Results

# Experimental Group (Partition 2)

# Array Size: 5000 integers

# Number of Runs: 20



Algorithm: Insertion Sort

Distribution: random

Average Execution Time: 939.09 ms

Std Dev Execution Time: 25.97 ms

Average Comparisons: 6255379.70

Std Dev Comparisons: 64554.07

Average Swaps: 6255379.60

Std Dev Swaps: 64553.86



Algorithm: Insertion Sort

Distribution: nearly_sorted

Average Execution Time: 61.09 ms

Std Dev Execution Time: 2.56 ms

Average Comparisons: 410729.70

Std Dev Comparisons: 16546.73

Average Swaps: 410685.75

Std Dev Swaps: 16549.67



Algorithm: Insertion Sort

Distribution: reverse_sorted

Average Execution Time: 1832.47 ms

Std Dev Execution Time: 24.79 ms

Average Comparisons: 12497500.00

Std Dev Comparisons: 0.00

Average Swaps: 12502499.00

Std Dev Swaps: 0.00



Algorithm: Selection Sort

Distribution: random

Average Execution Time: 1164.00 ms

Std Dev Execution Time: 24.43 ms

Average Comparisons: 12497500.00

Std Dev Comparisons: 0.00

Average Swaps: 4990.50

Std Dev Swaps: 2.38



Algorithm: Selection Sort

Distribution: nearly_sorted

Average Execution Time: 1135.95 ms

Std Dev Execution Time: 6.11 ms

Average Comparisons: 12497500.00

Std Dev Comparisons: 0.00

Average Swaps: 244.10

Std Dev Swaps: 2.26


