Oz
Offline
God Member
Karma: 2
Posts: 560
|
 |
« on: September 27, 2012, 09:03:09 pm » |
Ok, this is more to do with PROGRAMMING, but here is a good place to ask, becaues it is to do with "definitions" - I think. Ok: How far can a dog run into a forest? Read more: http://wiki.answers.com/Q/How_far_can_a_dog_run_into_a_forest#ixzz27j2hkI7JNow I don't know of the exact subtle differences between: How far into a forest can a dog run? But... The answer is "half way" because then he is running OUT of the forest. Now I sort of understand that, but my question is: If the dog is running "into" the forest, he doesn't know when he is halfway there, so continues to run anyway. Now, it is said that after "halfway" he is running out, so the answer is "half way". But wouldn't it be "all the way" because as soon as he starts to run "out of the forest" - when he gets halfway there, he is no longer runnning INTO the forest anyway? You guys being knowledgeable programmers may be able to explain this to me in a way I can understand and help me clear up the confusion with the definitions.
|
|
|
|
|
Logged
|
|
|
|
|
Massachusetts, USA
Offline
Tesla Member
Karma: 96
Posts: 6347
|
 |
« Reply #1 on: September 27, 2012, 09:42:54 pm » |
The answer is relative to your frame of reference.
Relative to the dog, the dog has run "all the way" into the forrest when the tip of the dog's tail crosses the forrest boundary.
Relative to the forrest, the dog runs into the forrest "half way". After passing the middle point on the path from forrest boundary to forest boundary the dog is no longer running "in to" but "out of" the forrest.
|
|
|
|
|
Logged
|
|
|
|
|
Oz
Offline
God Member
Karma: 2
Posts: 560
|
 |
« Reply #2 on: September 27, 2012, 10:03:50 pm » |
John,
If I wasn't a bloke as well, I'd give you a big hug for helping me understand that.
It has been haunting me for a long time and I haven't really got a good answer until now.
Thanks much.
|
|
|
|
|
Logged
|
|
|
|
|
Oz
Offline
God Member
Karma: 2
Posts: 560
|
 |
« Reply #3 on: September 27, 2012, 10:18:28 pm » |
The answer is relative to your frame of reference.
Relative to the forrest, the dog runs into the forrest "half way". After passing the middle point on the path from forrest boundary to forest boundary the dog is no longer running "in to" but "out of" the forrest.
Ok, just one more question though on that last bit. So the question asks: How far can a dog run into a forest? So it is specified INTO. So although looking at it from the forest's point of view, the dog would still run "all the way" INTO the forest then start to run "all the way" OUT OF it. So wouldn't the answer still be "all the way"? (With the question worded like that) Just asking.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6809
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #4 on: September 27, 2012, 10:58:48 pm » |
A bit Zen for me 
|
|
|
|
|
Logged
|
|
|
|
|
Oz
Offline
God Member
Karma: 2
Posts: 560
|
 |
« Reply #5 on: September 27, 2012, 11:30:25 pm » |
Yeah, but as people here (I hope) have a better understanding of programming and what is defined and what isn't, they may be able to help me with all the terms, declorations and what not.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6809
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #6 on: September 27, 2012, 11:47:22 pm » |
I have a pretty good understanding of programming but I don't really see a programming question here, like I said it seems more like a Zen-style definition of the word "into". These ambiguities do bite you in the arse in a specification and that's when you have to nail down what the customer means by "into".
And then there's the definition of a dog? Is it the head, nose, tail?
But after that has been properly defined the programming should be the (often simple) implementation of an algorithm.
What if the forest is not circular and the dog changes direction? In an instant it has moved from 50% through to 90% through. Did it travel faster than light or even instantly?
Much as these musings are interesting I cannot yet see a concrete question about "programming and what is defined and what isn't" and "the terms, declarations and what not".
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Oz
Offline
God Member
Karma: 2
Posts: 560
|
 |
« Reply #7 on: September 28, 2012, 01:46:08 am » |
Yeah, granted Rob.
But as a "noob" I don't know the lingo.
I am saying "declarations" "definitions" etc..... because they are the words I feel best fit my problem.
So excuse me if I am not using the right words and their definitions, only because I don't know better.
So if you don't mind, teach me the meanings of these words as well so I can be smarter - though I won't promise it will work.
|
|
|
|
|
Logged
|
|
|
|
|
Pittsburgh, PA, USA
Offline
Faraday Member
Karma: 29
Posts: 2886
I only know some basic electricity....
|
 |
