Go Back   Science Forums > Physical Sciences Forums > Computer Science and Technology
Reply
 
LinkBack Thread Tools
Old 04-19-2009   #21 (permalink)
Buffy's Avatar
Resident Slayer

Administrator

Location:
Sunnydale, CA
 
Buffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond repute
 



Not Ranked  0 score     
Re: Algorithms beyond programming

Quote:
Originally Posted by stereologist View Post
i would agree that there are no algorithms for computing pi. There are algorithms for computing approximations to pi.
Right, that's my point: you end up doing a deus ex machina of throwing in a "oh, and stop after you get to n digits," which oddly enough from a *theoretical* standpoint is quite dissatisfying....

Not getting the irony yet?

Quote:
Originally Posted by stereologist View Post
...another term that is often misused is the term parse...
Ah but in that case we have a perfectly useful term, "lexical analysis" (or "lexing" for those of you who like to turn nouns into verbs), but we still have no terminology for this "not-an-algorithm-thingy" which we hate because it's beautiful....

Don't tell me that a true "algorithm for computing \pi" would not be a thing of beauty....

One should either be a work of art, or wear a work of art,
Buffy


----------------
"If you do not agree with anything I say, I'll not only retract it, but deny under oath that I ever said it!"
__________________________________________________ ______________-- Tom Lehrer

"No Robbie, not Europe!"


Forum Administrator
Hypography Science Forums - Science for Boys and Girls! Its not for nothing that we hang out here.

Last edited by Buffy; 04-19-2009 at 12:04 PM..
Reply With Quote
Old 04-19-2009   #22 (permalink)
stereologist's Avatar
Questioning


 



Not Ranked  0 score     
Re: Algorithms beyond programming

Quote:
Not getting the irony yet?
To be honest no. It is provable that there is no finite decimal expansion for pi or sqrt(2). So no algorithm can be written that computes these values.

What's wrong with process, procedure, computation, method, technique, method, routine, or operation?
Reply With Quote
Old 04-20-2009   #23 (permalink)
Boof-head's Avatar
Suspended


 



Not Ranked  0 score     
Re: Algorithms beyond programming

Ah cha, as Ramunandran would have said, what if we don't expand or calculate pi?

What if we stay "circle-free", and forget about circularity?
Reply With Quote
Old 04-20-2009   #24 (permalink)
Pyrotex's Avatar
Slaying Bad Memes

Moderator
Editor

Location:
Houston, Texas
Latest blog entry:
 
Pyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond repute
Send a message via MSN to Pyrotex
 



Not Ranked  0 score     
Re: Algorithms beyond programming

Quote:
Originally Posted by stereologist View Post
...It is provable that there is no finite decimal expansion for pi or sqrt(2).
This is quite true.
Quote:
So no algorithm can be written that computes these values....
This is not quite true.

What you seem to be saying is that IF you cannot compute ALL the decimal expansion (which would be impossible), then any calculation at all is worthless; it's not the "true" value.

But scientists, engineers, programmers and others who live in the "Matheverse" don't do things that way. ALL values that are irrational (they cannot be expressed as a/b, where a and b are integers) are always expressed and used and discussed within a certain "error factor", which can be as close to zero as your heart desires. Typically, this error factor goes unspoken and assumed.

So, how accurate a value of pi do you want? If you're willing to wait long enough, the algorithms can compute a value as accurate as you like.


----------------
Hypography Forums Moderator
-- - - - - -
What concerns me is not the way things are, but rather the way people think things are.
Epictetus, Greek Philosopher
The map is NOT the territory.
Korzybski, Polish-American Philosopher
Reply With Quote
Old 04-20-2009   #25 (permalink)
Pyrotex's Avatar
Slaying Bad Memes

Moderator
Editor

Location:
Houston, Texas
Latest blog entry:
 
Pyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond repute
Send a message via MSN to Pyrotex
 



Not Ranked  0 score     
Re: Algorithms beyond programming

Quote:
Originally Posted by stereologist View Post
...another term that is often misused is the term parse. People often say things like "parse the input for the phone number". Parse means to find the relationships between the parts. Scanning and searching are not parsing. Parsing human languages requires determining the relationship between words....
In 30+ years of programming, the only context I've ever heard "parse" used was in compilers, interpreters, and certain computer games that needed to "read" text input from the player.

In all these contexts [pun intended] there was an algorithm that collected the ASCII (typically one letter at time) and determined if there was a sequence of rules and/or filters that would render the input into an unambiguous sequence of internal commands and data items. This was "parsing". If the parsing succeeding in producing a valid sequence of commands (and data), then they were executed. Eventually, one of those commands was "Stop".

