last day (15 days later) » 

06:58
6
A: Give f and g that sometimes commute

Nobody Needs NamesPython Submission, This is the minimum. PROVED. Program 1, Function \$f\left(x\right)=\left|x\right|\$, 3 Bytes abs Program 2, Function \$g\left(x\right)=\text{id}\left(x\right)\$, 2 Bytes id Total Size: \$3+2=5\text{ Bytes}\$ Explanation: For all integer x, id(x) returns a different positive num...

All negative numbers.
@Adám You might be thinking that id here is the identity function, whereas it's actually Python's built-in to get the "identity" of an object, that is its memory address.
Yes indeed. The definition for id satisfies that id(1)!=id(-1).
BTW, what's an identity function? Like, lambda *args: 0?
@NobodyNeedsNames identity=lambda x:x
Though, id is weird in ways that suggest it's not a pure function in the mathematical sense, in that it can give different results each run, or for two variables holding the same number, as seen here.
Oh OK, but who would need THAT function...?
@xnor so is it valid? or do I have to ask the OP?
(+, can you tell me what OP stands for)
06:59
OP = original poster. The OP did say “given the same input, it must produce the same output”. The id function doesn’t satisfy that.
well
what does the "same input" mean
?
OP also said ‘Interpret "function" in the mathematical sense.’
surely if you put in different variables it isn't the "same input"...
The mathematical sense is ℤ → ℤ, not (Python variable) → (Python variable).
oh ok
I will change that
@AndersKaseorg Is there a trivial way to edit it?
07:03
You’ll have to come up with a function other than id. I think it’s clear that any use of id is banned by this challenge.
> they must be pure (given the same input, it must produce the same output)
well, that depends on wdym by "same input"
There really isn’t any wiggle room here. The OP made it clear in both the spirit and the letter of the challenge that they’re talking about mathematical integers.
@pxeger .
I'm convinced but I will wait for the OP.
@AndersKaseorg .
07:17
My 6-byte Zsh answer was invalid for a similar reason: f(07) ≠ f(7), even though 07 = 7. (Apart from the fact it wasn't valid anyway, because I'm not awake)
hahaha
OIC cjquine is here
i think you do want lambda x:x
i don't think id counts
oh ok, i will delete
that
No answer using lambda x:x can be valid
if f(x) = x for all x, then f(g(x)) = g(x) = g(f(x)) for all x

last day (15 days later) »