There is an unlimited set of numbers from 1.0 to 3.0 with rounding to one decimal place. You need to construct an array of X numbers where the total average is 2.35 with an error of 0.5. The order of the numbers in the array is not important.
There is an unlimited set of numbers from 1.0 to 3.0 with rounding to one decimal place. You need to construct an array of X numbers where the total average is 2.35 with an error of 0.5. The order of the numbers in the array is not important. 6 comments
@ruffni in real life a has a 4000+ various numbers, each in range from 1.0 to 3.0: 1.8, 2.6, 3.0, 3.0, 2.8, 1.0, 2.4, 1.2, 2.8, 1.0... and etc. @toby3d so, since there are only 21 distinct numbers from 1.0 to 3.0 i'm guessing you don't mean *set*, since in maths this implies distinct elements. if you want a list of say x=3 elements to average 2.35. this means you want r[0]+r[1]+r[2]=2.35*3 ±(3*0.5). r[] being the elements of the resulting list. @ruffni "memorize the result": you mean what I need add random numbers in array and substruct until I got result between 1.0 and 3.0? |
This is a real challenge for the game that I program. But I was always bad at math in school.