fooler wrote:

>----- Original Message -----
>From: "Sacha V. Chua" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, December 03, 2001 10:30 AM
>Subject: Re: [plug] Interesting small Math problem
>
>
>>On Thu, Nov 29, 2001 at 11:57:46AM +0800, fooler wrote:
>>
>>>injecting parenthesis on a given expression is the most complex and
>>>challenging part here. it is depends on what parenthesis insertion rules
>>>
>you
>
>><points out yet again that using postfix notation makes all questions of
>>parenthesizing moot>
>>
>>I have no idea why people still think in infix for this kind of problem!
>>;)
>>
>
>whether you use postfix or infix is still the same. 
>
Yeah right! It's not the same. Do you even know how postfix works? Do 
you understand why
sacha seems to think that postfix is the way to go to solve the problem?

>yes there is a finite
>rule here.. it just knowing the associative , distributative, etc properties
>of a given expression... but hey, this problem can be easily solve if we
>spend time on this but take note , this problem cannot apply in our daily
>lives.. in short its a useless problem!... 
>
How do you know its useless? Shheesh! I thought the fibonacci series was 
useless and yet
I found out that its being used by some of my financial analyst friends.

>this problem is just an ego
>boosting. it is more on the mathematical side than the programming side.. 
>
Really now, how about coming up with a distributed application that 
would solve this, that seems
like a good enough challenge for any hacker ...

>id
>rather spent my time on the problem that will help our lives better.
>
as do we all ...

>
>what is clean and elegant code if you got the wrong results? yes all
>programmer wish to have a clean and elagant code. but take note, not all
>clean and elegant code is a good program! for example, writing a factorial
>program.  you have two options here, recursive and iterative.
>
>recursive:
>
>double factorial(double n) {
>    if (n < 2) {
>        return (1);
>    } else {
>        return (n * factorial(n -1));
>    }
>}
>
>iterative:
>
>    double factorial;
>
>    if (n < 2) {
>        factorial = 1;
>    }else {
>        for (factorial = n ; n != 2; factorial = factorial * --n);
>    }
>
>now which of them is clean and elegant code? it looks like the recursive is
>clean and elegant but what about speed? the iterative is more faster than
>the recursive because of the expensive call due to recursive which takes
>more clock ticks than the iteratative one. you see what i mean?
>
For small chunks, you can probably get away with doing it the fast,
iterative way or you can even do it in assembly
if speed is truly an issue but for extremely LARGE and COMPLICATED  systems,
I believe it's still advisable to do it the clean way

>
>now if you have a formula which takes faster to solve, then thats fine if
>and only if the result is correct. but if not, then you have to back off and
>do the most basic thing to do which is using the brute force algorithm
>first... until you got the correct answer then thats the time to polish,
>find that formula and improve your algorithm.
>
>there are three basic rules that im always followed
>
>1. functionality
>2. speed
>3. size
>
>1. functionality - whether its clean or robust as long the result is correct
>and  you meet your deadline. this is usually a common pitfall of a
>programmer, they are spending more time on *bones* than the *meat*. or let
>say, who is a good programmer? the one who makes a robust program but gives
>the correct results and meet his/her deadline or the one who makes an
>elegant code that gives the correct results also but it takes time to
>finish?
>
>2. speed - of course its not only on the functionality but also the speed...
>yes if you derived a clean and elegant code but suffer the speed, its
>useless!!. one good example is the above example.
>
>3. size - you got the functionality and speed but if you got a bloated
>program, its still useless! bloated program is only good if your OS is a
>single user and single task OS because it is run one at a time. but running
>multiple instances of your bloated program makes the difference.
>
>so therefore i dont care whethere you use postfix or whatever as long ive
>met those three rules.
>
Well, how do you solve it without using postfix eh???

>
>fooler.
>

-- 
jezbum

============================================================
Jessie Evangelista<[EMAIL PROTECTED]>
Developer, SMetrix Inc. ,Philippines
Tel no.: +6328438064
============================================================

  Three Rings for the Elven-kings under the sky,
    Seven for the Dwarf-lords in their halls of stone,
  Nine for mortal men doomed to die,
    One for the Dark Lord on his dark throne.
  In the land of Mordor where the Shadows lie

  One Ring to rule them all,
    One Ring to find them,
  One Ring to bring them all,
    and in the darkness bind them.
  In the Land of Mordor where the Shadows lie 
    -- J.R.R. Tolkien



_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to