Current location - Training Enrollment Network - Mathematics courses - What is Gaussian algorithm?
What is Gaussian algorithm?
In a math class, the teacher asked the students to practice arithmetic. So let them work out the number 1+2+3+4+5+6+ ... one hour+100. Only Gaussian in the class gave the answer in less than 20 minutes, because he thought of using (1+kloc-0/00)+(2+99)+(3+98) ...+(50+51) ........................................................................... Later, people called this simple algorithm Gaussian algorithm.

The specific method is:

The first item plus the last item times the number of items divided by 2.

The number of items is calculated by subtracting the first item from the last item, dividing it by the item difference (the difference between every two items), and then adding 1.

1+2+3+4+5+ +n

Letter: n( 1+n)/2

Arithmetic progression's summation formula sn = (a1+an) n/2sn = n (2a1+(n-1) d)/2; D= tolerance Sn = An2+Bn;; A=d/2,B=a 1-(d/2)