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的更多相关文章

  1. UVA - 10886 Standard Deviation (标准差)(数论)

    题意:下面是一个随机数发生器.输入seed的初始值,你的任务是求出它得到的前n个随机数标准差,保留小数点后5位(1<=n<=10000000,0<=seed<264). 分析: ...

  2. 标准差(standard deviation)和标准误差(standard error)你能解释清楚吗?

    by:ysuncn(欢迎转载,请注明原创信息) 什么是标准差(standard deviation)呢?依据国际标准化组织(ISO)的定义:标准差σ是方差σ2的正平方根:而方差是随机变量期望的二次偏差 ...

  3. 标准差(standard deviation)和标准错误(standard error)你能解释一下?

    by:ysuncn(欢迎转载,转载请注明原始消息) 什么是标准差(standard deviation)呢?依据国际标准化组织(ISO)的定义:标准差σ是方差σ2的正平方根.而方差是随机变量期望的二次 ...

  4. How to Find the Standard Deviation in Minitab

    Standard deviation, represented by the Greek Letter sigma σ, is a measure of dispersement in statist ...

  5. 方差(variance)、标准差(Standard Deviation)、均方差、均方根值(RMS)、均方误差(MSE)、均方根误差(RMSE)

    方差(variance).标准差(Standard Deviation).均方差.均方根值(RMS).均方误差(MSE).均方根误差(RMSE) 2017年10月08日 11:18:54 cqfdcw ...

  6. 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 ...

  7. 均方根值(RMS)+ 均方根误差(RMSE)+标准差(Standard Deviation)

    均方根值(RMS)+ 均方根误差(RMSE)+标准差(Standard Deviation)  1.均方根值(RMS)也称作为效值,它的计算方法是先平方.再平均.然后开方. 2.均方根误差,它是观测值 ...

  8. 均方根误差(RMSE),平均绝对误差 (MAE),标准差 (Standard Deviation)

    来源:https://blog.csdn.net/capecape/article/details/78623897 RMSE Root Mean Square Error, 均方根误差是观测值与真值 ...

  9. 标准差(Standard Deviation) 和 标准误差(Standard Error)

    本文摘自 Streiner DL.Maintaining standards: differences between the standard deviation and standarderror ...

随机推荐

  1. 软件工程第四周作业-PSP

    psp表格 类别 内容 开始时间 结束时间 中断时间 delta时间 学习 学习C# 10.6下午7:00 10.6下午8:00 - 60min 写代码 写主函数以及一些小的方法 10.7下午2:00 ...

  2. (七)类、超类和子类 ——(多态,动态绑定,final类,类型转换,抽象类)

    java中所有的继承都是公有继承. 在子类中的构造其内可以初始化超类的公有域,但不能初始化超类的私有域. 因此需要在子类构造前的第一行使用super()语句初始化超类的私有域. 如果超类没有不带参数的 ...

  3. iOS中UIButton控件的用法及部分参数解释

    在UI控件中UIButton是极其常用的一类控件,它的类对象创建与大多数UI控件使用实例方法init创建不同,通常使用类方法创建: + (id)buttonWithType:(UIButtonType ...

  4. 敏捷冲刺DAY3

    一. 每日会议 1. 照片 2. 昨日完成工作 3. 今日完成工作 登录界面的进一步完善 服务器搭建 建立数据库 下一步任务的规划,展望 4. 工作中遇到的困难 工作中的困难:在进行模糊查询时,由于中 ...

  5. Qt代码覆盖率code coverage(VS版)

    版权声明:若无来源注明,Techie亮博客文章均为原创. 转载请以链接形式标明本文标题和地址: 本文标题:Qt代码覆盖率code coverage(VS版)     本文地址:http://techi ...

  6. 【beta】Scrum站立会议第1次....11.3

    beta阶段,我们nice!团队将进行为期两周的冲刺,Scrum站立会议10次. 小组名称:nice! 组长:李权 成员:于淼  刘芳芳韩媛媛 宫丽君 项目内容:约跑app(约吧) 时间:2016.1 ...

  7. fcntl函数详解

    功能描述:根据文件描述词来操作文件的特性. 文件控制函数          fcntl -- file control头文件: #include <unistd.h> #include & ...

  8. 【Docker 命令】- pull命令

    docker pull : 从镜像仓库中拉取或者更新指定镜像 语法 docker pull [OPTIONS] NAME[:TAG|@DIGEST] OPTIONS说明: -a :拉取所有 tagge ...

  9. 编译android6.0错误recipe for target 'out/host/linux-x86/obj/lib/libart.so' failed

    转自:http://blog.csdn.net/ztguang/article/details/52856076 trip: libpagemap_32 (out/target/product/xx/ ...

  10. ubuntu 16.04 安装jdk9错误

    转自:https://askubuntu.com/questions/769467/can-not-install-openjdk-9-jdk-because-it-tries-to-overwrit ...