Rashakil Fol 978 Super Senior Demiposter Team Colleague

80 m/s.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Yes, get animated smileys. That's important. Then I can look at them and forget how empty my soul is.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I don't think that's what the question's asking, Lerner. It doesn't say that.

shmay, if you need to generate a number in the range [0, 37) with five random decimal digits after the decimal point, start by generating an integer in the range [0, 3700000], and then divide it by 100000.0. You might need to be able to handle up to 14 or 15 decimal digits, so you might need to generate multiple random numbers and piece things together, depending on the range of your random number generator.

For example, to generate a number in [0, 444) with 10 random decimal places, I'd first generate a number in [0, 4440000000), and divide that by 10000000.0. That gives the first six decimal places. Then I'd generate a number in [0, 10000) and divide that by 1e-10, for decimal places 7 through 10, and add that to the first number.

A simpler algorithm is to generate the decimal expansion one digit at a time. For example, if you want a double in the range [0, n), generate an integer in the range [0, n), and then generate ten decimal digits, multiplying the nth decimal digit by 0.1 to the nth power, adding these up, and then adding these to the integer you generated.

And if you want precision measured in binary digits, replace the powers of 10 with powers of 2 in the above algorithms.

~s.o.s~ commented: as expected from a Haskeller. ;-) ~s.o.s~ +17
Rashakil Fol 978 Super Senior Demiposter Team Colleague

If you're using a language like C or C++ you're doomed to have bugs.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Okay, so, from now on let's assume that g = 10 unless stated otherwise.

Here's a problem:

A faucet is turned on; its spout faces straight downwards. It has radius 0.5 cm, and a 0.5 cm radius stream of water flows out of it at a velocity of 2 m/s. What's the radius of the stream 50 cm below the faucet?

Equating PE + KE per kilogram at the faucet and half a meter below, we have

g * (0.5 m) + 1/2 * (2 m/s)^2 = 1/2 * v^2,

where v is the speed of the water at that point below. Then

v = sqrt( 2 * g * (0.5 m) + (2 m/s)^2)

Then we have the fact that the volume throughput at both the points are (approximately) the same. Then, with r being our radius we're looking for,

pi * (0.005 m)^2 * (2 m/s) = pi * r^2 * v.

This means

r = sqrt((0.005 m)^2 * (2 m/s) / sqrt(2 * g * (0.5 m) + (2 m/s)^2))

With g = 10 N, this gives 0.0037 m. I.e. 0.37 cm.

This answer is not the true answer, even in the 'ideal' case, but it's close enough. In the 'ideal' case, where nothing slows the water down and it's perfectly streamlined, you could still account for the fact that the velocity of the water is not pointing straight downwards.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That does the trick, except that computing A[j]/n takes log(n) time. But it is nice.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Okay, so, from now on let's assume that g = 10 unless stated otherwise.

Here's a problem:

A faucet is turned on; its spout faces straight downwards. It has radius 0.5 cm, and a 0.5 cm radius stream of water flows out of it at a velocity of 2 m/s. What's the radius of the stream 50 cm below the faucet?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

These are disgusting! That's it, I'm moving to Canada.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Okay, my answer 24.9 N is still correct; you assumed that g = 10 m/s^2; I assumed 9.80665 m/s^2.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Okay, now I'd really like to see the answer.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Oh, I see the problem. How about 10/7 * 1.5 kg * g + 0.4 kg * g, i.e. 24.9 N.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If so, then how about 12/7*1.5 kg * g, i.e. 25.2 N.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Wait, you want all the blocks to be moving differently so that _no_ two can be the same?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Near? Then my answer's wrong.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If relative to each other, then 2.4 kg * g, or about 23.5 newtons on Earth.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Relative motion? Relative to what? If relative to the surface, then there is no minimum (0 is the lower bound).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It's a type. A datatype. Like int or long or size_t or unsigned char.

You know how in C, size_t is an unsigned integer large enough to represent any array size possible? The C++ std::string class provides string::size_type as an integer datatype large enough to represent any possible string size.

The 'find' member function returns the location of the first occurrence of a substring or character in a string. This return value is an integer (whose type is string::size_type). If the substring or character is not found, it needs some value to return that signals this fact. A library designer could have said, "okay, let's return -1 when the substring's not found." But instead, they return some integer value hardcoded as string::npos. It's probably -1. Code that uses string::npos is more readable than code that uses -1. (Since you can't assume that string::npos == -1, you have to use string::npos anyway.)

aderchox commented: really nice explanation thank you +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

do you get many "ethinic minorities" in your countries? - valid opinions only please... . I personally think its good to have a bit of a mix of people

What (TF) is a "valid" opinion?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What?

