I was reading about Catalan numbers on Geeksforgeeks and found this
Is this true ? After solving for 4 and 5 results are different from the standard ones.
I was reading about Catalan numbers on Geeksforgeeks and found this
Is this true ? After solving for 4 and 5 results are different from the standard ones.
It’s absolutely correct…just multiply and divide RHS by (n+1)! and combining numerator leads to the expression in LHS. Also C(4) = 14…both sides are giving same value…check again…
It’s correct, giving same answers as the standard ones
In dark theme the expression u wrote is hidden , I changed first to normal then read what u post
LOL, I prefer dark theme on IDEs only xD
Could you explain how ? i’m still getting wrong answer.
Show your code…
I’m using it to calculate the no. of unique BST’s. I don’t have any direct implementation to show.
i was doing like this
A/c to me
for n = 4 expression will look like
((4 + k) / k)*((4 + k)/ k)… till k = n starting from 2.
ok…so product is over ‘k’ and you get:
((4+4)/4) * ((4+3)/3) * ((4+2)/2)…simply this and see what you get…
for n = 4 it will be 12 i guess.
You are doing some silly mistake in your calculations which I think you would be able to figure out after some time…I can clearly see there is a 7 in the middle term, how can you get 12??
Just for last time can you write each term separately, yeah i’m doing this mistake again and again
like this
A/c to me n = 4
k = 2 ((4 + 2)/2) = 3
k = 3 ((4 + 3 )/ 3) = 2
k = 4 ((4 + 4)/ 4) = 2
3 * 2 * 2 = 12
The term k = 3, (4+3)/3 = 7/3 and not 2…
Ugh !! finally got it thank you so much