« Reply #8 on: September 28, 2012, 03:49:42 am » |
One question is about how far the dog runs.
The other question amounts to how far is it to the middle of the forest.
I see where this applies to approach to code, like where you want the code to get versus what the code must do to get there. When time/money is involved, replace code with development and just listen to what people who (think they) know the ends but nothing about the means. It gets real relevant then!
|
|
|
|
|
Logged
|
Examples can be found at Learning in the Main Site and at the Playground
|
|
|
|
Oz
Offline
God Member
Karma: 2
Posts: 560
|
 |
« Reply #9 on: September 28, 2012, 03:53:24 am » |
Tee Hee...  Yeah, I like that analogy.
|
|
|
|
|
Logged
|
|
|
|
|
New Hampshire
Offline
God Member
Karma: 13
Posts: 776
There are 10 kinds of people, those who know binary, and those who don't.
|
 |
« Reply #10 on: September 28, 2012, 09:16:13 am » |
As Graynomad mentioned, this is the biggest hurdle in converting requirements into code. Requirements can be of varying levels of ambiguity. There is zero ambiguity in code.
In this case, the phrase 'into the forest' needs to be more specifically defined. Without that definition, any answer is just an interpretation that may or may not be correct. It could be half way, it could be all the way. It could be something else entirely if 'into the forest' has some non-intuitive meaning. For example, it could just as easily mean a single step if 'into the forest' is simply a binary state.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6809
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #11 on: September 28, 2012, 09:41:18 am » |
Re declaration and definition, I think you'll have to hit the books but I found this on the web. In The Definition of a variable space is reserved and some initial value is given to it, whereas a declaration only identifies the type of the variable for the function. Thus definition is the place where the variable is created or assigned storage whereas declaration refers to places where the nature of the variable is stated but no storage is allocated. I admit I get them confused as well but the following is right I think void myFunc(void); // declaration of myFunc() so the compiler knows what to expect if the function is referenced before it is defined // // lots of other code // void myFunc(void) { // definition if myFunc, this is the bit that actually has the code // some code } You need the declaration if you have a forward reference to a function for example loop () { myFunc(); }
void myFunc(void) { // some code } Will cause an error because the compiler sees the reference to myFunc() before it knows what the heck it is. One way to fix this is to declare the function first. void myFunc(void); // this is also called a "prototype"
loop () { myFunc(); }
void myFunc(void) { // some code } The declaration (AKA prototype) tells the compiler what myFunc() is so when it sees the reference in the loop() function it's happy in the knowledge that myFunc() exists, the call is correct WRT parameters and return type, and that at some point myFunc() will be defined. You can also fix this by simply placing myFunc() before any code that references it but often this is not practical. The Arduino IDE pulls a trick to help beginners with this. It scans the program for forward references and (I think) inserts declarations for you. ______ Rob
|
|
|
|
« Last Edit: September 28, 2012, 09:44:58 am by Graynomad »
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19006
I don't think you connected the grounds, Dave.
|
 |
« Reply #12 on: September 28, 2012, 01:15:19 pm » |
And if a tree falls and there's only the dog in there, does it make a sound?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Oz
Offline
God Member
Karma: 2
Posts: 560
|
 |
« Reply #13 on: September 28, 2012, 04:54:19 pm » |
Ah, the fun of programming.
Ok, again and more off topic, here is an e-mail which I just received which is sort of quaint and long these lines:
There was a bit of confusion at the Sporting goods store this morning. When I was ready to pay for my purchases of gun powder and bullets the cashier said, "Strip down, facing me." Making a mental note to complain to Harper about the gun registry people running amok, I did just as she had instructed. When the hysterical shrieking and alarms finally subsided, I found out that she was referring to my credit card. I have been asked to shop elsewhere in the future. They need to make their instructions to us seniors a little clearer!
Ya gotta laugh.
Coz if you didn't you would cry.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6809
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #14 on: September 28, 2012, 07:37:30 pm » |
Probably most of English comedy is based on assumptions and ambiguities. As a programmer I tend to take what someone says literally, as a normal person I usually interpret but I have a habit of doing literally what my missus says just for fun.
For example she may hand me some rubbish and say "Take this out to the bin and throw it out". 3 minutes later I return with the rubbish having thrown the bin out.
She laughs and laughs...sometimes.
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
|