4 ms·
Smirk denied, I'm afraid. The manual (PDF at [1]) says: > ... which causes the statement to have only the specified percent chance of being executed each time
by omnicognate 3y ago
Smirk denied, I'm afraid. The manual (PDF at [1]) says:
> ... which causes the statement to have only the specified percent chance of being executed each time it is encountered in the course of execution."
Only the most willfully perverse reading of that would allow the xkcd approach, and while INTERCAL is undeniably perverse it isn't that sort of perversity.
Of course, none of this affects the fact the GPT paragraph I quoted is a complete fabrication.
[1] https://3e8.org/pub/intercal.pdf https://3e8.org/pub/intercal.pdf
- TeMPOraL 3y agoImagine an array bool[100] initialized with false. Set every (100/N) elements to true, where 0 < N <= 100. Associate that array with the %N statement. Give it also a counter, incremented each time the statement is encountered. Execute statement when array[counter % 100] == true, skip otherwise. I think this fits the specification, isn't a perverse interpretation, and clearly isn't a meaningful PRNG either.
- omnicognate 3y agoI have to wonder at the motivation here. Are you just playing around with this as an amusing semantic game or are you actually trying to defend the output of GPT-4? If the former, fine but I definitely disagree. If I were to use an API that were documented in those terms but behaved the way you describe I would be absolutely livid. I'd want to seek out the authors and do violence upon their person. That is not a reasonable pairing of description and implementation, and I'm sure you'll be unsurprised to know it's not what C-INTERCAL does [1]. It doesn't use a cryptographically secure RNG, sadly (though there's no reason it couldn't), but it does use a RNG and certainly doesn't do what you suggest. If the latter, though, I'm curious about the psychology. As I mentioned, this semantic rabbit hole is irrelevant to the profound wrongness of the paragraph I quoted. Every part of the sentence is wrong: the code isn't using a clever trick to produce seemingly random numbers, it's using the random behaviour built in to the language; %50 doesn't have anything to do with "mingl[ing] the bits of two 16-bit numbers" (that's "interleave", denoted with what looks like a cent symbol); the #1, #2 etc are constants, not unary operations; the fact that different results are produced each time is part of the language behaviour not the result of some trick. If you are defending this, why? [1] https://github.com/calvinmetcalf/intercal/blob/8a65e8ba1cc65870b0d6b1bb174a4c4560bde07f/src/cesspool.c#L838 https://github.com/calvinmetcalf/intercal/blob/8a65e8ba1cc65...
- TeMPOraL 3y agoA bit of both. The way they author and the commenters approach this rubs me wrong, because my long C++ and Common Lisp experience - both languages with a standard and multiple competing implementations - taught me that any correct read of the standard is valid, and you can't make assumptions that are narrower than what the standard says. The approach I presented is a valid implementation of the quoted/referenced documentation, and the approach itself is done frequently in algorithms when optimizing for speed, and when perception of randomness is sufficient - this commonly shows up in gamedev, and sometimes in statistics. So in short, I'm defending GPT-4 by suggesting it's taking a language lawyer approach to the problem space, not assuming things beyond the letter of the spec. As for why am I doing it in the first place, it's because I'm biased in at least four ways: 1) I like GPT-4, 2) I believe it's doing a subset of what we call thinking, 3) I hate bad takes - which I believe this article is, and 4) I'm a sucker for showing off on the Internet.
- breadbox 3y agoLook, I understand your point. I really do. But I feel that (perhaps due to one or more of your acknowledged biases) you're applying the wrong context to the situation at hand. Namely: this is INTERCAL. There is no freaking standard. The "standard" is a 60-page text file written in 1973. The current compiler was written 90% based on this joke-filled document, and 9% new ideas because ESR came up with something even more ridiculous. (The remaining 1% was Don Woods responding to emailed questions by consulting his memory. He still has paper copies of the SPITBOL source code, but the original compiler hasn't been run in over 50 years.) There is no standard because at any given time there are at most three people on the planet who care one iota about INTERCAL standardization, and are only willing to put in any effort if it would be funny. So, for example, the question of what sort of randomness the double-oh-seven operator is contractually required to use is simply not a contextually relevant question. You seem to be suggesting that it might be possible, even thinly so, that Chat-GPT somehow misapplied a strict standard of randomness in the formation of its response, instead of simply papering over a hole in its knowledge with a bit of improvised plausible-sounding guesswork, a well-documented behavior of both Chat-GPT and thinking entities worldwide. If not, then I humbly apologize for misunderstanding your point. Otherwise, I must politely agree to disagree. And I'm sorry that my essay rubbed you the wrong way. Perhaps one day you will find it better than you do now, but if not then I hope it passes from your memory quickly.