aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms-public.gathering.org/ping2.html
blob: b30e0eca94b8c077f32845cacd6d45a008947379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<html>
  <head>
    <title>Ping? Pong!</title>
  </head>
  <body>
    <link rel="stylesheet" href="/ping.css">
    <p id="playground">
      <svg id="lines" width="1280" height="736" style="position: absolute; top: 0; left: 0; z-index: 1">
      </svg>
      <img src="tg14-salkart.png" alt="" id="map" />
    </p>
    <script>
      // These are used by ping.js, below.
      var switches_url = "/switches.json";
      var ping_url = "/nettkart.json";
      var draw_linknets = false;
    </script>
    <script type="text/javascript" src="ping.js"></script>
  </body>
</html>
path: root/spec/lib/confidence_intervals_spec.rb
blob: 58f1f3d79234f16008a60c561485488acd7f157b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- encoding : utf-8 -*-
require 'confidence_intervals'

describe "ci_bounds" do

  describe "when passed all successes" do
    it "should never return a high CI above 1" do
      ci = ci_bounds 16, 16, 0.01
      ci[1].should be <= 1
    end
  end

  describe "when passed all failures" do
    it "should never return a low CI below 0" do
      ci = ci_bounds 0, 10, 0.05
      ci[0].should be >= 0
    end
  end

  describe "when passed 4 out of 10 successes (with 0.05 power)" do
    it "should return the correct Wilson's interval" do
      # The expected results here were taken from an online
      # calculator:
      #   http://www.vassarstats.net/prop1.html
      ci = ci_bounds 7, 10, 0.05
      ci[0].should be_within(0.001).of(0.3968)
      ci[1].should be_within(0.001).of(0.8922)
    end
  end

end