アットウィキロゴ

842んm

<!DOCTYPE html>
<html>
<head>
<title>統計的方法</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="material.min.css">
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
 
 
     <script src="sample.js"></script>
     <script src="jquery.js"></script>
    <script src="ols.js"></script>
 
    </head>
   <body onload="sample()">
 
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
  <header class="mdl-layout__header">
    <div class="mdl-layout__header-row">
      <span class="mdl-layout-title">統計的方法</span>
    </div>
    <div class="mdl-layout__tab-bar mdl-js-ripple-effect">
      <a href="#scroll-tab-1" class="mdl-layout__tab is-active">表</a>
      <a href="#scroll-tab-2" class="mdl-layout__tab">解答</a>
      <a href="#scroll-tab-3" class="mdl-layout__tab">出所</a>
    </div>
  </header>
 
 <div class="mdl-layout__drawer">
 <span class="mdl-layout-title">タイトル</span>
 </div>
 
 
 
  <main class="mdl-layout__content">
    <section class="mdl-layout__tab-panel is-active" id="scroll-tab-1">
        <div class="page-content" id="tab2"></div>
    </section>
    <section class="mdl-layout__tab-panel" id="scroll-tab-2">
      <div class="page-content" id="memo"></div>
    </section>
    <section class="mdl-layout__tab-panel" id="scroll-tab-3">
      <div class="page-content">例題8-4-2</div>
    </section>
 
  </main>
 
 
<footer class="mdl-mini-footer">
  <div class="mdl-mini-footer__left-section">
    <div class="mdl-logo">リンク</div>
    <ul class="mdl-mini-footer__link-list">
      <li><a href="http://www61.atwiki.jp/javadsge/pages/4095.html">コード</a></li>
      <li><a href="">データ</a></li>
    </ul>
  </div>
</footer>
 
 
 
</div>
 
 
</body>
</html>
 
var a = new Array();
var b = new Array();
 
function sample(){
 
n = 3;
r = 2;
p = 0.95;
q = 0.05;
 
a[1] = n;
for (s = 2; s < r + 1;s++ ){
a[s]=a[s-1]*(n-s+1);    
}
 
    b[1] = 1;
    for (s = 2; s < r + 1;s++ ){
    b[s]=b[s-1]*s;    
    }
 
    p1 = 1;
    for (s = 1; s < r + 1;s++ ){
    p1=p1*p;    
    }
 
    for (s = 1; s < n-r + 1;s++ ){
    p1=p1*q;    
    }
 
 
    p1 = a[r] * p1 / b[r];
 
 
 
        $("#memo").html(p1);
 
 
 
}
 
最終更新:2016年03月08日 21:13