![]() ![]() One way of presenting Gauss' method is to write out the sum twice, the second time reversing it as shown. Gauss's method forms a general formula for the sum of the first $n$ integers, namely that $$1+2+3+\ldots +n=\fracn(n+1)$$ The rest of the article explains how you could use algebra to write Gauss's method - if you haven't yet learned any algebra you may wish to skip this part. Or why not challenge a friend to add up the numbers from $1$ to a nice large number, and then amaze them by getting the answer in seconds! ![]() What about $1$ to $50$? The answers are at the bottom of this page. Gauss could have used his method to add all the numbers from $1$ to any number - by pairing off the first number with the last, the second number with the second to last, and so on, he only had to multiply this total by half the last number, just one swift calculation.Ĭan you see how Gauss's method works? Try using it to work out the total of all the numbers from $1$ to $10$. Rather than performing a great feat of mental arithmetic, Gauss had seen the structure of the problem and used it to find a short cut to a solution. While the story may not be entirely true, it is a popular tale for maths teachers to tell because it shows that Gauss had a natural insight into mathematics. By his early twenties, Gauss had made discoveries that would shape the future of mathematics. Fortunately his talents were discovered, and he was given the chance to study at university. It is remarkable that a child still in elementary school had discovered this method for summing sequences of numbers, but of course Gauss was a remarkable child. so the total would be $50$ lots of $101$, which is $5050$. He had added the numbers in pairs - the first and the last, the second and the second to last and so on, observing that $1+100=101$, $2+99=101$, $3+98=101$. Quickly in his head, but the eight year old Gauss pointed out that the problem was actually quite simple. The teacher couldn't understand how his pupil had calculated the sum so He was shocked when young Gauss, after a few seconds thought, wrote down the answer $5050$. If the total of the two digits is 10 or more, then regroup the 10 Ones into 1 Ten and move it into the Tens column. Write the number of Ones below the line in the Ones place. One day Gauss' teacher asked his class to add together all the numbers from $1$ to $100$, assuming that this task would occupy them for quite a while. Step 1) Add the Ones digit of both numbers together. The most well-known story is a tale from when Gauss was still at primary school. ![]() Like many of the great mathematicians, Gauss showedĪmazing mathematical skill from an early age, and there are many stories which show how clever he could be. During his lifetime he made significant contributions to almost every area of mathematics, as well as physics, astronomy and statistics. TxtHeight4 = Convert.ToInt32(Height4.Carl Friedrich Gauss (1777-1855) is recognised as being one of the greatest mathematicians of all time. If the "TotalArea" Control is not a field that the user should fill in, but rather a sum of the total area as calculated from the various lengths and heights, your code should look like this: Dim txtLength1 As Integer TxtHeight4 = Convert.ToInt32(Height4.Text)ĭim Area1Total As Integer = txtLength1 * txtHeight1ĭim Area2Total As Integer = txtLength2 * txtHeight2ĭim Area3Total As Integer = txtLength3 * txtHeight3ĭim Area4Total As Integer = txtLength4 * txtHeight4Īrea = Area1Ttotal + Area2Total + Area3Total + Area4TotalĮdit: Did some minor adjustments in order for you to be able to have the last Area part as it should aswell (since the. TxtLength4 = Convert.ToInt32(Length4.Text) TxtHeight3 = Convert.ToInt32(Height3.Text) TxtLength3 = Convert.ToInt32(Length3.Text) TxtHeight2 = Convert.ToInt32(Height2.Text) TxtLength2 = Convert.ToInt32(Length2.Text) TxtHeight1 = Convert.ToInt32(Height1.Text) TxtLength1 = Convert.ToInt32(Length1.Text) This would do the trick: Dim txtLength1 As Integer Without taking into account peoples tendency to write other stuff than integers When I run this code I get an error saying "Conversion from string "" to type 'Integer' is not valid." ![]() This is the code that I have at the moment Dim txtLength1 As IntegerĪrea = Area1.Text + Area1.Text + Area3.Text + Area4.Text Now I want to add up the four numbers that are in the text boxes and display the answer in a separate text box when I click a button. I got the code to multiply the length by the height to work out the area of each wall and display each of the four areas in separate text boxes. In my code I'am getting the user to enter the length and height of each of the four walls. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |