There is a logic puzzle called "Skyscrapers", in which you must place all numbers from $1$ to $n$ in each row and column of a square grid. Each number represents the height of a building at its location, and there are numbers given on the edges of the board that tell how many buildings are visible from that location. A building can only be seen if all buildings between it and the observer are shorter than it. Here's an example of a completed $4\times4$ puzzle:
This made me wonder: How many arrangements of $n$ buildings are there for which $k$ are visible? Meaning just from the point of view of one observer on, say, the left.
For $4$ buildings, it was easy enough to list the $24$ permutations and count how many buildings would be seen by an observer on the left. The breakdown of (# visible, # of permutations) is: $(1,6), (2,11), (3,6), (4,1)$.
Having just $1$ visible building is easy to explain: that's when the height-$4$ building is nearest to the observer. There are $3!=6$ ways to arrange the unseen shorter buildings.
Also, it's intuitive that $\{1,2,3,4\}$ is the only arrangement with all $4$ visible.
But why are there $6$ and $11$ permutations in which $3$ and $2$ buildings are visible? I'm looking for a counting argument or a formula that can be used to explain why these are the answers. Ideally one that can be applied when there are more than $4$ buildings.
