So how, joo, should ZZ be "right" - or does it matter? "Correct" is when any vertex of ZZ is a local extremum. If you don't consider correctness, then the problem reduces to the number of ordered decompositions of a natural number into its summands.
Mathemat>>: Дык как, joo, ZZ должен получаться "правильным" - или все равно? "Правильный" - это когда любая вершина ZZ является локальным экстремумом. Если не считаться с правильностью, то задачка сводится к числу упорядоченных разбиений натурального числа на слагаемые.
If you don't consider correctness, the problem boils down to the number of ordered divisions of a natural number into its summands. <br / translate="no">
No, it doesn't, alas. Why are you interested in this problem, joo? If n is small, then it can be programmatically overridden, too.
Mathemat>>: Нет, не сводится, увы. А чего это тебя эта задача интересует, joo?
Doing my "homework" - writing an article. I'm checking to see if ZZ is perfect. Out of all unimaginable variety of alternate zigzag variants, I need to find those vertices that are "better" than ZZ itself. An example of how much better a deliberate optimization of a blunt search of variants is.
PS well let's say n of about 100-500, that's about the number of bars estimated by an intraday trader.
If we require that the ends of the sequence always have one of the extrema, then the solution == 2^(n-1) If this is not required (i.e. knees that are outside the segment), then it is more. I have not yet checked how many. It may be just 2^n
MetaDriver>>: если требовать, чтоб на концах последовательности всегда был один из экстремумов, то решение == 2^(n-1) если этого не требовать (допускать колена, торчащие одним из концов за пределы отрезка), то больше. сколько пока не заценил. возможно как раз 2^n
So, roughly speaking, for n=500 ->2^(500-1)=1.6366953E150. That's a lot!
And this is only if all bars are involved. There are also variants with number of vertices from 2 to n.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
ага, поэтому и обратился к мыслителям. там одних только двух-вершинных вариантов тьма тьмущщая, не говоря уже про сочетания хаев и лоув.
It is possible to calculate it programmatically. It's boring to write. :) It's a tricky program to figure out.
I'd rather try to deduce it by induction first.
Правила игры - никаких правил. Минимально допустимое количество колен - 2 штуки, то есть - один отрезок. Максимальное - равно количеству баров.
Oh, man, you're an artist! Go ahead and connect ten consecutive dots with ten diniums. :)
// And make sure you post the drawing!!!
If you don't consider correctness, then the problem reduces to the number of ordered decompositions of a natural number into its summands.
5 bars - 5 tops
Во, блин, артист! Ну ка давай соедини десять последовательных точек десятью диниями. :)
// И рисунок непременно выложи!!
Tired of drawing, that's enough for five. :)
Дык как, joo, ZZ должен получаться "правильным" - или все равно? "Правильный" - это когда любая вершина ZZ является локальным экстремумом.
Если не считаться с правильностью, то задачка сводится к числу упорядоченных разбиений натурального числа на слагаемые.
Yes, it can be quite wrong.
Нет, не сводится, увы. А чего это тебя эта задача интересует, joo?
Doing my "homework" - writing an article. I'm checking to see if ZZ is perfect. Out of all unimaginable variety of alternate zigzag variants, I need to find those vertices that are "better" than ZZ itself. An example of how much better a deliberate optimization of a blunt search of variants is.
PS well let's say n of about 100-500, that's about the number of bars estimated by an intraday trader.
If this is not required (i.e. knees that are outside the segment), then it is more. I have not yet checked how many. It may be just 2^n
если требовать, чтоб на концах последовательности всегда был один из экстремумов, то решение == 2^(n-1)
если этого не требовать (допускать колена, торчащие одним из концов за пределы отрезка), то больше. сколько пока не заценил. возможно как раз 2^n
So, roughly speaking, for n=500 ->2^(500-1)=1.6366953E150. That's a lot!
And this is only if all bars are involved. There are also variants with number of vertices from 2 to n.
То есть, грубо говоря, для n=500 ->2^(500-1)=1,6366953E150. Ощень многа получаецо!
Who has it easy nowadays? Crisis... :)
By the way, I checked out the loose ends too. I got 2^(n+1)
If you require only one end to be fixed, then 2^n