ZorakBane
Smash Journeyman
================
Hypothesis 1
================
You should clear out garbage throws as to "set up" for a 9.
================
RESULTS
================
Clearing out garbage throws will always give you approx 14.30% chance of hitting a 9
1/7 is approx 14.28
================
DATA
================
the extra %'s are mulitple runs
How many throws per life?
1
How many lives do you want to test?
160000
How many times do you want to test?
8
After 1280000 throws Average = 14.25% 14.33% 14.32%
How many throws per life?
2
How many lives do you want to test?
80000
How many times do you want to test?
8
After 1280000 throws Average = 14.29% 14.25% 14.27%
How many throws per life?
3
How many lives do you want to test?
53333
How many times do you want to test?
8
After 1279992 throws Average = 14.36% 14.31% 14.31%
How many throws per life?
4
How many lives do you want to test?
40000
How many times do you want to test?
8
After 1280000 throws Average = 14.27% 14.31% 14.40%
How many throws per life?
20
How many lives do you want to test?
8000
How many times do you want to test?
8
After 1280000 throws Average = 14.28% 14.27% 14.27%
Just to clean the bag..
How many throws per life?
20
How many lives do you want to test?
160000
How many times do you want to test?
8
After 25600000 throws Average = 14.27%
================
CODE
================
#include <stdio.h>
#include <time.h>
int hammer(int i, int last1, int last2);
int main(void)
{
srand(time(0));
int i, j, jj, x=0, last1=2, last2=1, counter=0, throwsperlife, lives, times, average=0;
printf("How many throws per life?\n");
scanf("%d", &throwsperlife);
printf("How many lives do you want to test?\n");
scanf("%d", &lives);
printf("How many times do you want to test?\n");
scanf("%d", ×);
for(jj=0; jj<times;jj++)
{
for(j=1; j<=lives; j++)
{
for (i=1; i<=throwsperlife;i++)
{
x=hammer(i, last1, last2);
printf("Final throw is %d\n", x);
last2 = last1;
last1 = x;
if(x==9)
{
printf("Hit a 9, at roll %d on life %d\n", i, j);
counter++;
printf("Hit a 9 clearing out two garbage throws.\n");
printf("=======================================\n");
x=hammer(i, last1, last2);
printf("Final throw is %d\n", x);
last2 = last1;
last1 = x;
x=hammer(i, last1, last2);
printf("Final throw is %d\n", x);
last2 = last1;
last1 = x;
printf("=======================================\n");
}
}
printf("Died, reset throw probability\n\n");
last1=1;
last2=2;
}
// printf("After %d throws, you have a %.2f%% chance of throwing a 9\n", lives*throwsperlife, (float)( (float)(counter)/(float)(lives*throwsperlife)*100 ) );
average+=(float)((float)(counter)/(float)(lives*throwsperlife)*100);
// counter=0;
}
printf("After %d throws Average = %.2f%%\n", lives*throwsperlife*times, (float)((float)(counter*100)/(float)(lives*throwsperlife*times)));
system("pause");
}
int hammer(int i, int last1, int last2)
{
int hammerval=0, junk=0;
hammerval = 1 + rand()%9;
printf("Threw a %d on try %d\n", hammerval, i);
printf("Last two throws are %d and %d\n", last1, last2);
while( (hammerval==last1 || hammerval==last2) )
{
printf("Can't throw %d or %d, throwing again!\n", last1, last2);
hammerval = 1 + rand()%9;
}
return hammerval;
}
================
SAMPLE RUN
================
How many throws per life?
3
How many lives do you want to test?
5
How many times do you want to test?
2
Threw a 7 on try 1
Last two throws are 2 and 1
Final throw is 7
Threw a 4 on try 2
Last two throws are 7 and 2
Final throw is 4
Threw a 3 on try 3
Last two throws are 4 and 7
Final throw is 3
Died, reset throw probability
Threw a 9 on try 1
Last two throws are 1 and 2
Final throw is 9
Hit a 9, at roll 1 on life 2
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 1 on try 1
Last two throws are 9 and 1
Can't throw 9 or 1, throwing again!
Threw a 4 on try 1
Final throw is 4
Threw a 9 on try 1
Last two throws are 4 and 9
Can't throw 4 or 9, throwing again!
Threw a 2 on try 1
Final throw is 2
=======================================
Threw a 2 on try 2
Last two throws are 2 and 4
Can't throw 2 or 4, throwing again!
Threw a 7 on try 2
Final throw is 7
Threw a 9 on try 3
Last two throws are 7 and 2
Final throw is 9
Hit a 9, at roll 3 on life 2
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 3 on try 3
Last two throws are 9 and 7
Final throw is 3
Threw a 8 on try 3
Last two throws are 3 and 9
Final throw is 8
=======================================
Died, reset throw probability
Threw a 6 on try 1
Last two throws are 1 and 2
Final throw is 6
Threw a 9 on try 2
Last two throws are 6 and 1
Final throw is 9
Hit a 9, at roll 2 on life 3
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 8 on try 2
Last two throws are 9 and 6
Final throw is 8
Threw a 9 on try 2
Last two throws are 8 and 9
Can't throw 8 or 9, throwing again!
Threw a 7 on try 2
Final throw is 7
=======================================
Threw a 2 on try 3
Last two throws are 7 and 8
Final throw is 2
Died, reset throw probability
Threw a 2 on try 1
Last two throws are 1 and 2
Can't throw 1 or 2, throwing again!
Threw a 1 on try 1
Can't throw 1 or 2, throwing again!
Threw a 5 on try 1
Final throw is 5
Threw a 6 on try 2
Last two throws are 5 and 1
Final throw is 6
Threw a 2 on try 3
Last two throws are 6 and 5
Final throw is 2
Died, reset throw probability
Threw a 7 on try 1
Last two throws are 1 and 2
Final throw is 7
Threw a 1 on try 2
Last two throws are 7 and 1
Can't throw 7 or 1, throwing again!
Threw a 3 on try 2
Final throw is 3
Threw a 2 on try 3
Last two throws are 3 and 7
Final throw is 2
Died, reset throw probability
Threw a 2 on try 1
Last two throws are 1 and 2
Can't throw 1 or 2, throwing again!
Threw a 2 on try 1
Can't throw 1 or 2, throwing again!
Threw a 9 on try 1
Final throw is 9
Hit a 9, at roll 1 on life 1
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 2 on try 1
Last two throws are 9 and 1
Final throw is 2
Threw a 6 on try 1
Last two throws are 2 and 9
Final throw is 6
=======================================
Threw a 4 on try 2
Last two throws are 6 and 2
Final throw is 4
Threw a 5 on try 3
Last two throws are 4 and 6
Final throw is 5
Died, reset throw probability
Threw a 5 on try 1
Last two throws are 1 and 2
Final throw is 5
Threw a 5 on try 2
Last two throws are 5 and 1
Can't throw 5 or 1, throwing again!
Threw a 3 on try 2
Final throw is 3
Threw a 8 on try 3
Last two throws are 3 and 5
Final throw is 8
Died, reset throw probability
Threw a 3 on try 1
Last two throws are 1 and 2
Final throw is 3
Threw a 4 on try 2
Last two throws are 3 and 1
Final throw is 4
Threw a 7 on try 3
Last two throws are 4 and 3
Final throw is 7
Died, reset throw probability
Threw a 7 on try 1
Last two throws are 1 and 2
Final throw is 7
Threw a 1 on try 2
Last two throws are 7 and 1
Can't throw 7 or 1, throwing again!
Threw a 9 on try 2
Final throw is 9
Hit a 9, at roll 2 on life 4
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 9 on try 2
Last two throws are 9 and 7
Can't throw 9 or 7, throwing again!
Threw a 9 on try 2
Can't throw 9 or 7, throwing again!
Threw a 4 on try 2
Final throw is 4
Threw a 7 on try 2
Last two throws are 4 and 9
Final throw is 7
=======================================
Threw a 9 on try 3
Last two throws are 7 and 4
Final throw is 9
Hit a 9, at roll 3 on life 4
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 2 on try 3
Last two throws are 9 and 7
Final throw is 2
Threw a 9 on try 3
Last two throws are 2 and 9
Can't throw 2 or 9, throwing again!
Threw a 9 on try 3
Can't throw 2 or 9, throwing again!
Threw a 5 on try 3
Final throw is 5
=======================================
Died, reset throw probability
Threw a 2 on try 1
Last two throws are 1 and 2
Can't throw 1 or 2, throwing again!
Threw a 7 on try 1
Final throw is 7
Threw a 2 on try 2
Last two throws are 7 and 1
Final throw is 2
Threw a 5 on try 3
Last two throws are 2 and 7
Final throw is 5
Died, reset throw probability
After 30 throws Average = 20.00%
Press any key to continue . . .
Hypothesis 1
================
You should clear out garbage throws as to "set up" for a 9.
================
RESULTS
================
Clearing out garbage throws will always give you approx 14.30% chance of hitting a 9
1/7 is approx 14.28
================
DATA
================
the extra %'s are mulitple runs
How many throws per life?
1
How many lives do you want to test?
160000
How many times do you want to test?
8
After 1280000 throws Average = 14.25% 14.33% 14.32%
How many throws per life?
2
How many lives do you want to test?
80000
How many times do you want to test?
8
After 1280000 throws Average = 14.29% 14.25% 14.27%
How many throws per life?
3
How many lives do you want to test?
53333
How many times do you want to test?
8
After 1279992 throws Average = 14.36% 14.31% 14.31%
How many throws per life?
4
How many lives do you want to test?
40000
How many times do you want to test?
8
After 1280000 throws Average = 14.27% 14.31% 14.40%
How many throws per life?
20
How many lives do you want to test?
8000
How many times do you want to test?
8
After 1280000 throws Average = 14.28% 14.27% 14.27%
Just to clean the bag..
How many throws per life?
20
How many lives do you want to test?
160000
How many times do you want to test?
8
After 25600000 throws Average = 14.27%
================
CODE
================
#include <stdio.h>
#include <time.h>
int hammer(int i, int last1, int last2);
int main(void)
{
srand(time(0));
int i, j, jj, x=0, last1=2, last2=1, counter=0, throwsperlife, lives, times, average=0;
printf("How many throws per life?\n");
scanf("%d", &throwsperlife);
printf("How many lives do you want to test?\n");
scanf("%d", &lives);
printf("How many times do you want to test?\n");
scanf("%d", ×);
for(jj=0; jj<times;jj++)
{
for(j=1; j<=lives; j++)
{
for (i=1; i<=throwsperlife;i++)
{
x=hammer(i, last1, last2);
printf("Final throw is %d\n", x);
last2 = last1;
last1 = x;
if(x==9)
{
printf("Hit a 9, at roll %d on life %d\n", i, j);
counter++;
printf("Hit a 9 clearing out two garbage throws.\n");
printf("=======================================\n");
x=hammer(i, last1, last2);
printf("Final throw is %d\n", x);
last2 = last1;
last1 = x;
x=hammer(i, last1, last2);
printf("Final throw is %d\n", x);
last2 = last1;
last1 = x;
printf("=======================================\n");
}
}
printf("Died, reset throw probability\n\n");
last1=1;
last2=2;
}
// printf("After %d throws, you have a %.2f%% chance of throwing a 9\n", lives*throwsperlife, (float)( (float)(counter)/(float)(lives*throwsperlife)*100 ) );
average+=(float)((float)(counter)/(float)(lives*throwsperlife)*100);
// counter=0;
}
printf("After %d throws Average = %.2f%%\n", lives*throwsperlife*times, (float)((float)(counter*100)/(float)(lives*throwsperlife*times)));
system("pause");
}
int hammer(int i, int last1, int last2)
{
int hammerval=0, junk=0;
hammerval = 1 + rand()%9;
printf("Threw a %d on try %d\n", hammerval, i);
printf("Last two throws are %d and %d\n", last1, last2);
while( (hammerval==last1 || hammerval==last2) )
{
printf("Can't throw %d or %d, throwing again!\n", last1, last2);
hammerval = 1 + rand()%9;
}
return hammerval;
}
================
SAMPLE RUN
================
How many throws per life?
3
How many lives do you want to test?
5
How many times do you want to test?
2
Threw a 7 on try 1
Last two throws are 2 and 1
Final throw is 7
Threw a 4 on try 2
Last two throws are 7 and 2
Final throw is 4
Threw a 3 on try 3
Last two throws are 4 and 7
Final throw is 3
Died, reset throw probability
Threw a 9 on try 1
Last two throws are 1 and 2
Final throw is 9
Hit a 9, at roll 1 on life 2
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 1 on try 1
Last two throws are 9 and 1
Can't throw 9 or 1, throwing again!
Threw a 4 on try 1
Final throw is 4
Threw a 9 on try 1
Last two throws are 4 and 9
Can't throw 4 or 9, throwing again!
Threw a 2 on try 1
Final throw is 2
=======================================
Threw a 2 on try 2
Last two throws are 2 and 4
Can't throw 2 or 4, throwing again!
Threw a 7 on try 2
Final throw is 7
Threw a 9 on try 3
Last two throws are 7 and 2
Final throw is 9
Hit a 9, at roll 3 on life 2
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 3 on try 3
Last two throws are 9 and 7
Final throw is 3
Threw a 8 on try 3
Last two throws are 3 and 9
Final throw is 8
=======================================
Died, reset throw probability
Threw a 6 on try 1
Last two throws are 1 and 2
Final throw is 6
Threw a 9 on try 2
Last two throws are 6 and 1
Final throw is 9
Hit a 9, at roll 2 on life 3
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 8 on try 2
Last two throws are 9 and 6
Final throw is 8
Threw a 9 on try 2
Last two throws are 8 and 9
Can't throw 8 or 9, throwing again!
Threw a 7 on try 2
Final throw is 7
=======================================
Threw a 2 on try 3
Last two throws are 7 and 8
Final throw is 2
Died, reset throw probability
Threw a 2 on try 1
Last two throws are 1 and 2
Can't throw 1 or 2, throwing again!
Threw a 1 on try 1
Can't throw 1 or 2, throwing again!
Threw a 5 on try 1
Final throw is 5
Threw a 6 on try 2
Last two throws are 5 and 1
Final throw is 6
Threw a 2 on try 3
Last two throws are 6 and 5
Final throw is 2
Died, reset throw probability
Threw a 7 on try 1
Last two throws are 1 and 2
Final throw is 7
Threw a 1 on try 2
Last two throws are 7 and 1
Can't throw 7 or 1, throwing again!
Threw a 3 on try 2
Final throw is 3
Threw a 2 on try 3
Last two throws are 3 and 7
Final throw is 2
Died, reset throw probability
Threw a 2 on try 1
Last two throws are 1 and 2
Can't throw 1 or 2, throwing again!
Threw a 2 on try 1
Can't throw 1 or 2, throwing again!
Threw a 9 on try 1
Final throw is 9
Hit a 9, at roll 1 on life 1
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 2 on try 1
Last two throws are 9 and 1
Final throw is 2
Threw a 6 on try 1
Last two throws are 2 and 9
Final throw is 6
=======================================
Threw a 4 on try 2
Last two throws are 6 and 2
Final throw is 4
Threw a 5 on try 3
Last two throws are 4 and 6
Final throw is 5
Died, reset throw probability
Threw a 5 on try 1
Last two throws are 1 and 2
Final throw is 5
Threw a 5 on try 2
Last two throws are 5 and 1
Can't throw 5 or 1, throwing again!
Threw a 3 on try 2
Final throw is 3
Threw a 8 on try 3
Last two throws are 3 and 5
Final throw is 8
Died, reset throw probability
Threw a 3 on try 1
Last two throws are 1 and 2
Final throw is 3
Threw a 4 on try 2
Last two throws are 3 and 1
Final throw is 4
Threw a 7 on try 3
Last two throws are 4 and 3
Final throw is 7
Died, reset throw probability
Threw a 7 on try 1
Last two throws are 1 and 2
Final throw is 7
Threw a 1 on try 2
Last two throws are 7 and 1
Can't throw 7 or 1, throwing again!
Threw a 9 on try 2
Final throw is 9
Hit a 9, at roll 2 on life 4
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 9 on try 2
Last two throws are 9 and 7
Can't throw 9 or 7, throwing again!
Threw a 9 on try 2
Can't throw 9 or 7, throwing again!
Threw a 4 on try 2
Final throw is 4
Threw a 7 on try 2
Last two throws are 4 and 9
Final throw is 7
=======================================
Threw a 9 on try 3
Last two throws are 7 and 4
Final throw is 9
Hit a 9, at roll 3 on life 4
Hit a 9 clearing out two garbage throws.
=======================================
Threw a 2 on try 3
Last two throws are 9 and 7
Final throw is 2
Threw a 9 on try 3
Last two throws are 2 and 9
Can't throw 2 or 9, throwing again!
Threw a 9 on try 3
Can't throw 2 or 9, throwing again!
Threw a 5 on try 3
Final throw is 5
=======================================
Died, reset throw probability
Threw a 2 on try 1
Last two throws are 1 and 2
Can't throw 1 or 2, throwing again!
Threw a 7 on try 1
Final throw is 7
Threw a 2 on try 2
Last two throws are 7 and 1
Final throw is 2
Threw a 5 on try 3
Last two throws are 2 and 7
Final throw is 5
Died, reset throw probability
After 30 throws Average = 20.00%
Press any key to continue . . .