
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The width of the sectors cannot match the values in the array, otherwise the algorithm will not work for all numbers.
What matters is the distance the numbers are apart. The further apart all the numbers are from the first, the less likely they are to fall out. In essence we postpone on a straight line bars proportional to the distance between the numbers, adjusted by a factor of 0.01, so that the last number the probability of falling out was not equal to 0 as the farthest from the first. The higher the coefficient, the more equal the sectors are. The excel file is attached, experiment with it.
1. The calculation of theoretical probabilities is given in the excel. The first number is the highest probability, the last number is the lowest probability but not equal to 0.
2) Negative sizes of sectors never happens for any set of numbers, provided that the set is sorted in descending order - the first number is the biggest (it will work with the biggest in the set but negative number).
I do not understand, but I already like your approach to probability theory, expressed in a key phrase: "It is important the distance at which the numbers are in between. The further apart all the numbers are from the first, the less likely they are to fall out..." and take two (check shot): "Are you suggesting to just pick an element of the array at random? - It doesn't take into account distances between array numbers, so your way is useless". Legitimate question: Is brain washing a compulsory exercise in honing program writing logic? I'd better stay a dilettante coder, it's better for my health.
And if you're good with probability theory, then the logic of roulette - a random number generator in the range from 0 to 36 (if roulette is conventional, European, without the American-style double zero, etc...).
I don't get it, but I already like your approach to probability theory, expressed in the key phrase: "The distance between the numbers matters. The further all the numbers are from the first, the less likely they are to fall out..." and take two (check shot): "You propose to just select an element of the array at random? - It doesn't take into account distances between array numbers, so your way is useless". Legitimate question: Is brain washing a compulsory exercise in honing program writing logic? I'd better stay a dilettante coder, it's better for my health.
And if you're good with probability theory, the logic of roulette - a random number generator in a range from 0 to 36 (if regular European roulette, without the American-style double zero, etc. ...).
Actually, casino roulette is nothing more than a metaphor, which at least three people in this thread have already fallen for.
Actually, casino roulette is nothing more than a metaphor that at least three people in this thread have already fallen for.
- Yeah, yeah, I get it! Aesop language!
- I'm sorry, where's that from?
- Yes, yes, I got it! Aesop language!
- I'm sorry, I didn't catch that, where was it from?
The width of the sectors cannot match the values in the array, otherwise the algorithm will not work for all numbers.
What matters is the distance the numbers are apart. The further apart all the numbers are from the first, the less likely they are to fall out. In essence we postpone on a straight line bars proportional to the distance between the numbers, adjusted by a factor of 0.01, so that the last number the probability of falling out was not equal to 0 as the farthest from the first. The higher the coefficient, the more equal the sectors are. The excel file is attached, experiment with it.
1. The calculation of theoretical probabilities is given in the excel. The first number is the highest probability, the last number is the lowest probability but not equal to 0.
2) Negative sector sizes never happen for any set of numbers, as long as the set is sorted in descending order - the first number is the biggest (will also work with the biggest in the set but a negative number).
This is not a correct statement IMHO.
Second, the calculation of the probability array with[] is needed once per epoch, so we should split the function into RoletteEpoh() and RoletteRand().
Although Joo mentioned it in the beginning.
but you can get the speedup itself just by searching for the dropped value in c[] array.
You can use the standard biblio, namely the quick search methods.
And you'd better take its reworked methods from the article Spreadsheets in MQL5
If you want to make a quick search for sorted arrays with non-decreasing values, use the standard one with ascending values (I may be wrong, it's been a while since I tumbled into standard one).
Robert Shackley?
I suggest we discuss here the problems of optimal algorithm logic construction
Problems of "optimal construction of algorithm logic" - it's more like improvement of coding methods and techniques... or am I wrong?
A thread of a general nature:
"If anyone doubts that their algorithm has optimal logic in terms of speed (or clarity), they are welcome."
And specifically my task was "...please suggest a faster variant...". Faster! I'm not asking whether my algorithm is right or wrong, in this case I just need faster, that is, if someone suggests another variant of the algorithm, it should produce the same result as mine and no other. And for some reason everyone started thinking about his own thing.
OK, my task of speeding up has been solved. :)
- Yes, yes, I got it! Aesop language!
- I'm sorry, I didn't catch that, where was it from?