5.293. nvisible_from_start

DESCRIPTIONLINKSAUTOMATON
Origin

Derived from a puzzle called skyscraper

Constraint

πš—πšŸπš’πšœπš’πš‹πš•πšŽ_πšπš›πš˜πš–_πšœπšπšŠπš›πš(𝙽,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Synonyms

πš—πšŸπš’πšœπš’πš‹πš•πšŽ, πš—πšŸπš’πšœπš’πš‹πš•πšŽ_πšπš›πš˜πš–_πš•πšŽπšπš.

Arguments
π™½πšπšŸπšŠπš›
πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›-πšπšŸπšŠπš›)
Restrictions
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)
𝙽β‰₯πš–πš’πš—(1,|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|)
𝙽≀|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|
Purpose

The i π‘‘β„Ž (1≀i≀|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|) variable of the sequence πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ is visible if and only if all variables before the i π‘‘β„Ž variable are strictly smaller than the i π‘‘β„Ž variable itself. 𝙽 is the total number of visible variables of the sequence of variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Example
(3,1,6,2,1,4,8,2)
(1,8,6,2,1,4,8,2)
(7,0,2,3,5,6,7,9)

The first πš—πšŸπš’πšœπš’πš‹πš•πšŽ_πšπš›πš˜πš–_πšœπšπšŠπš›πš constraint holds since the sequence 1 6 2 1 4 8 2 contains three visible items that respectively correspond to the first, second and sixth items.

Typical
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>2
πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>2
Symmetry

One and the same constant can be added to the πšŸπšŠπš› attribute of all items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Arg. properties

Functional dependency: 𝙽 determined by πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Counting
Length (n)2345678
Solutions9646257776117649209715243046721

Number of solutions for πš—πšŸπš’πšœπš’πš‹πš•πšŽ_πšπš›πš˜πš–_πšœπšπšŠπš›πš: domains 0..n

ctrs/nvisible_from_start-1-tikz

ctrs/nvisible_from_start-2-tikz

Length (n)2345678
Total9646257776117649209715243046721
Parameter
value

16302252275290084469648080425
233030536755279488905617238570
3-49016102940058354812780180
4--521060201587604238367
5---642018060661500
6----775646410
7-----81260
8------9

Solution count for πš—πšŸπš’πšœπš’πš‹πš•πšŽ_πšπš›πš˜πš–_πšœπšπšŠπš›πš: domains 0..n

ctrs/nvisible_from_start-3-tikz

ctrs/nvisible_from_start-4-tikz

See also

implied by: πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πš—πšŸπšŠπš•πšžπšŽ.

implies: πšŠπšπš•πšŽπšŠπšœπš_πš—πšŸπšŠπš•πšžπšŽ.

related: πš—πšŸπš’πšœπš’πš‹πš•πšŽ_πšπš›πš˜πš–_πšŽπš—πšΒ (count from the end of the sequence rather than from the start).

Keywords

combinatorial object: sequence.

constraint arguments: pure functional dependency.

modelling: functional dependency.

Automaton

FigureΒ 5.293.1 depicts the automaton associated with the πš—πšŸπš’πšœπš’πš‹πš•πšŽ_πšπš›πš˜πš–_πšœπšπšŠπš›πš constraint.

Figure 5.293.1. Automaton of the πš—πšŸπš’πšœπš’πš‹πš•πšŽ_πšπš›πš˜πš–_πšœπšπšŠπš›πš constraint with two counters M and C, where M records the largest value encountered so far, and C the number of visible values from the left hand side of the sequence πš…π™°πš 1 , πš…π™°πš 2 , ..., πš…π™°πš n
ctrs/nvisible_from_start-5-tikz
Figure 5.293.2. Hypergraph of the reformulation corresponding to the automaton (with two counters) of the πš—πšŸπš’πšœπš’πš‹πš•πšŽ_πšπš›πš˜πš–_πšœπšπšŠπš›πš constraint (since all states of the automaton are accepting there is no restriction on the last variable Q n )
ctrs/nvisible_from_start-6-tikz