27
2
If you're going to invent some fake news, you'll want to fabricate some data to back it up. You must already have some preconceived conclusions and you want some statistics to strengthen the argument of your faulty logic. This challenge should help you!
Given three input numbers:
- N - number of data points
- μ - mean of data points
σ - standard deviation of data points, where μ and σ are given by:
Output an unordered list of numbers, i, which would generate the given N, μ, and σ.
I'm not going to be too picky about I/O formats, but I do expect some sort of decimals for μ, σ, and the output data points. As a minimum, at least 3 significant figures and magnitude of at least 1,000,000 should be supported. IEEE floats are just fine.
- N will always be an integer, where 1 ≤ N ≤ 1,000
- μ can be any real number
- σ will always be ≥ 0
- data points can be any real number
- if N is 1, then σ will always be 0.
Note that most inputs will have many possible outputs. You only need to give one valid output. The output may be deterministic or non-deterministic.
Examples
Input (N, μ, σ) -> Possible Output [list]
2, 0.5, 1.5 -> [1, 2]
5, 3, 1.414 -> [1, 2, 3, 4, 5]
3, 5, 2.160 -> [2, 6, 7]
3, 5, 2.160 -> [8, 4, 3]
1, 0, 0 -> [0]
6Should've added a truthy/falsy input for p-value so we would have to make either correlated or non-correlated data to either fake-backup or fake-disprove ahaha. – Magic Octopus Urn – 2017-04-24T16:56:25.420
1What does
+ve
and-ve
mean? – CG. – 2017-04-24T17:13:01.883@ChelseaG. Abbreviations for positive and negative. I've edited to clarify.
– Digital Trauma – 2017-04-24T17:54:45.783When N=1, will σ always be 0 to make it possible? – xnor – 2017-04-24T20:19:01.710
@xnor Yes, thats right – Digital Trauma – 2017-04-24T20:30:17.033
Can the output be deterministic? That is, same input always produces the same output – Luis Mendo – 2017-04-24T22:24:24.477
@LuisMendo Yes, that's fine. – Digital Trauma – 2017-04-24T23:14:01.897
1Really we pedants should be using the corrected sample standard deviation and not implementing for inputs with N=1. – Jonathan Allan – 2017-04-25T05:00:37.787
@JonathanAllan we never said we were good at fake statistics – Giuseppe – 2017-04-25T15:05:53.017