4 ms·
There are easy examples that prove both sides. Depending on your use, the current state of AI does some amazing things. It also is being pigeonholed into areas
by ksaj 2y ago
There are easy examples that prove both sides. Depending on your use, the current state of AI does some amazing things.
It also is being pigeonholed into areas where it is not yet ready. There are a LOT of examples out there on that.
A hobby of mine is using AI to find bizarre ways to code things that aren't the normal way of thinking of the problem. Obviously it isn't practical, but it is fun. I most recently got ChatGPT to generate Pi from a random length string of 5's like this:
~~~
from math import sin, radians
def fives(repeat: int) -> float:
repeated = 1 / int('5' * repeat)
value = sin(radians(repeated)) * (10 ** (repeat + 2))
return value
~~~
Yes, it uses a repeating string of 5's to generate pi. Call it with "fives(18)" as an example. This is a cleaned up version of what ChatGPT gave me, but all the same, it works. A string of 5's can give you progressively more accurate estimations of pi - more 5's, more accurate pi.
Bizarre question to ask an AI, but playing like this is how eventually discoveries are made, since it is capable of coming up with working answers.
(Edit: corrected markdown copy-pasta weirdness. You can copy/paste but have to remove the extra indents HN adds. It's normal python, you know how to do it.)
- plasticeagle 2y agoBut... This code just outputs almost-zero. It clearly just sets `repeated` to a number very close to zero, takes the sin of it - which will also be close to zero - and then multiplies that by a small number. I don't think this is how discoveries are going to be made. What am I missing here?
- ksaj 2y agoIt outputs a very close estimation of pi every time. The slash-* is from how HN interprets the code (poorly). Here's a corrected one using a margin: from math import sin, radians def fives(repeat: int) -> float: repeated = 1 / int('5' * repeat) value = sin(radians(repeated)) * (10 ** (repeat + 2)) return value fives(18) Cut/paste that into your python repl, and make sure the lines are intact without the HN extra indents. Change the 18 to any int you want (except it overflows at 308... easy to fix, but not worth bothering). It might be close to zero... but it's much more like 3.14... when you run it.
- plasticeagle 2y agoYes, that does fix it. But using `sin`, and `radians` means that you equation to generate pi already has pi in it.
- ksaj 2y agoSure. But make the connection with the 5s. It isn't just copying that pi. It is getting there in a very non-direct route. You can do the same with 9s, for the same reason you might be picking up on if you don't trivialize that there is another pi in the mix. You can't escape it when you're talking about circular things, regardless. Every proof or non-coincidental estimate of pi (ie: not 22/7) out there has pi embedded in the proof somehow. Dismissing it is like saying the Pythagorean theorem is bollocks because they also add up to the same number of degrees. Even though you're describing it in lengths, the degrees don't disappear. This code is very much like that. Just not triangular.
- valicord 2y agoThe thing is that in this particular case it does in fact just copy the pi. You're essentially calculating radians(x)*180/x, which by definition is equal to pi. The radians function is doing all the heavy lifting, unlike say using the Taylor series or some other approximation approach.
- ksaj 2y agoIt is doing this: sin(555555555555555555), where the 5's are an x number of 5s that increasingly converges on pi, and calculates the correct decimal placement. It's not (quite) as trivial as just copying the pi.
- valicord 2y agoNope, that is not what it does. First, sin(x) ~= x for small x. Second, 1000.../555... = 1.8. Neither of these have anything to do with pi. With these in mind, the program can be simplified as sin(radians(repeated)) * (10 ** (repeat + 2)) = radians(repeated) * 100 * 1.8 / repeated = repeated * pi / 180 * 180 / repeated = pi The main and only reason you get pi in the end is that the radians function is defined as radians(x) = pi * x / 180, which requires knowing the value of pi to begin with. So this program is basically an equivalent of multiply_the_argument_by_pi(555) / 555 except with a few layers of completely unnecessary math on top of it to obscure the magic trick.
- whstl 2y agoThis is interesting, but that's because you started with an interesting question, and probably also because you know how to code. The problem with AI blogspam (and AI image spam) and is that most of it is not even interesting to begin with: the desired result and the prompts are already terrible, so even if it was custom drawn or written by a professional, it would be crap. With AI, because of the lower barrier to entry, people don't care about spending a few cents building garbage. This is why I doubt more quality AI will help. :/
- ksaj 2y agoSpam (and porn) industries are highly opportunistic, in that they exploit every new technology, often before more productive uses are found for them. Unfortunately this is just one of many that gets treated the same way. The professionals using AI (and even then, a minority of them) actually spend the time to ensure they're getting quality results. Even AI requires some massaging to get what you actually want. It's a tool. Not a miracle. A carpenter doesn't just bang a nail once and expect things to hold together. I'm not a particularly good coder. I'm just interested in the oddities that can be shown through code, and am just (barely) savvy enough to see it through. I only had a vague idea how you could get pi from a string of 5's, but it wasn't very hard to get ChatGPT to code it for me once I described it. The same can be done with a randomish length string of 9's, but I'll leave that for others to discover.
- nyarlathotep_ 2y ago> The problem with AI blogspam If someone can't be bothered to write it, why would someone be bothered to read it?
- AnimalMuppet 2y agoThis. Let an AI read it; I won't bother.