بحث عن الخوارزميات بالانجليزي
تعبير برجراف مقال نبذة سيرة انشاء تقرير
موضوع برزنتيشن فقرة
،بحث كامل نبذة عن العالم قصة حياة معلومات
بالانجليزي من هو مؤلفات انجازات فلسفة بحث جاهز باللغة الانجليزية علماء عرب ..
أبرز كتب ومؤلفات The story
بحث نشأة وحياته علوم العلوم
الفلكية علم الأحياء علم النبات الفلسفة ومترجم موضوع انجليزي
عن عالم مشهور موضوع انجليزي عن العالم معلومات مختصرة موضوع تعبير عن شخص
مشهور بالانجليزي قصير تعبير عن قدوتي معلومة عن مختصرة
الكتب انجازات وفاة مسيرته حياته علمه
تلامذته باختصار مترجم العالم علم الرياضيات
Algorithm definition
The difference between
an algorithm and a program is often a question of level of detail. An algorithm
is often expressed with a notation independent of any programming language
while a program is written in a particular programming language.
Another difference
between algorithm and program is that the execution of an algorithm must always
end with a result, while that of a program can lead to an infinite loop (never
stop).
An algorithm is
therefore a method for solving a particular problem that we are sure will
always find an answer in a finite execution time.
Example: To determine if
an integer $ n $ is prime (that is, it does not contain a factor other than $ 1
$ and $ n $), the following algorithm can be used:
For each integer $ i $,
$ 2 \ the i <n $, check if $ i $ is a factor of $ n $ (by dividing $ n $ by
$ i $ and then checking if the result is integer). If so, stop with the answer
`` no ''. If no value $ i $ is a factor of $ n $, then stop with the answer ``
yes ''.
There is in this
(informal) algorithm definition a major problem. Take the example of prime
numbers. Why can we assume that we know how to divide $ n $ by $ i $ and check
that the result is an integer? Should not we have an algorithm for that too?
And if we ever find an algorithm for this division, should not we find an
algorithm for each step of this one? And so on. Or, on the contrary, why can
not we just assume that `` check if an integer is prime '' is an elementary
operation? Why is it necessary to find an algorithm for this operation?
In other words: how do
you know if an operation is elementary (and therefore does not require any
algorithm)?
The answer is that an
operation is basic when a computer can run it very quickly, actually in a
relatively small number of clock cycles.
The reader of this book does not necessarily know if an
operation is elementary within the meaning of the preceding paragraph.
Fortunately it will not be necessary. The notion of abstract type discussed in
the next section will allow us to know if an operation is elementary in the
sense above.
The algorithms in
computer language
Today, all machines with
electronic components use algorithms, which can be more or less complicated.
These algorithms are generally designed by humans, who make diagrams that
resemble those we saw earlier. To be understood by machines, these schemas must
be translated into computer language. Consider for example a very simple
algorithm, always in the kitchen: one that allows the oven to maintain the
right temperature. Here is what it could look like (in a very simple version):
To transcribe this
computer language algorithm, one must first identify what are called the
variables of the problem. Here the variables are the temperature requested by
the user of the oven (which can be noted Tu) and the temperature of the oven
(which can be noted Tf). In the diagram, there is also a lapse of time, to
which we can associate a variable t. We can then rewrite a series of
instructions a little more codified. The algorithm becomes:
Step 1 Read and Memorize
Tu
Step 2 Measure Tf
If Tf is lower than Tu:
heat the oven for a while t = 60 seconds then return to step 2
If Tf is equal to Tu:
heat the oven moderately for a time t = 60 seconds then return to step 2
If Tf is greater than
Tu: stop heating for a time t = 60 seconds then return to step 2
Finally, to translate
this into a computer language, sentences are simplified as much as possible by
using a very basic vocabulary that corresponds to elementary operations already
known by the machine. Words in green are functions: statements that launch an
action or another algorithm, defined elsewhere. In the algorithm below for
example, the counter function carries out a countdown from the value t.
Algorithm good
temperature
beginning
Step 1 Read Tu
Step 2 Read Tf
t = 60
If Tf less than Tu
So
run counter (t)
as t greater than 0
execute heating strong
end as long as
go to step 2
end if
إرسال تعليق