|
-
May 8th, 2025, 02:53 PM
#11
Re: Post election prediction
 Originally Posted by Peter Porter
Oh, right, Newton's method. Because nothing says 'I'm super intelligent' like casually dropping an advanced math term into a political conversation. Who needs actual points when you can just leave everyone wondering if they missed a calculus class? 
What an odd thing to say. Except for the most basic understanding of graphs, functions and derivatives, I don't know **** about calculus.
Newton's method isn't even remotely the most advanced mathematical concept there is. This is all it is:-
Code:
Function SqrtNewton(number As Double, Optional tolerance As Double = 0.000001, Optional maxIterations As Integer = 1000) As Double
If number < 0 Then
Throw New ArgumentException("Cannot compute the square root of a negative number.")
ElseIf number = 0 Then
Return 0
End If
Dim guess As Double = number / 2.0
Dim iteration As Integer = 0
While Math.Abs(guess * guess - number) > tolerance AndAlso iteration < maxIterations
guess = (guess + number / guess) / 2.0
iteration += 1
End While
Return guess
End Function
That is one of the the most basic applications of Newton's method there is. In the absence of an intrinsic function to calculate square roots, the above can be used. It's just an iterative method of calculating roots. It keeps squaring smaller and smaller numbers until the difference between those squares and the original number you want to find the square root of is almost zero. It's a thing I'd expect all experience programmers to at least be aware of which I why I felt comfortable mentioning it here. If the intent of your comment was to insult me then you only insult yourself by suggesting that I overestimated you. If I wanted to show off I wouldn't use something so trivial as Newton's method to do so.
As for why I mentioned it, it was just the thought that immediately spang to mind when I was reading wes's post. I thought the question of why there was such an even split on political positions was fascinating. A part of me was immediately reaching for an answer and that came to mind. I was thinking of elections as iterations where people were closing in on an optimal answer to how people can be maximally happy and minimally frustrated and I was thinking that such an even split could be an indication that society was close to an optimal answer which is why I related it to Newton's method. It's just a random thought I had, nothing more.
By the way, the only reason I asked for a guess, was not to "show off" but it was on the off chance that anyone else was thinking along similar lines because if they were, I wouldn't have to bother explaining my thought process.
You know what else I find interesting? Wes, Tyson and Sapator took my comment in jest, but you chose to attack me for it. It is as harmless a comment as I've ever made yet somehow you found reason to take offense. What am I to make of that? Is it because I'm not some radical Trump hating liberal like you, that makes it ok to attack me over every mundane thing I say? Tell me. I'd really like to know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|