crossoverJie / crossoverJie/JCSprout

红包算法测试问题

Open
#146 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
26.8k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

根据您的红包实现算法,自己测试了一下数据,产生200W个红包 每个红包的总金额都是200 分给10个人,按理说在每个人获得的金额在概率分布中应该是20元左右,但是测试出来的结果 有同一个共性,就是 倒数 后面几个人获取的平均值 总是距离平均值很远。从概率的角度想 不应该出现这个问题吧
bug

Contributor guide

No contributing guide indexed for this repository

Research direction

No file or test is named in the issue. Start by locating the red-packet algorithm in the Java sources and reproduce the reported experiment with 2,000,000 packets, 10 recipients, and a total of 200 yuan each. Done means explaining and correcting why later recipients' averages diverge from roughly 20 yuan, then verifying the resulting distribution.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.