• Arghblarg@lemmy.ca
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    1 year ago

    You know this would be a great programming problem for CS students. Given the phrase “head less horse man”, generate all 4-word phrases, repeated words allowed. (Some of the ones in this picture aren’t 4 words, but anyways…)

    Consider the words “head less horse man” to be digits in a base-4 number system; head=0 less=1 horse=2 man=3. Counting from 0 to (4^4)-1 would yield 256 unique values,

    • head head head head = 0
    • head head head less = 1
    • head head head horse = 2
    • head head head man = 3
    • head head less head = 10 (4 base 10)
    • man man man man = (4^4)-1 = 3333 (255 base 10)

    Bonus points for funniest picture to go with a value (must be hand-drawn by student, no AI allowed) :)

    EDIT: not permutations, which I originally said. It’s more of an exercise in understanding how to count in bases other than 10.