# probability permutations

Printable View

• 11-14-2011
Dale
probability permutations
Code:

public static void dam_data_setup()
{
// fill list
jw.damgtype.Add(jw.den1);
jw.damgtype.Add(jw.den2);
jw.damgtype.Add(jw.da1);
jw.damgtype.Add(jw.da2);
jw.damgtype.Add(jw.db1);
jw.damgtype.Add(jw.db2);
jw.damgtype.Add(jw.dc1);
jw.damgtype.Add(jw.dc2);
jw.damgtype.Add(jw.dd1);
jw.damgtype.Add(jw.dd2);
jw.damgtype.Add(jw.de1);
jw.damgtype.Add(jw.de2);
jw.damgtype.Add(jw.dv1);
jw.damgtype.Add(jw.dv2);

// convert list to array
int[] dam = jw.damgtype.ToArray();

// group counters
int den = 1; int da = 1; int db = 1; int dc = 1; int dd = 1; int de = 1; int dv = 1;

// array pointer
int x = 0;

do{
// Broken
if (den <= jw.Broken) {jw.damdata[x,0] = dam[0];}
else {jw.damdata[x,0] = dam[1];}

{
// Agouti
if (da <= jw.Agouti) {jw.damdata[x,1] = dam[2];}
else {jw.damdata[x,1] = dam[3]; }
if (da == jw.Agouti) {da = 1;} // resets Agouti counter
}

{
// Brown

if (db  <= jw.Brown) {jw.damdata[x,1] = dam[2]; }
else {jw.damdata[x,2] = dam[5]; }
if (db == jw.Brown) {db = 1;} // resets Brown counter
}

{
// Color
if (dc <= jw.Colour) {jw.damdata[x,3] = dam[6]; }
else {jw.damdata[x,3] = dam[7]; }
if (dc == jw.Colour) {dc = 1;} // resets Colour counter
}

{
// Dilute
if (dd <= jw.Dilute) {jw.damdata[x,4] = dam[8]; }
else {jw.damdata[x,4] = dam[8]; }
if (dd == jw.Dilute) {dd = 1;}
}

{
// Extention
if (de <= jw.Ext)
{ jw.damdata[x,5] = dam[10]; }
else {jw.damdata[x,5] = dam[11]; }
if (de == jw.Ext) {de = 1;} // resets Extension counter
}

{ // Vienna
if (dv ==jw.Vienna)
{jw.damdata[x,6] = dam[12]; }
else {jw.damdata[x,5] = dam[13]; }
if (dv == jw.Vienna) {dv = 1;}
}

x++; den++; da++; db++; dc++;dd++;de++; dv++;
} while (x < hk1Class.rows); // end of do.. while loop

return;
} // end dam_data_setup

This code gets me all Unlinked permutations.
Each section has 2 permutations.

Now I need to factor in that sections Brown and Color are linked.
i.e. BC bc.
they have permutations of BC BC bC bc.
permutations of bC Bc have a 38.3% probability.

how do I test for a successful probability?