Retired

Saint Petersburg Paradox Model (retired)

17 of 63GiacomoSorbi
Description
Loading description...
Probability
Data Science
Statistics
View
AllIssues4Questions1Suggestions2Show Resolved
  • Please sign in or sign up to leave a comment.
  • BenPodrazhansky Avatar

    This comment has been hidden.

  • e404 Avatar

    The Description proposes really interesting problem.

    Infinite increase of reward with infinite decrease of reward probability added up to be an infinitely big number.

    I would say it is not contradiction between rationality and math, but deficiency of math model in comparison to reality.

    If we simplify our task we can say -- how much can we bet for a chance to get 1 Million as reward for say 10 tosses of a coin in a row.

      probability p = 1/(2^10) = 1/1024  
      reward      r = 1'000'000 
      equvalent 976.56 
    

    If reward would be increased to infinity, than equivalen would also be infinity.

    But on the fifth row of description author making assumption that in reality the value of this potential remuneration having range of values between

    20 and 25
    units. The rationale behind this assumption is completely not clear.

    For example in the vending machines kids are usually paying 2 units for the chance to win a prize worth 0.5 units. I.e. people could not be expected to behaive rationaly.

    Next line Author suggest the reason of poor "rationality" and stating that people devaluate probability the further they get.

    I.e. there is mathematical probability and there is human perception of it. Both are declining each step, but the later one declining more and the difference raise. (It looks like it is not relevant for the problem as problem considers fixed probability.)

    And in next paragraph the explanation becomes completely hard to get.

    To simplify, let's say that a given player will consider fully the chances of a full toss (which then still values as 1), then it will start to decrease them as unlikely by a given probability weight factor at each successive toss, in a multiplicative way.

    Full toss has a value of 1. I.e. Sum of all consequitive tosses from the SPB paradox added all together gives 1.

    And player devalue them.

    No, seems the problem is -- lets have 1 unit as reward and p probability of each step. Than total expected reward for S steps would be: 1+ 1p + 1p^2 + ... 1*p^S

    And our codewarriors are suggested to calculate it.

    But i do not understand how this calculation is connected with SPB paradox ?

  • e404 Avatar

    c++ code template contains the following:

    //your code here - round to 2 decimals
    

    At the same time test cases are:

     Assert::That(saintPetersburgParadox(0.5,  10), EqualsWithDelta(1.99805, 0.001)); // rounded 2.00 not in [1.99705,1.99905] fail
     Assert::That(saintPetersburgParadox(0.75, 15), EqualsWithDelta(3.94655, 0.001)); // rounded 3.95 not in [3.94555,3.94755] fail
     Assert::That(saintPetersburgParadox(0.99, 20), EqualsWithDelta(18.2093, 0.001)); // rounded 18.21 ok
     Assert::That(saintPetersburgParadox(0.99, 25), EqualsWithDelta(22.2179, 0.001)); // rounded 22.22 not in [22.2169,22.2189] fail
    

    I suggest to remove rounding requirement from the user code template. or Increase delta to be 0.01 in al ltest cases.

  • Lissa-krassa Avatar

    Can you explain please, what the perceived value is? I do not understand this from the description.

  • user9644768 Avatar

    Ruby 3.0 should be enabled.

  • FacelessHacker Avatar

    The description is too long. It has to be shortened somehow.

  • FArekkusu Avatar

    Using assert_equals in Python's random tests.

  • tachyonlabs Avatar

    In Python, do you really want this much precision?

    Testing for 0.93 and 357
    It should work for random inputs too: 
    14.285714285634262 should equal 
    14.285714285634263
    
  • cliffstamp Avatar

    Haskell : https://www.codewars.com/kumite/5bbbaffaf6e30da9ed00020e?sel=5bbbaffaf6e30da9ed00020e

    (doesn't round, just checks that it is ~0.01)

    If you are ok with that I can update the description.

  • FArekkusu Avatar

    Python, Ruby, JS and (I'm 100% sure) Crystal still require rounding to work.

  • JohanWiltink Avatar

    How is toFixed unreliable?

    ( Yes, honest question. I'd like to know. )

  • JohanWiltink Avatar

    Should really use assertApproxEquals instead of rounding.

    We burn newcomers at the stake for it.