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.
Related tools
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.