<!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-6-1</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/4097.html">コード</a></li>
<li><a href="">データ</a></li>
</ul>
</div>
</footer>
</div>
</body>
</html>
var a = new Array();
var b = new Array();
var point = new Array();
function sample(){
n = 10;
r = 2;
p = 0.5;
q = 0.5;
a[0] = 1;
a[1] = n;
for (s = 2; s < n+1; s++) {
a[s] = a[s - 1] * (n - s + 1);
}
b[0] = 1;
b[1] = 1;
for (s = 2; s < n+1; s++) {
b[s] = b[s - 1] * s;
}
for (tr = 0; tr < 11; tr++) {
p1 = 1;
for (s = 1; s < r + 1; s++) {
p1 = p1 * p;
}
for (s = 1; s < n - r + 1; s++) {
p1 = p1 * q;
}
point[tr] = a[tr] * p1 / b[tr];
}
p1 = point[0] + point[1] + point[2] + point[3] + point[4];
$("#memo").html(p1);
}
最終更新:2016年03月08日 21:28