I am saying, consider consciousness. If you take a bunch of brain matter and put it together, you get a conscious being. At least in humans. Wow! That's just wickedly crazy. You wouldn't expect that, just looking at the physical universe with the five senses.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

So: Consciousness. Have you noticed that the notion of consciousness is really, really, creepy?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

To Rashakil Fol:
You really should stop going crazy on everything Josh says.. I've even noticed this. You do it on the Physics Game thread too. I'm sorry, but it's really starting to get annoying.

I am not going crazy on things he says -- in the physics thread, he's making statements that are flagrantly false. I do not know why. I'm not going to let other people soak in his ignorancies as fact, though.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

All conservation laws are basically the same.

If you don't have knowledge, don't pretend you do by making stuff up.

joshSCH commented: Stop contradicting everything I say +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

What is 'empty'? Is it a function? Are you calling it? I don't remember empty being in the Scheme language standard library. Looking online, it seems like empty is a name for the empty list, the same as '(). So the error would be that you're trying to do a function-call where the 'function' to be called is an empty list value.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

More particularly, look at what I was quoting.

I'm a nihilist.. so I believe nothing exists after death. You didn't exist before you were born, and you cease to exist after death..

Being a nihilist does not imply that you believe you cease to exist after death. Nor does it imply that you believe you didn't exist before you were born. But you seem to think so. I posit that you don't know what "nihilism" means.

damn 30 second man, your starting to **** me off.. you have to reply to everything I say.. and it's always some dumbass remark again.

I don't see why you would get angry about the ravings of a retarded dumbass, unless you think they might be true. Also, by the way,I will always take the time to reply to posts that are egotistically wrong. Especially when written by a person who is apparently fractally wrong.

Yes, I do know what nihilism is.. it is the belief in NOTHING.

Stop equivocating.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I'm a nihilist.. so I believe nothing exists after death. You didn't exist before you were born, and you cease to exist after death..:sad:

You're contradicting yourself. You don't know what nihilism is.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

yea I know, but it's not that great of a metaphor. The 30-second theory he was relating to was too ridiculous to even use.. The whole way he wrote the argument was terrible, and only made atheists seem idiotic and crazy.

If you're following the premise that I wasn't being serious, you should read my posts as an attack on ignorant atheism, not on religion.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The 30 second universe is no more or less ridiculous than the notion of a universe with gravity. Or time, even.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Um.. actually it does. I was referring to the law of conservation of energy.. Kinetic energy is not conserved in inelastic collisions, therefore you know that the maximum kinetic energy is lost. However, The law of conservation of energy is true for the system. The energy is transferred from kinetic energy to different kinds of energy (sound, heat, etc.)

No, you do not know the maximum kinetic energy was lost from the fact that kinetic energy is not conserved in inelastic collisions; you know that the maximum possible amount of kinetic energy was lost because the problem statement tells you that the vehicles end up at rest.

You did not use the principle of conservation of energy anywhere in your solution to the problem; you used the law that momentum is conserved.

christina>you commented: .. +0
Rashakil Fol 978 Super Senior Demiposter Team Colleague

But they're NOT. Gosh.

What are you talking about? The proportions have to add up to 1. If the atheist proportion is increasing, the non-atheist proportion has to decrease. Or do you have some argument based on your proposition that pi equals 3?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That's pretty much how it's done. Though instead of checking whether the character is like #\space or #\! as you described, you should check whether the character is not alphabetic. I think that function is called 'CHAR-ALPHABETIC?'.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

No, you're right Infarction.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I like the posting games forum. It's nice not having several dozen posting games threads polluting the Geek's Lounge. It was a good idea making posts in that forum not contribute to the user's total post count, too.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Your explanation does not use the principle of conservation of energy.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The purpose of this posting game is the following: Come up with an explanation of why posting games suck. The person with the most replies to this posting game thread is the loser. I'll go first.

Because they're posting games.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Infarction: we know the momenta of the cars sum to zero because the combined mass has no velocity. So 32 * 1100 = v * 2500. Then 35200 / 2500 = v, i.e. 352 / 25, which is 14 + 2/25 i.e. 14.08.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What I seem to have said doesn't have anything directly to do with Einstein's relativity. The similarity is in the following: His theory is based on the premise that the laws of physics are the same (in particular, the speed oflight) no matter what your velocity or position is. My theological relativity is just the irrefutable fact that the theological laws of the Universe are true no matter where you are or what datetime it is. The Universe is and always will be 30 seconds old.

And joshSCH, I'm glad to see that you've finally figured out "It wouldn't matter b/c we wouldn't know." Using the non-dumbass, nuanced mind you have, feel free to proceed to adopt the same stance towards discussion and argument about other religions and religious topics.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Rashakil Fol, I hope you read what I had to say about your post.. and please take my advise..

