I have a for loop
for (int i = 0; i < knowledgeD.size(); i++ )
knowledgeD.get(i).get(0);
for (int k = 0; k < knowledgeD.size(); k++ )
knowledgeD.get(k).get(1);
However I am majorly confused at how I can store all the results of the for loop to one variable I guess?
like say for example i Do this
for (int i = 0; i < knowledgeD.size(); i++ )
w =knowledgeD.get(i).get(0);
for (int k = 0; k < knowledgeD.size(); k++ )
y = knowledgeD.get(k).get(1);
then in my toString() i do
String s = "{true@" + w + " " +"false@" + w.complement() + "}" + "@" + this.y;
Where complement() is the complement on the w fraction, in this case 9/11.
This gives me
{true@135/163 false@28/163}@163/1680}
Which is fantastic, but thats only the last value of the array of arrays
[[2/11, 11/48], [8/35, 35/288], [16/43, 43/288], [75/152, 19/210], [4/5, 5/16], [135/163, 163/1680]]
If anyone can shed light that would be much appreciated. Basically the @ true and @ false are probability of a coinflip being heads or tails.
Cheers Sim PS the datatypes for w and y are BigFractions which are basically fractions, this datatype is in another class.