Having written such a compiler once, long ago, my favorite way of "parsing" was by using a Finite State Machine (FSM) -- as opposed to today's more popular Object Oriented Machine (OOM).

Technically, the FSM wasn't an algorithm because it did not HAVE to end; if your input source code went on forever, so would the compiler -- until it overran memory and crashed, of course. But practically speaking, there was always a "Stop" because humans can only write (and attempt to compile) source code of finite length. So, I guess it WAS an algorithm.


----------------
Hypography Forums Moderator
-- - - - - -
What concerns me is not the way things are, but rather the way people think things are.
Epictetus, Greek Philosopher
The map is NOT the territory.
Korzybski, Polish-American Philosopher

Last edited by Pyrotex; 04-20-2009 at 01:17 PM..
Reply With Quote
Old 04-20-2009   #26 (permalink)
CraigD's Avatar
Creating

Administrator
Editor

Location:
Silver Spring, MD, USA
 
CraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond repute
 



Not Ranked  0 score     
Post The problem of intractability with exact representations of irrational numbers

Quote:
Originally Posted by Boof-head View Post
Ah cha, as Ramunandran would have said, what if we don't expand or calculate pi?
I suspect that most programmers with a math bent – who tend to spend a lot of time ignoring proven impossibility and just trying to code it anyway – have on at least one occasions seriously considered this question.

The real numbers, which consist of the rational and the irrational numbers, taunt one to find a simple scheme to represent digitally. For the other common numbers systems - the naturals, integers, rationals, and complex - numbers can be simply and compactly represented with pairs of numbers of the more elementary system –

\mathbb{Z}=\mathbb{N}_1 -\mathbb{N}_2,

\mathbb{Q}=\mathbb{Z}_1 \div \mathbb{Z}_2,

\mathbb{C}=\mathbb{R}_1 + i \mathbb{R}_2

– but not so with the reals.

Exactly representing an irrational real number is no big challenge – just write it using recognized symbols, \pi, e, \sqrt{2}, etc. The big deal ensues when you start doing arithmetic with them.

For example, the simple series \sum_{a=1}^{100} \sqrt{a}

which has an approximate rational value 671.46295, has the exact rational value:

55 + 28\sqrt{2} + 15\sqrt{3} + 10\sqrt{5} + 10\sqrt{6} + 6\sqrt{7} + 6\sqrt{10} + 6\sqrt{11} + 3\sqrt{13} + 3\sqrt{14} + 3\sqrt{15} + 3\sqrt{17} + 3\sqrt{19} + 3\sqrt{21} + 3\sqrt{22} +
3\sqrt{23} + \sqrt{26} + \sqrt{29} + \sqrt{30} + \sqrt{31} + \sqrt{33} + \sqrt{34} + \sqrt{35} + \sqrt{37} + \sqrt{38} + \sqrt{39} + \sqrt{41} + \sqrt{42} + \sqrt{43} + \sqrt{46} + \sqrt{47} + \sqrt{51} +
\sqrt{53} + \sqrt{55} + \sqrt{57} + \sqrt{58} + \sqrt{59} + \sqrt{61} + \sqrt{62} + \sqrt{65} + \sqrt{66} + \sqrt{67} + \sqrt{69} + \sqrt{70} + \sqrt{71} + \sqrt{73} + \sqrt{74} + \sqrt{77} +
\sqrt{78} + \sqrt{79} + \sqrt{82} + \sqrt{83} + \sqrt{85} + \sqrt{86} + \sqrt{87} + \sqrt{89} + \sqrt{91} + \sqrt{93} + \sqrt{94} + \sqrt{95} + \sqrt{97}

As long as the number of operations in a calculation are small, on a human scale, it’s not impractical to represent irrational numbers exactly. If, however, a calculation has billions or more of operations, as they commonly do when performed using a computer, the representations can become impractically unwieldy – intractable, to use a good term – with even simple operations such as comparisons requiring nearly the equivalent of repeating the entire preceding calculation. For some fairly modest calculations, the amount of data storage required for systematic schemes to exact represent a rational number can exceed the amount possible given the limited amount of matter and energy in the visible universe!

Intuitively, one can visualize this problem being that real and complex numbers can simply contain too much information to be represented without making shrewd, very context-dependent decisions about the representation scheme to be used. Trying to formalize “shrewd context-dependent decisions” can be a nightmare task.


----------------
Moderator: Computers and Technology; Medical Science; Science Projects and Homework; Philosophy of Science; Physics and Mathematics; Environmental Studies

Last edited by CraigD; 04-20-2009 at 03:50 PM.. Reason: Fixed grammer mistake
Reply With Quote
Old 04-20-2009   #27 (permalink)
stereologist's Avatar
Questioning


 



