## 5.175. highest_peak

Origin
Constraint

$\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }\left(\mathrm{\pi ·\pi ΄\pi Έ\pi Ά\pi ·\pi },\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Arguments
 $\mathrm{\pi ·\pi ΄\pi Έ\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)$
Restriction
$\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)$
Purpose

A variable ${V}_{k}$ $\left(1 of the sequence of variables $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }={V}_{1},\beta ―,{V}_{m}$ is a peak if and only if there exists an $i$ $\left(1 such that ${V}_{i-1}<{V}_{i}$ and ${V}_{i}={V}_{i+1}=\beta ―={V}_{k}$ and ${V}_{k}>{V}_{k+1}$. $\mathrm{\pi ·\pi ΄\pi Έ\pi Ά\pi ·\pi }$ is the maximum value of the peak variables. If no such variable exists $\mathrm{\pi ·\pi ΄\pi Έ\pi Ά\pi ·\pi }$ is equal to $\mathrm{\pi Ό\pi Έ\pi ½\pi Έ\pi ½\pi }$.

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

The first $\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }$ constraint holds since 8 is the maximum peak of the sequence $11486271$.

Typical
 $|\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$ $\mathrm{\pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\right)>0$
Symmetry

Items of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ can be reversed.

Arg. properties

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

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 \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }$: domains $0..n$

Length ($n$)2345678
Total9646257776117649209715243046721
 Parameter value

-100000095029517921108869498439791
1-11192697503635443
2-444380300022632166208
3-999900758761389484020
4--1761712156801385441195056
5---2900291252832502693425
6----504725405765665896
7-----97622711233250
8------21133632

Solution count for $\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi }$: domains $0..n$

FigureΒ 5.175.2 depicts the automaton associated with the $\mathrm{\pi \pi \pi \pi \pi \pi \pi }_\mathrm{\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}$:
${\mathrm{\pi  \pi °\pi }}_{i}<{\mathrm{\pi  \pi °\pi }}_{i+1}\beta {S}_{i}=0\beta §{\mathrm{\pi  \pi °\pi }}_{i}={\mathrm{\pi  \pi °\pi }}_{i+1}\beta {S}_{i}=1\beta §{\mathrm{\pi  \pi °\pi }}_{i}>{\mathrm{\pi  \pi °\pi }}_{i+1}\beta {S}_{i}=2$.