• + 6 comments

    Explanation:

    A straight forward implementation would start with an array for and perform modifications, where the elements for are getting the value added.

    This would need

    operations, so it is . The constraints require to handle up to and resulting in about operations, which is outside the given resources.

    The above solution manages to requires setup steps and a final integration step visiting not more than array elements, so it is . For the constraints not more than about steps are needed, which is possible to compute with the given resources.

    In Detail:

    Let us start with the continuous case:

    We start with a constant function and then add the modifications, going through a sequence of modified functions .

    Given and adding the value for all times , this results into the modified function

    where is the characteristic function of set and is the Heaviside distribution
    The derivative is
    where is the Dirac distribution.

    For the discrete case this seems to turn into

    with

    So the modeling of the derivative is very efficient, only recording the changes at the interval borders.

    After modifications of the constant null function we get:

    Finally is reconstructed by summing up (integrating) over :

    where we used as smallest value.

    • + 0 comments

      holy .... awesome explanation! It took me a couple hours to remember some math definitions. Thank you so much.

    • + 0 comments

      Great article ! Thanks. A small suggestion, logical explanation would be better rather than mathematical, since it is confusing to understand the equation and its representation.

    • + 0 comments

      This was soooo helpful! Thank you.

    • + 1 comment

      Really nice and clean! One thing I wonder, though. What prompted @mvanwoerkom to take the derivative? I understand it makes everything easier, but it would never occur to me, as a logical step, to take the derivative and integrate at the end.

      • + 0 comments

        I think this is a common computing strategy if it's less taxing to calculate than the original functions because you can work backwards to get the same number at the end

    • + 1 comment

      wodo stuff this is how you make 5 minute solution wodo. overcomplification. need better solution which work in real world not on therotical basis. it is in dream. By the way good copy paste.

      • + 0 comments

        Totally agreed

    • + 0 comments

      Thanks! This what I was expecting in Discussion