## 5.241. max_increasing_slope

Origin

Motivated by time series.

Constraint

$\mathrm{\pi \pi \pi ‘}_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }\left(\mathrm{\pi Ό\pi °\pi },\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Arguments
 $\mathrm{\pi Ό\pi °\pi }$ $\mathrm{\pi \pi \pi \pi }$ $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi }-\mathrm{\pi \pi \pi \pi }\right)$
Restrictions
 $\mathrm{\pi Ό\pi °\pi }\beta ₯0$ $\mathrm{\pi Ό\pi °\pi }<$$\mathrm{\pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi \pi \pi }\right)$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>0$
Purpose

Given a sequence of variables $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }={V}_{1},{V}_{2},\beta ―,{V}_{n}$, sets $\mathrm{\pi Ό\pi °\pi }$ to 0 if $\mathrm{\beta }i\beta \left[1,n-1\right]|{V}_{i}<{V}_{i+1}$, otherwise sets $\mathrm{\pi Ό\pi °\pi }$ to ${max}_{i\beta \left[1,n-1\right]|{V}_{i}<{V}_{i+1}}\left({V}_{i+1}-{V}_{i}\right)$.

Example
 $\left(4,β©1,1,5,8,6,2,2,1,2βͺ\right)$ $\left(0,β©9,8,6,4,1,0βͺ\right)$ $\left(8,β©9,6,6,4,1,9βͺ\right)$

The first $\mathrm{\pi \pi \pi ‘}_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$ constraint holds since the sequence $115862212$ contains two increasing subsequences $158$ and $12$ and the maximum slope is equal to $max\left(5-1,8-5,2-1\right)=4$ as shown on FigureΒ 5.241.1.

Typical
 $\mathrm{\pi Ό\pi °\pi }>0$ $\mathrm{\pi Ό\pi °\pi }<$$\mathrm{\pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)-1$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|>2$ $\mathrm{\pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)>2$
Symmetry

One and the same constant can be added to the $\mathrm{\pi \pi \pi }$ attribute of all items of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

Arg. properties

Functional dependency: $\mathrm{\pi Ό\pi °\pi }$ determined by $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

Usage

Getting the maximum slope over the increasing sequences of time series.

Counting
 Length ($n$) 2 3 4 5 6 7 8 Solutions 9 64 625 7776 117649 2097152 43046721

Number of solutions for $\mathrm{\pi \pi \pi ‘}_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$: domains $0..n$

Length ($n$)2345678
Total9646257776117649209715243046721
 Parameter value

062070252924343212870
12201511036682844220284405
21161881952192001833041721425
3-81422106290353801164847301
4--741584282664838408021350
5---846216844576329208124
6----117123530888654931
7-----1915206673834
8------3622481

Solution count for $\mathrm{\pi \pi \pi ‘}_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$: domains $0..n$

Keywords
Cond. implications

$\beta ’$ $\mathrm{\pi \pi \pi ‘}_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }\left(\mathrm{\pi Ό\pi °\pi },\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Β Β Β  withΒ  $\mathrm{\pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)=\mathrm{\pi Ό\pi °\pi }+1$

Β Β implies $\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi »},\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Β Β Β  whenΒ  $\mathrm{\pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)=\mathrm{\pi »}+1$.

$\beta ’$ $\mathrm{\pi \pi \pi ‘}_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }\left(\mathrm{\pi Ό\pi °\pi },\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Β Β Β  withΒ  $\mathrm{\pi Ό\pi °\pi }=1$

Β Β implies $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$$\left(\mathrm{\pi Ό\pi Έ\pi ½},\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Β Β Β  whenΒ  $\mathrm{\pi Ό\pi Έ\pi ½}=1$.

Automaton

FigureΒ 5.241.2 depicts the automaton associated with the $\mathrm{\pi \pi \pi ‘}_\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$ constraint. To each pair of consecutive variables $\left({\mathrm{\pi  \pi °\pi }}_{i},{\mathrm{\pi  \pi °\pi }}_{i+1}\right)$ of the collection $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ corresponds a signature variable ${S}_{i}$. The following signature constraint links ${\mathrm{\pi  \pi °\pi }}_{i}$, ${\mathrm{\pi  \pi °\pi }}_{i+1}$ and ${S}_{i}$: $\left({\mathrm{\pi  \pi °\pi }}_{i}\beta ₯{\mathrm{\pi  \pi °\pi }}_{i+1}\beta {S}_{i}=0\right)\beta §\left({\mathrm{\pi  \pi °\pi }}_{i}<{\mathrm{\pi  \pi °\pi }}_{i+1}\beta {S}_{i}=1\right)$.