Is there a name for a function that outputs more data than was put into it? For example: let's say I input a one byte value into the function and it returns a three byte value, is there a name for this type of function?

  • 2
    Please define what, precisely, you mean by "outputs more data". You have already received one answer that interprets this statement to mean that the cardinality of the set of possible inputs is strictly less than the cardinality of the set of possible outputs. However, it is not at all clear to me whether that is what you mean. Can you clarify? In particular, it is unclear whether you are talking about the codomain or the image of the function. Jun 7, 2022 at 8:32
  • I don't know how to be more specific. Would I need to understand what, "cardinality", or a, "codomain", is to answer this question? Jun 7, 2022 at 8:42
  • 3
    I think the only correct answer to this question is "no, there is no widely accepted canonical name" (except "function that outputs more data than was put into it.") If you want us just to suggest a potential new name for this kind of thing, I recommend to try our chat rooms.
    – Doc Brown
    Jun 7, 2022 at 9:44
  • Why do you ask? As Jörg W Mittag pointed out, an answer would completely depend on the interpretation of your question. E.g, if you told a programmer that some function you have is injective - it would never occur to them that you mean that it takes one byte and outputs three. In most programming languages, you don't normally work with raw bytes, you work with types, so this input/output ratio is not something that comes up regularly. On the other hand, a calling it a decompressor/generator would invoke an image of something that produces an output that takes up more memory. Jun 7, 2022 at 18:39
  • For illustration, consider this: a function takes a single object, and outputs an array of 5 numbers. It has more outputs than it has inputs, so the output is in some sense "bigger". But, this single input is a complex object that takes up thousands of bytes, and the output array is 20 bytes (5 numbers, 4 bytes each). Would such a function fit what you're describing or not? Jun 7, 2022 at 18:45

2 Answers 2


Assuming that your function is a function in the mathematical sense (i.e. it is deterministic and has no side effects), then at least it is injective and not surjective, since it has 2^8 possible inputs, but the codomain has size 2^24. Wikipedia

  • 1
    It doesn't have to be injective. For example a function f that takes a one byte value and always returns 0x000000 is not injective, because f (x1) = f (x2) does not imply x1 = x2.
    – Jasmijn
    Jun 7, 2022 at 9:16
  • This answer is plain wrong.
    – Doc Brown
    Jun 7, 2022 at 9:35

You could perhaps call it a "generator" or a "decompressor"; after all, there's no obvious upper bound on how much output from how little input there is. Even when you count the size of the function itself as "input".

There's an entire demoscene of work producing large amounts of video and sound output from four kilobyte executables.

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