0
$\begingroup$

This puzzle was inspired by some tutorial code I downloaded from someone else’s GitHub. To protect the guilty, I have withheld the author’s name, paraphrased the relevant Python into pseudo-code and “removed the context”. I will only say the context has something to do with machine learning.

What message is represented by the following pseudo-code below and why?

NOTE: for purposes of this question please ignore the distinction between sets (unordered collection of objects) and strings (ordered set of characters, which may contain repeated letters).

enter image description here

$\endgroup$
3
  • $\begingroup$ Is there a particular reason that the code is in an image instead of a code block? The latter would be easier to work with, but there might some puzzle-related reason behind the choice so I'll hold off transcribing for now. $\endgroup$
    – bobble
    Nov 9, 2022 at 5:04
  • 4
    $\begingroup$ The comment and realization of the function split_ABC are not identical. The actual ratio of A, B and C are p, (q - qp) and (1 - p - q + qp). Is that by mistake or intended? $\endgroup$
    – xd y
    Nov 9, 2022 at 5:37
  • $\begingroup$ FWIW the GitHub code in question seems to have improved and the bug is fixed. I'm not sure if that was the result of me posting this puzzle :) $\endgroup$
    – happystar
    Dec 13, 2022 at 22:11

1 Answer 1

6
$\begingroup$

I believe the answer is

some coders SUCK

Explanation

First, I saw that the numbers 0.285714 and 0.48571 are decimal approximations of 2/7 and 3/7 respectively, and that there are 14 letters in the initial set.

Based on the comments being about dividing the input set randomly, I can guess that this means that the final answer is probably 3 words, drawn from 4, 6, and 4 letters from the original set.

Next, there are four capital letters. If there were three, I'd have assumed that each one was the start of the word, but since there are four, they're probably all part of the same word. It helps that these four letters anagram to "SUCK" which is a fairly well known word. After that, I case-bashed to get "some" and "coders" which seems to fit the theme.

$\endgroup$
2
  • $\begingroup$ Your hypothesis is further corroborated by the fact that the (pseudo-)code doesn't actually work: the length of "temp" is not the same as that of X, so the second split happens at the wrong place. $\endgroup$
    – Bass
    Nov 9, 2022 at 7:02
  • $\begingroup$ Yes, this is the correct solution - and the comments by Bass and "xd y" are correct. Admittedly not my greatest puzzle but I was somewhat annoyed by the fact that Joe Bloggs can't even get a basic tutorial example right, and I did put in the effort to go through it since it was most definitely work-related $\endgroup$
    – happystar
    Nov 9, 2022 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.