Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek-v3-0324· DeepSeekHugging Face LMArena Human Preference 140K

How easy is it to write a computer program that outputs something, that would be very…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-3-7-sonnet-20250219’s answer.
  1. User

    How easy is it to write a computer program that outputs something, that would be very difficult to define by a mathematical formula. Simplicity of program vs formula.

  2. DeepSeek Assistant

    Introduction

    When I first encountered the question about the ease of writing a computer program that produces output difficult to define mathematically, I was intrigued. It seemed to touch upon the relationship between computation and mathematical expressibility. To explore this, I decided to break down the problem into manageable parts, examining what makes a program's output hard to define mathematically and comparing the simplicity of programs versus mathematical formulas.

    Understanding the Terms

    Computer Program: A set of instructions that a computer follows to perform a task. Programs can range from very simple (e.g., printing "Hello, World!") to extremely complex (e.g., operating systems).

    Mathematical Formula: An expression that defines a relationship or a rule using mathematical symbols. For example, ( f(n) = n^2 ) defines a function that squares its input.

    Output Difficult to Define by a Mathematical Formula: This likely refers to outputs that are complex, irregular, or not easily describable by a concise or closed-form mathematical expression.

    Simple Programs with Complex Outputs

    I started by considering simple programs that produce outputs not easily captured by a straightforward mathematical formula.

    Example 1: Pseudorandom Number Generators (PRNGs)

    • Program: A simple linear congruential generator (LCG) like x = (a * x + c) mod m.
    • Output: A sequence of numbers that appear random but are deterministic.
    • Mathematical Definition: While the generating function is simple, predicting or defining the sequence's properties (like its distribution over many iterations) can be complex, especially for large periods.

    Example 2: Cellular Automata (e.g., Rule 30)

    • Program: A one-dimensional cellular automaton with simple rules determining the next state based on current cell and neighbors.
    • Output: Produces complex, seemingly random patterns from simple initial conditions.
    • Mathematical Definition: While the rules are mathematically defined, the global pattern's properties (like its randomness) are not easily described by a simple formula.

    Example 3: The Collatz Sequence

    • Program: Start with any positive integer n. If n is even, divide by 2; if odd, multiply by 3 and add 1. Repeat.
    • Output: The sequence of numbers until reaching 1.
    • Mathematical Definition: The sequence is easy to compute but predicting its length or behavior for arbitrary n is an unsolved problem in mathematics.

    Comparing Simplicity: Program vs. Formula

    In the examples above, the programs are relatively simple in terms of lines of code or operational steps. However, the outputs they generate:

    1. Pseudorandom Sequences: While the generation rule is simple, the sequence's properties (like its period or distribution) require more complex mathematical analysis.

    2. Cellular Automata: Simple local rules lead to global behavior that's complex and not easily summarized by a formula describing the entire pattern.

    3. Collatz Sequence: The iterative process is straightforward to implement, but a general formula predicting the sequence's behavior for all n is unknown.

    This suggests that programs can encapsulate complex behaviors through iteration, recursion, or simple rules applied repeatedly, whereas mathematical formulas often aim for closed-form or direct expressions without iterative steps.

    Why Some Outputs Are Hard to Define Mathematically

    Mathematical formulas excel at describing relationships where there's a clear, direct, or closed-form expression. However, many computational processes rely on:

    • Iteration/Recursion: Repeated application of simple rules can lead to complex outcomes not easily captured without the iterative process itself.

    • Statefulness: Programs can maintain and update state over time, making the output depend on the entire history, not just initial inputs.

    • Emergent Complexity: Simple rules can give rise to complex behaviors that are properties of the system's dynamics rather than direct mappings from input to output.

    In contrast, traditional mathematical formulas are often stateless and non-iterative, making them less suited to describe processes where the path to the output is as important as the output itself.

    Examples Where Programs Outshine Formulas

    1. Fractals:

      • Program: Recursive or iterative algorithms can generate fractals like the Mandelbrot set.
      • Mathematical Definition: While the set is defined mathematically (as the set of complex numbers c for which the function ( f_c(z) = z^2 + c ) does not diverge), visualizing or describing the intricate boundary requires computational iteration.
    2. Chaotic Systems:

      • Program: Simple equations like the logistic map ( x_{n+1} = r x_n (1 - x_n) ) can exhibit chaos for certain r.
      • Mathematical Definition: While the equation is simple, predicting exact values after many iterations is practically impossible due to sensitivity to initial conditions.
    3. Algorithmic Information:

      • Program: A program that outputs the digits of Chaitin's constant (a non-computable number in general).
      • Mathematical Definition: The constant is definable but not computable by a finite algorithm in general, showing a limit to what programs can output based on mathematical definitions.

    Counterexamples: Where Formulas Are Simpler

    It's also worth noting that not all programs produce outputs hard to define mathematically. For instance:

    • Arithmetic Operations:

      • Program: print(2 + 2) outputs 4.
      • Mathematical Formula: ( 2 + 2 = 4 ). Both are equally simple.
    • Polynomial Evaluation:

      • Program: Computing ( f(x) = x^2 + 3x + 2 ) for a given x.
      • Mathematical Formula: The expression itself is straightforward.

    In these cases, the program and the mathematical formula are equally simple or the formula is more concise.

    Measuring Simplicity

    Program Simplicity:

    • Measured by lines of code, readability, or computational steps.
    • Simple programs can have few instructions but complex outputs due to iteration or recursion.

    Formula Simplicity:

    • Measured by the complexity of the mathematical expression.
    • Simple formulas are concise and don't rely on iterative definitions.

    Thus, a "simple" program can be one that's short and easy to write, even if its behavior is complex, whereas a "simple" formula is one that's brief and direct in defining the output.

    Theoretical Underpinnings

    This observation aligns with concepts from computability and complexity theory:

    • Universality of Computation: Simple computational models (like Turing machines) can perform complex computations given enough resources.

    • Kolmogorov Complexity: The minimal length of a program (in a fixed language) that produces a given output. Some outputs have short programs but no short mathematical descriptions.

    This suggests that for some outputs, the shortest description is a program, not a mathematical formula.

    Practical Implications

    In practice, this means:

    • Modeling Complex Systems: Computational models are often preferred over pure mathematical models when the system's behavior emerges from simple interacting parts (e.g., weather simulations, biological systems).

    • Algorithmic Art: Simple programs can generate intricate patterns or music that would be cumbersome to describe mathematically.

    Potential Missteps and Clarifications

    Initially, I wondered if all complex outputs from simple programs are inherently hard to define mathematically. However, some complex outputs can be described by mathematical constructs like recurrence relations or generating functions, albeit these might not be "simple" formulas.

    Also, the term "difficult to define" is subjective. A mathematician might argue that the program's code is itself a mathematical definition, albeit not a traditional formula. The distinction lies in the form and conciseness of the description.

    Conclusion

    After this exploration, it's clear that writing a simple computer program that produces output difficult to define by a concise mathematical formula is quite easy. The iterative and stateful nature of programs allows them to encapsulate complex behaviors that don't neatly translate into traditional mathematical expressions. This doesn't mean the outputs are beyond mathematical description, but that such descriptions may be more involved or less intuitive than the programs themselves.

    Final Answer

    It is generally easy to write a simple computer program that generates output which is difficult or cumbersome to define using a concise mathematical formula. This is because programs can leverage iteration, recursion, and stateful operations to produce complex, emergent behaviors from simple rules—behaviors that may not have straightforward closed-form mathematical expressions. Examples include pseudorandom number generators, cellular automata, and sequences like the Collatz conjecture, where the program's simplicity contrasts with the mathematical complexity of describing its output. Therefore, there exists a broad class of problems where simple programs can outshine mathematical formulas in succinctly defining or producing complex outputs.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.