ivanciric/gtp-estimator

德国坦克问题估算器

0.0.2 2016-10-12 15:10 UTC

This package is auto-updated.

Last update: 2024-09-17 10:54:37 UTC


README

PHP中的德国坦克问题估算器

安装

在 composer.json 文件中,在 require 数组中添加以下内容

"ivanciric/gtp-estimator": "0.0.*"

用法

查看 example.php 文件。

假设 k = 4 辆坦克,编号为 19、40、42 和 60 被捕获。观察到的最大编号 m = 60。未知坦克总数称为 N。

以下频繁主义方法建议的估计坦克总数的公式为

N ≈ m + m/k − 1 = 74 

使用 GtpEstimator

$estimate = Ivanciric\GtpEstimator\GtpEstimator::estimate(4, 60);

维基百科: https://en.wikipedia.org/wiki/German_tank_problem