UVA 10886 Standard Deviation
https://vjudge.net/problem/UVA-10886
计算标准差
碰到这种题将式子展开
#include<cmath>
#include<cstdio>
//#include<iostream>
using namespace std;
unsigned long long seed;
long double gen()
{
static const long double Z = ( long double )1.0 / (1LL<<);
seed >>= ;
seed &= ( 1ULL << ) - ;
seed *= seed;
return seed * Z;
}
int main()
{
int T,n;
double xi,xi2,y,x;
scanf("%d",&T);
for(int t=;t<=T;t++)
{
xi=xi2=;
scanf("%d%llu",&n,&seed);
//cin>>n>>seed;
for(int i=;i<=n;i++)
{
y=gen();
xi+=y;
xi2+=y*y;
}
x=xi/n;
printf("Case #%d: %.5lf\n",t,sqrt((xi2-*x*xi+n*x*x)/n));
}
}
UVA 10886 Standard Deviation的更多相关文章
- UVA - 10886 Standard Deviation (标准差)(数论)
题意:下面是一个随机数发生器.输入seed的初始值,你的任务是求出它得到的前n个随机数标准差,保留小数点后5位(1<=n<=10000000,0<=seed<264). 分析: ...
- 标准差(standard deviation)和标准误差(standard error)你能解释清楚吗?
by:ysuncn(欢迎转载,请注明原创信息) 什么是标准差(standard deviation)呢?依据国际标准化组织(ISO)的定义:标准差σ是方差σ2的正平方根:而方差是随机变量期望的二次偏差 ...
- 标准差(standard deviation)和标准错误(standard error)你能解释一下?
by:ysuncn(欢迎转载,转载请注明原始消息) 什么是标准差(standard deviation)呢?依据国际标准化组织(ISO)的定义:标准差σ是方差σ2的正平方根.而方差是随机变量期望的二次 ...
- How to Find the Standard Deviation in Minitab
Standard deviation, represented by the Greek Letter sigma σ, is a measure of dispersement in statist ...
- 方差(variance)、标准差(Standard Deviation)、均方差、均方根值(RMS)、均方误差(MSE)、均方根误差(RMSE)
方差(variance).标准差(Standard Deviation).均方差.均方根值(RMS).均方误差(MSE).均方根误差(RMSE) 2017年10月08日 11:18:54 cqfdcw ...
- Mathematics | Mean, Variance and Standard Deviation
Mean is average of a given set of data. Let us consider below example These eight data points have t ...
- 均方根值(RMS)+ 均方根误差(RMSE)+标准差(Standard Deviation)
均方根值(RMS)+ 均方根误差(RMSE)+标准差(Standard Deviation) 1.均方根值(RMS)也称作为效值,它的计算方法是先平方.再平均.然后开方. 2.均方根误差,它是观测值 ...
- 均方根误差(RMSE),平均绝对误差 (MAE),标准差 (Standard Deviation)
来源:https://blog.csdn.net/capecape/article/details/78623897 RMSE Root Mean Square Error, 均方根误差是观测值与真值 ...
- 标准差(Standard Deviation) 和 标准误差(Standard Error)
本文摘自 Streiner DL.Maintaining standards: differences between the standard deviation and standarderror ...
随机推荐
- Ext JS 6学习文档-第4章-数据包
Ext JS 6学习文档-第4章-数据包 数据包 本章探索 Ext JS 中处理数据可用的工具以及服务器和客户端之间的通信.在本章结束时将写一个调用 RESTful 服务的例子.下面是本章的内容: 模 ...
- HDU 2487 Ugly Windows(暴力)(2008 Asia Regional Beijing)
Description Sheryl works for a software company in the country of Brada. Her job is to develop a Win ...
- 【转】AMD 的 CommonJS wrapping
其实本文的标题应该是「为什么我不推荐使用 AMD 的 Simplified CommonJS wrapping」,但太长了不好看,为了美观我只能砍掉一截. 它是什么? 为了复用已有的 CommonJS ...
- 适合初学者的嵌入式Linux计划
俗话说万事开头难,刚开始的时候,你是否根本就不知如何开始,上网查资料被一堆堆新名词搞的找不到北,去图书馆看书也是找不到方向?又是arm,又是linux,又是uboot头都大了,不知道自己究竟从哪里开始 ...
- Python字符串格式化表达式和格式化方法
Python格式化字符串由两种方式可以选择:一种是格式化表达式(Formatting Expression),一种是格式化方法(Formatting Method).其中格式化表达式在全Python版 ...
- 2. socket结构体——表示socket地址
一.两种通用socket结构体 1. sockaddr struct sockaddr { sa_family_t sa_family; // 地址族 char sa_data[14]; // 存放s ...
- Line belt(三分镶嵌)
In a two-dimensional plane there are two line belts, there are two segments AB and CD, lxhgww's spee ...
- java — 值传递和引用传递
在 Java 应用程序中永远不会传递对象,而只传递对象引用.因此是按引用传递对象.Java 应用程序按引用传递对象这一事实并不意味着 Java 应用程序按引用传递参数.参数可以是对象引用,而 Java ...
- MVC4 DropDownList (二) — 省市联动
1.添加省份和城市类 //省份 public class Province { public int Id { get; set; } public string Name { get; set; } ...
- C# 如何在winform中嵌入Excel,内嵌Excel,word
近使用.net做一个小软件遇到一个问题,就是想实现把excel表格在winform中打开,同时可以操作,不单单是打开.或者就提取数据.在网上找了好多资料,发现这方面的资料比较少,即使有,都是旧版本的使 ...