What algorithm could I use that automatically retrieves the value at a particular column and row of the Trinomial triangle, without actually generating the entire triangle? I know there is a way to do it with the standard Pascal's triangle, but I can't figure out how to do it with the trinomial triangle. Preferably, I would like the algorithm in python.
Asked
Active
Viewed 84 times
1
-
https://stackoverflow.com/questions/15580291/how-to-efficiently-calculate-a-row-in-pascals-triangle – user1558604 Mar 17 '21 at 03:05
-
Wikipedia has the answer. https://en.wikipedia.org/wiki/Trinomial_triangle. It can be expressed as the sum of two binomial triangle coefficients, which you can compute. – Tim Roberts Mar 17 '21 at 03:14