World's most popular travel blog for travel bloggers.

[Solved]: Number of possible programs in a language

, , No Comments
Problem Detail: 

Is the number of possible programs usually finite or infinite? I'm playing with the idea of generating all possible programs for a language - is that even a finite number or must we be more specific, finite RAM etc?

Asked By : Dac Saunders

Answered By : Andrej Bauer

When considering such questions we usually disregard limitations of real computers and think about a programming language theoretically.

A general-purpose programming language (any language used in practice falls into this category) has infinitely many programs. Furthermore, all programs can be generated systematically. Implementing a program which generates all programs may be a useful learning experience, but has little actual value. The number of all programs of length $n$ is exponential in $n$ and so is unfeasable, except for fairly small values of $n$.

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/58028

 Ask a Question

 Download Related Notes/Documents

0 comments:

Post a Comment

Let us know your responses and feedback