NAV Navbar
shell ruby python javascript php
  • Welcome
  • ボックスガチャ期待値
  • Errors
  • Welcome

    物置

    ボックスガチャ期待値

    ボックスガチャとは

    くじ引きにおいて、引いたくじを戻さないで引き続けるタイプのガチャ

    期待値について

    
    
    
    
    
    
    function math(){
      var lottery_count = 100; //ボックス内全体数
      var lottery_once_bet_amount = 300; //1回に掛かる金額
      var lottery_hit_count = 2; //当たり数
      var c = 0;
      var k = t(lottery_count,lottery_hit_count);
      for(var x = 1; x <= (lottery_count-(lottery_hit_count-1)); x++){
        c += (1/k)*(x)*(t(lottery_count-x,lottery_hit_count-1));
      }
      var ev = c * lottery_once_bet_amount; //当たるまでいくらかければいいかの期待値
    }
    function t(n,c){
      var l = 1;
      var m = 1;
      for(var x = 0 ; x < c; x++){
        l = l*(n-x);
        m = m*(x+1);
      }
      return l/m;
    }
    

    Errors

    The Kittn API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request sucks.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- The kitten requested is hidden for administrators only.
    404 Not Found -- The specified kitten could not be found.
    405 Method Not Allowed -- You tried to access a kitten with an invalid method.
    406 Not Acceptable -- You requested a format that isn't json.
    410 Gone -- The kitten requested has been removed from our servers.
    418 I'm a teapot.
    429 Too Many Requests -- You're requesting too many kittens! Slow down!
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.