>How is 2(n-2)+1 = 2n-3
Pn <= 2n-3
New to programming, and trying to understand what these numbers mean.
Those don’t have anything specifically to do with programming, they’re just mathematical statements about the pancake algorithm.
>2(n-2)+1 = 2n-3
That’s just a mathematical equation.
2(n-2)+1
2n – 4 + 1
2n – 3
>Pn <= 2n-3
This is just a statement that says the pancake number (Pn) for any given number of pancakes (n) will always be less than or equal to 2n-3.
So if you have 7 pancakes, the pancake number will be less than or equal to 2*7-3 = 14-3 = 11.
Latest Answers