Skip to content
Omnikalc

Narayana numbers calculator

Enter n and k to get the Narayana number N(n, k), the number of Dyck paths with k peaks, the Catalan number it is part of, its share of the total and the value on the other side of the row.

Updated on
Your inputs

Value out of range

Value out of range

Results

Narayana number N(n, k)

196

Catalan number C(n), the row sum

1,430

Share of the Catalan number
13.71 %
N(n, n + 1 − k), equal by symmetry
196
Most common number of peaks (about)
5
Average number of peaks over all paths
4.50

The Narayana numbers calculator gives the Narayana number N(n, k), the number of Dyck paths with k peaks, the Catalan number that is the sum of its row, the share of the total and the value on the symmetric side of the row.

How the calculation works

  • Enter n, the number of up steps in the path.
  • Enter k, the number of peaks, between 1 and n.
  • Read the Narayana number, the Catalan number and the share.

Example

For n = 8 and k = 3, the Narayana number is 196. The row sums to the Catalan number 1,430, so this value is 13.71 % of all the paths. By symmetry, the value for the mirrored number of peaks is also 196. The average number of peaks over all paths is 4.50.

Why it matters

The calculator helps students and teachers of combinatorics, programmers and puzzle fans who count balanced bracket sequences, mountain ranges, non-crossing partitions or trees by a parameter, and want to check a hand count or see how the Catalan number splits into cases.

Good to know

Values of k must be between 1 and n, and n is limited to 25 to keep the numbers within the range the calculator handles. N(n, k) counts paths with exactly k peaks, not at most k. For n = 1 the only path has one peak. The rows are the triangle 1; 1, 1; 1, 3, 1; 1, 6, 6, 1; 1, 10, 20, 10, 1, and the values grow quickly with n. For the total count of paths use the Catalan number calculator.

The Catalan number calculator gives the row sum, the binomial calculator gives the coefficients used here, the combinations calculator counts subsets and the circular permutations calculator counts arrangements around a table.

Frequently asked questions

What are the Narayana numbers?

The Narayana numbers N(n, k) = (1/n) × C(n, k) × C(n, k − 1) count the Dyck paths of semilength n with exactly k peaks, that is the paths made of n up steps and n down steps that never go below the axis and have k places where an up step is followed by a down step. They also count other structures counted by the Catalan numbers.

How are they related to the Catalan numbers?

The sum of row n is the Catalan number C(n) = C(2n, n) / (n + 1), because each Dyck path has some number of peaks between 1 and n. For n = 4 the Narayana numbers are 1, 6, 6 and 1, adding up to 14, which is C(4).

Why is each row symmetric?

N(n, k) = N(n, n + 1 − k). There is a bijection between Dyck paths with k peaks and paths with n + 1 − k peaks. The formula shows the symmetry directly, and the middle values are the largest, so the average number of peaks is (n + 1) / 2.

Where do they appear?

They count the non-crossing partitions of n elements into k blocks, the plane trees with n edges and k leaves, the ways to place pairs of brackets with k pairs at the lowest level, and the number of triangulations with a given number of ears. They are used in combinatorics, statistical mechanics and the study of random matrices.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.