| Manyfold | analpear: no you will remain banned forever |
| notsdci | how can I find the maximum of such a function: comb(200,x) * (2/100)^x * (98/100)^(200-x)? |
| mdkess | For F = f(|r|)r, how do I find the divergence of F over a sphere of radius b, for r being the radius vector, and |r| is the magnitude of said vector? f is just some arbitrary C1 function. It's the f(|r|) that's giving me troubles. Anyone? |
| edyn | hi anyone could help me to develop a expression that makes any value from 0 to 10 turn into 5? |
| Safrole | f(x) = 5, 0 <= x <= 10 |
| edyn | yeah right....im not so dumb i need some kind of computation |
| Olathe | 5 + 0 |
| Safrole | ...? |
| Olathe | 2 + 3 also works. |
| Safrole | You asked for a map then maps values between 0 and 10 into 5 I gave such a map |
| mdkess | Do you have an example of what you mean edyn? |
| Olathe | Or, if you really need to use the input, f(x) = 0*x + 5 |
| edyn | actually i have to read a number and the function return 5 if t is between 0 and 9 or 4 if between 10 and 20 |
| Olathe | t div 10 * 4 |
| edyn | div? |
| Olathe | Actually, that won't work quite so well, but it can be fixed. |
| edyn | div something like rest? waht do you mean with div? |
| gzl | is this for a computer program? |
| edyn | yep |
| mdkess | what does it return if it's not in that range? |
| edyn | 0 is fine or anything else different from 4 adn 5 =) |
| Zemyla | I've got a question about seeding random number generators. Is there a fairly good way of seeding an RNG? Will time() do the trick, or should it be something more variable? |
| wolfbone_ | Traditionally the system time has been used to seed, but care needs to be taken with this. If an application seeds often and the resolution of the system clock is low, then the same sequence of numbers might be repeated. Also, the system time is quite easy to guess, so if unpredictability is required then it should definitely not be the only source for the seed value. On some systems there's a special device `/dev/random' which provides random data better suited for use as a seed. |
| gzl | edyn: just write "if 0 <= value <= 10: return 5; else: return 0" then... |