On Dec 21, 6:16 am, John <iamach...@gmail.com> wrote: > Given a function that returns a random number between 1-5, write one > that returns a random number between 1-7 for the case when it should > be integer and for the case it can be real.
Impossible to do without more information. Anyone who claims otherwise does not understand the question.
Why is it impossible? Because you have failed to specify a *distribution* for either your original function or your new function. If you mean *uniformly* at random, you have failed to state it. What if "at random" meant "drawn at random from a truncated normal pdf"???