ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
楼主: northwolves

[推荐] 提供800个题目大家做做

[复制链接]

TA的精华主题

TA的得分主题

发表于 2010-1-2 14:54 | 显示全部楼层
练下手,放假半个月了,都没用EXCEL了~~~马上就要上班了~~

TA的精华主题

TA的得分主题

发表于 2010-1-2 22:00 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2010-1-3 09:01 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2010-1-3 11:37 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2010-1-3 19:33 | 显示全部楼层
vba可以从零开始讲吗?麻烦版主弄些资料,要最简单的.

TA的精华主题

TA的得分主题

发表于 2011-3-27 10:52 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2011-9-8 08:24 | 显示全部楼层
全英文,看得有点吃力与头晕。更不要说解决了。

TA的精华主题

TA的得分主题

发表于 2011-10-31 23:50 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2017-4-13 14:23 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
Problem 1209 - Average win for the player

You are presented with 3 closed boxes.  You are going to pick one of the boxes and keep the money that's inside.  Each of the 3 boxes contains either $3, $7 or $15, but you don't know which box contains what.  Also in one of the boxes there is a slip of paper, in addition to the money, which has 'Go again' written on it.  If you happen to pick that box, you get to repeat the procedure once again with the money and the piece of paper randomly distributed in the boxes.  The game ends only if you happen to pick one of the 2 boxes without the piece of paper, so in theory the game could continue forever.  Now then, what is the average win for the player?  Don't give the answer in fractions, but as a numerical answer.
Solution Format/Example: 37.24

问题1209 -平均能赢多少(期望值)
给你3个封闭的盒子,盒子里放着3,7或15美元。但你不知道哪个盒子有多少钱。
你可以任意打开一个盒子,拿到里面的钱。
另外,3个盒子中有一个盒子随机放着一张纸条,写着“再来一次”。那你就可以再玩一次这个游戏。
直到你选择了另外2个没有放纸条的盒子,游戏就结束了。
理论上如果你运气好,一直猜到有纸条的盒子可以“再来一次”,那就可以一直拿到钱。

现在问,如果有无穷多的人来玩这个游戏,那么每一个玩家平均可以赢得多少钱?

答案格式 37.24

…………
这是一个蒙特卡洛随机模拟测试编程题目,很简单。

我的代码如下:
  1. Sub test()
  2.     a = Array(3, 7, 15) '设置3个盒子放入钱
  3.     For i = 0 To 10 ^ 6 - 1 '模拟1百万次
  4.         n = 0 '连续次数归零
  5.         Do
  6.             n = n + 1
  7.             t = Int(Rnd * 3) '选中1个盒子
  8.             s = s + a(t) '累计获取金额
  9.             r = Int(Rnd * 3) '随机放置再玩一次的纸条
  10.         Loop While t = r '如果选中有纸条的盒子就再来一次
  11.         If n > m Then m = n '统计最大连续次数
  12.     Next
  13.     MsgBox Round(s / i, 4) & vbCr & m '输出平均金额 以及最大连续次数
  14. End Sub
复制代码



结果=12.5、1百万次模拟时最大连续次数13-14次。

TA的精华主题

TA的得分主题

发表于 2017-4-13 15:09 | 显示全部楼层
Problem 1208 - Average distance of a point within a sphere

Problem 1208 - Average distance of a point within a sphere

If a point is randomly selected within a sphere of radius R, what fraction of radius R will be the average distance from the center of the sphere to that point?

Solution Format/Example: 5/23

问题1208:
如果一个点是随机选择的半径R的球体内的点,那么到球中心的平均距离值是多少?
请给出一个分数值。如 5/23

^_^

答案是 3/4 约等于 0.75

  1. Sub test2()
  2.     s = 0.01
  3.     For x = 0 To 1 Step s
  4.         For y = 0 To Sqr(1 - x * x) Step s
  5.             For z = 0 To Sqr(1 - x * x - y * y) Step s
  6.                 k = k + 1
  7.                 r = r + Sqr(x * x + y * y + z * z)
  8.             Next
  9.         Next
  10.     Next
  11.     Debug.Print r / k
  12.     Debug.Print k
  13.     Stop
  14. End Sub
复制代码


用步长0.01计算=0.748 或 精度更高的0.005来计算得到=0.749

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-5-2 02:04 , Processed in 0.044231 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表