Are you seriously pleading for somebody to kill himself? What kind of human are you?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You're replying to comments that we never made? Oh, ok.. that's nice to know..

You're replying to a comment from more than 30 seconds ago; what does that say about you?

WHY?? Why does he keep writting?? You just write random bs down.. We are ALL dumber for reading this post.. It makes no sense, you are a moron! Perhaps you never should have posted on this thread.. And please.. don't write anything on this thread again. We don't want to read it. I strongly advise you to either check into a mental hospital, or just go kill yourself so we don't have to read another post from you again!

I strongly recommend that you do not tell people they should kill themselves. Or else someday, somebody might take your advice. And grow up.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Or maybe it's because you didn't make any logical sense in your post...

That wasn't my post...

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That depends: did the passengers come to a halt too, or did one or more of them fly out the windshield?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

And I don't see why you would feel a need to "tear" a post "apart" unless you have some kind of desire to lash out at people for believing differently than you. Do you hate me (or whatever divine being constructed that post) for holding your opinions in contempt? Are you frustrated by the behavior of humanity? Isn't it a shame that everybody isn't the same as you.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What are you talking about? I never wrote that.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

How dare you blaspheme! Or did you do that before the beginning of time? Anyway,,,

The world was created 6013 years ago? Horsehockey!

The world was created 6000000000ish years ago? Mere orders of magnitude do not give correctness!

You fools. If only you knew the world was created 30 seconds ago. And I have knowledge that this is true. Sure, you can't prove that the Universe existed more than 30 seconds ago. But I don't need proof. Instead, I have not-proof. Not-proof is good enough for me. I don't need those leftist intellectualists to tell me what to think. I believe in the new time religion; it's good enough for me. Than those so-called "intellectuals," I think I am smarter besides. So if anything, that makes them stupiddectuals.

You don't think the Universe is only 30 seconds old? Can you prove it? You can't. Idiot. What were you thinking, even considering an older Universe? The universe just acts like it's older than 30 seconds. Sure, you've got memories of artifacts like the Bible and the x86 architecture and other things that don't belong in the 21st century, but that's just planted there to make it look like the Universe is older than 30 seconds. That's because God B likes messing with people's heads. Those who fall for his tricks get sent to Heck. I know this because I have not-proof in the truth.

Just think about it this way. What's the safe thing to believe? …

christina>you commented: very bad post, didn't even make sense. try to use logical explanations next time. +0
joshSCH commented: This doesn't make any sense! +0
WolfPack commented: Hope this balances out the neg rep you got for this post. hehe +6
Rashakil Fol 978 Super Senior Demiposter Team Colleague

You really could stand to be more specific. First of all, it's not like anybody's going to just give you the answer. Also, you need to improve your ability to think clearly. You say "ignoring punctuation" as if it's clear what you mean. You can't write clear programs if you don't specify things precisely. In this case, does "ignoring punctuation" mean you want things like "efgh-ijkl" to be treated like one word? Should "foo bar." be split up into ("foo" "bar"), or do you want ("foo" "bar.")?

Suppose you had to do this manually. Pretend you're in an empty room with a desk and some paper. Every 60 seconds, somebody comes in and gives you a slip of paper with a character written on it. It's the next character on the string. How would you split this string up into words? What information do you use to proceed every time you see a new character?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That's not ownership; that's licensing.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Why don't you read some other school's course catalog?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You got your history wrong here...
A Megabyte is 1024 bytes. It wasn't until marketing departments started corrupting the term to mean 1000 bytes that some people came up with the silly idea of inventing the term "mebibyte" for 1024 bytes.

Liar!

A megabyte is 1048576 bytes. A gigabyte is 1024 megabytes.

Have-a-nice-day ;-)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Is it fair to keep asking people to do your homework for you?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Why don't you read your school's course catalog?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Because it's wrong. You can make assumptions of O(1) comparison for comparison-sort based algorithms, mainly because the comparison operation is in fact O(1) average over the course of the sorting algorithm with respect to the amount of data you have. But here, you're performing an algorithm with your data which takes non-constant time, and you're proposing ignoring it. More particularly, the square root algorithm _uses_ looping constructs (how would you propose implementing it?); are you just going to ignore those looping constructs?

If ignoring the running time of functions written by other people is your modus operandi, why not implement selection sort where the selection part of the algorithm is abstracted away by a function that you just pretend to be constant-time. Then you've proven that selection sort can be done in linear time.

Heck, if you're going to pretend the log(n) of the square root algorithm doesn't matter, why not just use merge sort and declare its log(n) factor doesn't matter either?