[Archive!] Pure mathematics, physics, chemistry, etc.: brain-training problems not related to trade in any way - page 350

 
joo >>:

ага, поэтому и обратился к мыслителям. там одних только двух-вершинных вариантов тьма тьмущщая, не говоря уже про сочетания хаев и лоув.

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.

 
joo >>:

Правила игры - никаких правил. Минимально допустимое количество колен - 2 штуки, то есть - один отрезок. Максимальное - равно количеству баров.

Oh, man, you're an artist! Go ahead and connect ten consecutive dots with ten diniums. :)

// And make sure you post the drawing!!!

 
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.
 

5 bars - 5 tops
MetaDriver >>:

Во, блин, артист! Ну ка давай соедини десять последовательных точек десятью диниями. :)

// И рисунок непременно выложи!!

Tired of drawing, that's enough for five. :)

 
Mathemat >>:
Дык как, joo, ZZ должен получаться "правильным" - или все равно? "Правильный" - это когда любая вершина ZZ является локальным экстремумом.
Если не считаться с правильностью, то задачка сводится к числу упорядоченных разбиений натурального числа на слагаемые.

Yes, it can be quite wrong.

 
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.

 
joo >>:

То есть, грубо говоря, для 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

Reason: