Talk:UVa 10079 - Pizza Cutting

I solved this problem by guessing the general formula for the problem. But now that I am trying to figure out the mathematical correctness of this formula, I am stuck. The formula is $$result = (n + n*n) / 2 + 1$$. All that comes to my mind is that when we have a set of non-collinear lines, the number of triangles that can be formed seemed to have a similiar formula. Any ideas?--Shalinmangar 17:33, 28 Jan 2006 (EST)

There is a trivial proof by induction. Larry 05:32, 29 Jan 2006 (EST)

Yeah, thanks. Now why didn't I think about that? Just another thought, proving this was easy. But how do I derive the formula mathematically? I know that the UVa forums are the place to ask these questions, but I wanted to update the wiki about this problem and did not want to say "just guess the formula like I did" :-) --Shalinmangar 08:44, 29 Jan 2006 (EST)
 * After n-1 lines have been drawn, the nth line can intersect each of these, so it has n-1 intersections, so n new regions, so the recurrence $$A(n)=A(n-1)+n;\ A(1)=2$$, which gives $$A(n)=n+(n-1)+(n-2)+...+2+A(1)$$. The same way you prove it, right?
 * Yes, with a minor modification. With no cuts (n=0) you still have the whole pizza. So $$A(n)=A(n-1)+n;\ A(0)=1$$, so this gives $$A(n)=n+(n-1)+(n-2)+...+2+1+A(0)$$ and hence yields the formula $$A(n)=n(n+1)/2+1$$--Shalinmangar 06:42, 30 Jan 2006 (EST)