k->infinity Inverse Math
You 1
vs
Agent L 1
by Boom Bunny Studios ยท Battle of the Functions!
Turn โ€”
Round โ€”
Score 1
๐ŸŽฏ Function Input
Awaiting game start...

๐Ÿ“Š Current Function

Function will appear here...

๐Ÿ“ Game Log

    ๐ŸŽฏ How to Play โ€” Inverse Math

    ๐Ÿ“ Objective

    Compete against Agent L to transform a polynomial function \(f(x)\) into the identity function \(f(x) = x\) by applying successive substitutions \(g(x)\). The player who achieves this in fewer moves wins!

    ๐ŸŽฎ Game Rules

    1. Setup: A random polynomial \(f(x)\) is generated that is monotonic on \([-10, 10]\)
    2. Your Turn: Enter a substitution function \(g(x)\) to compose: \(f(x) \to f(g(x))\)
    3. Success Condition: If \(|f(x) - x| < 0.02\) for all \(x \in [-10, 10]\), your turn ends with your current score
    4. Off Graph: If \(f(x)\) goes outside the graph bounds, you score 100 (penalty)
    5. Otherwise: Your score increases by 1, and you continue
    6. Agent L's Turn: Agent L uses a piecewise linear approximation strategy to find its substitution
    7. Winner: After both players complete their turns, the lower score wins!

    ๐Ÿ“ Allowed Functions in \(g(x)\)

    • exp(x) - natural exponential
    • ln(x) - natural logarithm
    • sqrt(x) - square root
    • x^n - powers (use ** or ^)
    • +, -, *, / - arithmetic operations
    • Parentheses for grouping

    ๐Ÿ’ก Strategy Tips

    • Look at the y-intercept (value at \(x=0\)) and slope at \(x=0\)
    • Use exponential functions to eliminate constant terms
    • Use logarithmic functions to adjust higher-order terms
    • Try to approximate \(f(x)\) with a simpler function and invert it
    • Keep the function monotonic to avoid going off-graph

    ๐ŸŽฏ Detailed Strategy Hints

    1. Remove constant term: If \(b\) is the y-intercept and \(c\) is the slope at \(x=0\), then the choice \(g(x) = -\frac{b}{c} e^{-x/b}\) (where \(e^x\) is the natural exponential function) removes the constant term and gets the linear term correct.
    2. Adjust higher-order terms: The choice \(g(x) = b \ln(1 + x/b)\) (where \(\ln\) is the natural logarithm) can be used to alter higher order terms without affecting the linear term.
    3. Direct inversion: If you can come up with an estimate \(h(x)\) of \(f(x)\) (which could be a polynomial, for example), then setting \(g\) to be the inverse function of \(h\) would be a good way to try to achieve \(f(g(x)) = x\).

    ๐Ÿ’ก Pro Tip: Start by eliminating the constant term and getting the linear term correct, then work on higher-order corrections!

    Starting in 40sโ€ฆ

    ๐ŸŽฏ Game Configuration

    ๐ŸŽ‰ Game Complete!

    ๐ŸŽฏ Game Rules โ€” Inverse Math

    ๐ŸŽฏ Objective

    Transform a polynomial function \(f(x)\) into the identity function \(f(x) = x\) by applying successive substitutions. Compete against Agent L to achieve this in the fewest moves possible!

    ๐ŸŽฎ How to Play

    1. A random monotonic polynomial \(f(x)\) is generated on \([-10, 10]\)
    2. Enter a substitution function \(g(x)\) to compose \(f(x) \to f(g(x))\)
    3. Goal: Make \(|f(x) - x| < 0.02\) for all \(x \in [-10, 10]\)
    4. Each substitution increases your score by 1
    5. If \(f(x)\) goes off-graph, you get a penalty score of 100
    6. Lower score wins!

    ๐Ÿ“ Function Syntax

    • exp(expression) - natural exponential \(e^x\)
    • ln(expression) - natural logarithm
    • sqrt(expression) - square root
    • x^2 or x**2 - powers
    • +, -, *, / - arithmetic operations

    ๐Ÿ’ก Strategic Hints

    1. Remove constant term: If \(b\) is the y-intercept and \(c\) is the slope at \(x=0\), use \(g(x) = -\frac{b}{c} e^{-x/b}\)
    2. Adjust higher terms: Use \(g(x) = b \ln(1 + x/b)\) to modify higher-order terms while preserving the linear term
    3. Direct inversion: If you can approximate \(f(x) \approx h(x)\) with a simpler function, use the inverse of \(h\) as your \(g(x)\)

    ๐ŸŽจ Tips for Selecting Appropriate Functions

    ๐Ÿ“Š Step 1: Analyze the Current Function

    • Check the y-intercept \(b = f(0)\): Look at where the curve crosses the y-axis. If \(b \neq 0\), you'll need to remove this constant term first.
    • Estimate the slope \(c\) at \(x=0\): Observe how steep the curve is at the origin. The slope should eventually reach 1 for \(f(x) = x\).
    • Observe the curvature: Is the function bending upward (convex) or downward (concave)? This tells you if higher-order terms are positive or negative.

    ๐Ÿ”ง Step 2: Choose Your Strategy

    Strategy A: Fix the constant and linear terms first

    • When to use: When \(f(0) \neq 0\) or the slope at \(x=0\) is far from 1
    • Formula: \(g(x) = -\frac{b}{c} \exp(-x/b)\)
    • Example: If \(f(0) = 5\) and slope \(\approx 2\), try \(g(x) = -2.5 \cdot \exp(-x/5)\)
    • Effect: This removes the y-intercept and corrects the slope at the origin

    Strategy B: Adjust higher-order terms

    • When to use: When \(f(0) \approx 0\) and the slope is close to 1, but the curve is still curved
    • Formula: \(g(x) = b \cdot \ln(1 + x/b)\) where \(b\) is a small constant (try values between 1 and 5)
    • Example: If the function is nearly linear but slightly curved, try \(g(x) = 2 \cdot \ln(1 + x/2)\)
    • Effect: This compresses or stretches the function nonlinearly while keeping the linear behavior near the origin

    Strategy C: Direct polynomial inversion

    • When to use: When you can approximate \(f(x)\) as a simple polynomial like \(f(x) \approx ax + bx^2\)
    • Approach: Find the inverse of your approximation analytically
    • Example: If \(f(x) \approx 2x\), use \(g(x) = x/2\). If \(f(x) \approx x^2\) (and positive), use \(g(x) = \sqrt{x}\)
    • Warning: Make sure your \(g(x)\) is defined on \([-10, 10]\). For example, \(\sqrt{x}\) won't work for negative \(x\)!

    โš ๏ธ Common Pitfalls to Avoid

    • Domain issues: Be careful with \(\ln(x)\) (undefined for \(x \leq 0\)) and \(\sqrt{x}\) (undefined for \(x < 0\) in real numbers). Use \(\ln(1 + x/b)\) or similar to keep arguments positive.
    • Explosive growth: Avoid large exponential coefficients like \(\exp(10x)\) as they'll quickly send the function off-graph (penalty score of 100!)
    • Sign reversals: If your substitution reverses the sign or direction of the function, it might break the monotonicity and cause it to go off-graph.
    • Overfitting: Don't try to perfectly match every detail in one move. Incremental progress is better than going off-graph!

    ๐ŸŽฏ Example Workflow

    1. Move 1: Function has \(f(0) = 8\), slope \(\approx 3\). Use \(g(x) = -8/3 \cdot \exp(-x/8)\) to fix intercept and slope.
    2. Move 2: Now \(f(0) \approx 0\), slope \(\approx 1\), but curve is bent. Use \(g(x) = 3 \cdot \ln(1 + x/3)\) to reduce curvature.
    3. Move 3: Function is nearly linear. Use \(g(x) = x + 0.1x^2\) for fine-tuning if needed.
    4. Result: Achieve \(|f(x) - x| < 0.02\) and win with a low score!

    ๐Ÿค– Agent L's Strategy

    Agent L uses a piecewise linear approximation method, selecting \(M = V+1\) points on the curve and fitting a monotonic piecewise linear function through them, then applying its inverse.

    ๐Ÿ’ก Pro Tip: Start by eliminating the constant term and getting the linear term correct, then work on higher-order corrections!