พอดีอยากพลอตค่า nA nB nC จากข้อมูลที่ได้ อยากได้กราฟทั้งสามค่าอยู่ในแกนเดียวกัน ต้องเรียกใช้คำสั่งอะไรคะ
โค้ดตามนี้นะคะ
While[nA2 <= nA; nA0 = nA; nB0 = nB;
For[i = 0, i ≤ nA0, i++, x = (Random[Integer, {1, 10}])/10;
If[x > pA, nA = nA; nB = nB, nA = nA - 1; nB = nB + 1]
];
For[i = 0, i ≤ nB0, i++, y = (Random[Integer, {1, 10}])/10;
If[y > pB, nB = nB; nC = nC, nB = nB - 1; nC = nC + 1]
];
t = t + 1
]
ช่วยหน่อยค่ะ mathermatica
โค้ดตามนี้นะคะ
While[nA2 <= nA; nA0 = nA; nB0 = nB;
For[i = 0, i ≤ nA0, i++, x = (Random[Integer, {1, 10}])/10;
If[x > pA, nA = nA; nB = nB, nA = nA - 1; nB = nB + 1]
];
For[i = 0, i ≤ nB0, i++, y = (Random[Integer, {1, 10}])/10;
If[y > pB, nB = nB; nC = nC, nB = nB - 1; nC = nC + 1]
];
t = t + 1
]