A summary of plane segmentation of recursive method

Source: Internet
Author: User

This is a kind of problem, first divides the area from the line Division to the Polyline Division area, then extends to the closed Graph Division area, finally in the promotion for the plane division space question.

one, n straight line most points plane problem

Topics such as: N straight lines, the maximum number of planes can be divided into areas.

Study Questions: Maybe you have seen this topic before, at best, it is a junior high school. When there are n-1 lines, the plane is divided up into F (n-1) regions. If the nth line is cut into the largest number of regions, it must intersect each line and cannot have the same intersection. This will give you a n-1 intersection. These intersections divide the nth line into 2-ray and n-2-line breaks. Each ray and line break will be divided into two regions. This will be more than the N-2 area.

Therefore: F (n) =f (n-1) +n

=f (n-2) + (n-1) +n

......

=f (1) +1+2+......+n

=n (n+1)/2+1

Second, the line sub-plane (hdu2050)

According to the line division plane, the number of rays and segments is determined by the intersection, and then the number of new regions is determined. When n-1 a polyline, the number of regions is f (n-1). In order to increase the maximum area, the segments on either side of the polyline intersect with the edge of the n-1 polyline, or the n-1 segment. The number of new segments is n-1 and the number of rays is 2. Note, however, that two segments adjacent to the polyline itself can only add one area.

Therefore: F (n) =f (n-1) +4 (n-1) +2-1

=f (n-1) +4 (n-1) +1

=f (n-2) +4 (n-2) +4 (n-1) +2

......

=f (1) +4+4*2+......+4 (n-1) + (n-1)

=2n^2-n+1

Three or three Angular division area (hdu1249)

Parse: When n-1 a triangle, the area of the region is F (n-1).

For the largest number of regions, the nth triangle must intersect the first n-1 triangle.
Then an edge of the nth triangle is split into a n-1-1 segment and a two-half line segment,
That is equivalent to the N-1 line segment. Then the nth triangle is split into a 3*2* (n-1) line segment.
A 6* (n-1) polygon is added.

Therefore: F (n) =6* (n-1) +f (n-1)

F (n-1) =6* (n-2) +f (n-2)

........

F (2) =6*1+f (1)

Because, f (1) =2

So, f (n) =3*n* (n-1) +2

Four, closed curve sub-plane problem

The topic is roughly as if there are N closed curves drawn on the plane, and any two closed curves intersect at two o'clock, and any three closed curves do not intersect at the same point, asking these closed curves to divide the plane into the number of regions.

Analysis: When n-1 a circle, the number of regions is f (n-1). Then the nth circle must intersect with the first n-1 circle, and the nth circle is divided into 2 (n-1) segments, adding 2 (n-1) regions.

Therefore: F (n) =f (n-1) +2 (n-1)

=f (1) +2+4+......+2 (n-1)

=n^2-n+2

Five, plane partition space problem (hdu1290)

From the two-dimensional segmentation problem, it is known that the plane segmentation is related to the intersection of lines, that is, the intersection determines the number of rays and segments, thus determining the number of new regions. Imagine that the three-dimensional is related to the plane of the intersection line? When there is a n-1 plane, the number of spaces divided is F (n-1). To have the largest number of spaces, the nth plane needs to intersect the first n-1 plane and cannot have a common intersection. That is, there are up to n-1 lines. The n-1 line divides the nth plane into a maximum of G (n-1) regions. (g (n) is the number of straight line planes in (1)) This plane divides the original space into two, and increases the space of G (n-1) up to a maximum.

Therefore: F=f (n-1) +g (n-1) ps:g (n) =n (n+1)/2+1

=f (n-2) +g (n-2) +g (n-1)

......

=f (1) +g (1) +g (2) +......+g (n-1)

=2+ (1*2+2*3+3*4+......+ (n-1) n)/2+ (n-1)

= (1+2^2+3^2+4^2+......+n^2-1-2-3-......-N)/2+n+1

= (n^3+5n)/6+1

A summary of plane segmentation of recursive method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.