Current location - Training Enrollment Network - Mathematics courses - Golden section algorithm
Golden section algorithm
Divide a line segment into two segments A and B with different lengths, so that the ratio of the long segment (that is, a+b) is equal to the ratio of the short segment B to the long segment A, and the formula is A: (A+B) = B: A, where the value of b/a is the golden ratio. The algorithm is as follows: because a:(a+b)=b:a, aa=b(a+b), that is BB+AB-aa = 0- 1. Let b:a=n, then b=na, and replace b in 1 with b=na. Then nn+n- 1=0, according to the root formula, n=(√5+ 1)/2 or n=(√5- 1)/2, because n = b: a.