Beta

Welcome to Economics! #2 Economic Surplus

Description
Loading description...
Fundamentals
Graph Theory
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    Floating point error in random tests:

    Expected: 5376.84, instead got: 5376.85
    
  • Voile Avatar

    The meaning of the input is not explained. What does 5p -40 and -5p +200 mean?

  • JohanWiltink Avatar

    I haven't actually done all the expansion, but in the producer surplus calculation, we are told to use the equilibrium function, and then we still need to calculate the zero supply price. That means parsing the supply curve anyway, so depending on the equilibrium function doesn't really save any work. I could have just copied the curve parsing code .. wait, I did.

    Producer surplus function does not need to depend on equilibrium function, it could just be doing its own calculations.

  • JohanWiltink Avatar

    In the example, producers are willing to supply at negative prices. Not the most ideal example.

  • JohanWiltink Avatar

    Rounding intermediate results. Bad practice.

    • ceruberu Avatar

      Yeah, but I was wondering what should I do with these random equilibrium function that end up with endless decimal digits. So maybe I should change the kata to find only the producer surplus?

    • JohanWiltink Avatar

      Or not have one call the other, have it do its own calculation without intermediate rounding. Is that an option?

    • ceruberu Avatar

      I just removed equilibrium part and added consumer surplus. They have to find equilibrium points to answer this question anyway. Also I made constant of supply curve negative, does it solve the negative prices problem? Thanks again

      Issue marked resolved by ceruberu 8 years ago
  • St3f4n Avatar

    This comment has been hidden.

    • JohanWiltink Avatar

      No.

      But producers are willing to supply at negative prices, which makes it not a very good example.

      The linked Wikipedia page has the calculation (which also takes the zero supply price as an argument).

    • St3f4n Avatar

      This comment has been hidden.