|
Post by r1c4rd0 on Dec 5, 2005 20:36:05 GMT
I need help to write a program that will compute, the probaliti, tendency of many cases...where do we insert the certain cases and computer process the the probability of certain case happen, second the cases introduced... i´m sorry, my english is horrible, i´m potuguese, and i don´t study english
|
|
|
Post by earlofqb on Dec 5, 2005 23:27:16 GMT
Quick "translation" as far as I've understood your post (hope you aren't offended):
(this can be likened to a program that finds the probability of so many blue marbles being picked up out of a mixed bag)
I shall assume that you're thinking of a randomized selection case (such as:
Randomize Timer Cls
RandomNumber = (100 * RND) + 1
Select
Case 1
'Insert code
Case 2
'More code
'Continue until all selections possible have been coded (in this example, 100 of them)
End Case
[/Code]
Under a randomly-occuring system, it is theoretically impossible to predict the result of your random events. However, you can simply add the total of case conditions and divide one into it (such as in our example: 1/100).
However, I've a feeling that this isn't what you meant by your question. I'm thinking more of the typical probability example (x items out of y total):
To write a program like this, simply create your random number (use Randomize Timer : RandomNumber = (max probable * RND) = 1), then use RandomNumber to provide your seed value. The rest follows as such:
Take RandomNumber and divide it by the total possible (if hardcoded, should be easy. If not, you'll have to write a script to do this for you (most likely you'd softcode it by using a user-defined input statement. This is just as easy as hardcoding, except you substitute the user's value for the max value).
I'd write the actual code to do this, but I don't know if this is for homework or not. Thus, you'll have to code this for yourself (shouldn't be difficult, I laid the pseudocode out for you and you just have to substitute the QB keywords for it).
Hopefully you understood this, or the translator you're using translated this well enough for you to read. If not, I could easily find someone who could translate for you.
|
|
|
Post by r1c4rd0 on Dec 6, 2005 15:02:54 GMT
yes. i would like the translation, because i can´t understand it very well. thanks
|
|
|
Post by earlofqb on Dec 7, 2005 0:45:12 GMT
It will take a while until I can guarantee I can find a translator, as thanks to differing timezones, it can be a while until they come online so I can ask them about it. Shouldn't be more than a few days, though.
|
|