Not Ranked  0 score     
Re: Algorithms beyond programming

Quote:
the algorithms can compute a value as accurate as you like.
I agree Pyrotex. I posted that.

I jokingly use 3.1415926535 in my code. I think that is good enough to get the circumference of the earth down to a millimeter. For what I do that is overkill.
Reply With Quote
Old 04-20-2009   #28 (permalink)
stereologist's Avatar
Questioning


 



Not Ranked  0 score     
Re: Algorithms beyond programming

The term parse as you use it Pyrotex is incorrect. To parse is to identify the relationship between the words or parts of a sentence. A parser accepts and rejects input.

The FSM is an automaton that is capable of parsing what are known as linear grammars. These are simple grammars. Push down automatons are required for the next level of grammar complexity called the context free grammars.

I'm not surprised that you have not heard parse used correctly. It rarely is.

Another example of the misuse of language is found in a company where they told people to "solution the problem." No one solved problems there. I always imagined the bosses stirring large vats of liquid trying to create solutions.
Reply With Quote
Old 04-20-2009   #29 (permalink)
Boof-head's Avatar
Suspended


 



Not Ranked  0 score     
Re: Algorithms beyond programming

I remember writing a FSM (ATN net) for a parser for machine instructions for a handful of Intel and Motorola 8 and 16-bit chips for a bunch of engineers.
It was completely deterministic and simply read "tokens" from the input - an ASCII file of assembler tokens and directives - it always looked for a valid declarative. ATN grammars are context-free, and assembler instructions are (mostly) context-free as well, or the few exceptions, like the extensions in addressing modes introduced by Intel with the 16-bit chips were easy enough to handle.

Any algorithm can be recoded as a finite-state grammar, or transformed from a procedural 'algorithm' to a completely deterministic one. The deterministic state-transition paths should only be taken though, after you check the input is a valid set of tokens - there should be a lot of 'outs' in the graph, or default lambda-states that either 'fall-through' to the next state, or halt with a runtime error.
You could determine the inner workings of some algorithm, and decide to make it completely deterministic by setting a set of flags in registers, according to a scheme that corresponds to running an algorithm - the machine will produce the same output, although it will be fixed rather than variable so it will only handle one specific input state.

This might (or more likely it won't) correspond to what you want the algorithm to do, but in principle any 'program' can be recoded as a set of flags being tested and set, according to a predetermined pattern.
Reply With Quote
Old 04-21-2009   #30 (permalink)
Pyrotex's Avatar
Slaying Bad Memes

Moderator
Editor

Location:
Houston, Texas
Latest blog entry:
 
Pyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond repute
Send a message via MSN to Pyrotex
 



Not Ranked  0 score     
Re: Algorithms beyond programming

Quote:
Originally Posted by stereologist View Post
The term parse as you use it Pyrotex is incorrect. To parse is to identify the relationship between the words or parts of a sentence. A parser accepts and rejects input. ....
Well...
Isn't that what I said?
If a compiler determines which letters represent 'words' and determines the relationship between the words (this word is a command, this word is a modifier of the command, this word is a data item, this word is the object of the command, etc) -- and determines whether the entire string represents a valid sequence of words (accept!) or not (reject! print out error message!) -- isn't that 'parsing' by your own definition?



----------------
Hypography Forums Moderator
-- - - - - -
What concerns me is not the way things are, but rather the way people think things are.
Epictetus, Greek Philosopher
The map is NOT the territory.
Korzybski, Polish-American Philosopher
Reply With Quote
Reply

Bookmarks

Tags
measurements


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
programming games for TI? php111 Watercooler 0 09-02-2007 12:34 PM
vb.net Programming TheBigDog Computer Science and Technology 26 01-29-2007 03:27 PM
What programming languages do you know? Jay-qu Community Polls 27 01-26-2007 09:00 AM
Genetic Algorithms Binary_Branflakes Computer Science and Technology 17 03-10-2006 04:54 PM
Programming tarak Computer Science and Technology 33 05-18-2005 07:08 AM

» Advertisement
» Current Poll
Who's the sexiest man alive? Johnny Depp or Robert Pattinson?
Johnny Depp - 30.00%
3 Votes
Robert Pattinson - 0%
0 Votes
Someone else (please specify) - 40.00%
4 Votes
I'm too macho to think a guy is sexy - 30.00%
3 Votes
Total Votes: 10
You may not vote on this poll.


All times are GMT -8. The time now is 12:19 AM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
Copyright © 2000-2009 Hypography
Part of the Hypography - Science for Everyone Network