※スタイルシート未対応ブラウザではレイアウトを正確に再現できません。
  < The returning  contents  advance >   
                   < [modosusu] > Color magazine monochrome light and shade   font predetermined, Gothic Ming-style type longhand   size Konaka large   standard  


  Outline of algorithm   

  1. ..clause 1..: What is the algorithm?
  2. ..clause 2..: Performance of algorithm
  3. ..clause 3..: O ([o-]) notation
  4. ..clause 4..: Data structure

[1] What is the algorithm?

The algorithm is official of which the procedure to solve a certain problem.
It is a computational method that repeats the procedure of limited piece in limited times a little more strictly clearly.

[   Algorithm   ]
It is a group of the rule of limited piece clearly defined.
The one to solve problem by applying limited times.
(From JIS (Japan Industrial Standards). )
The clear cut procedure is a meaning of the street.
The computer needs a clear instruction as explained in even the 0th.
"Take the Kimchi from the refrigerator" is an indefinite instruction.
Rotation..advancement..rotation..arm..rise..clear..instruction.

The procedure of limited piece is a little mysterious expression.
You may not worry becoming of the procedure infinitely so much in general because it doesn't think easily.

The calculation that repeats limited times is that the calculation ends without fail some time.
There is no paulownia in the length and the repetition of the calculation that doesn't end indefinitely.
End the calculation of pi following infinity compulsorily at the stage calculated to some extent.

Whenever the computer is made to calculate and the problem is solved, these conditions are necessary.
To some degree when man solves the problem though it relies on the experience and Caen usually
Because the computer doesn't provide such a function, the clear cut procedure is needed without fail.

The algorithm must not depend on the programming language as a rule.
The same algorithm can be used even in C, Java, and BASIC.

It returns to contents.


[2] Performance of algorithm

It differs from the real world because the computer is the world of a pure theory, and there is no physical restriction.
Therefore, even when the same problem is solved, very various methods can be devised.
However, various methods also include an excellent method and a method not so naturally.


[   Computer and religion   ]
Actually, the computer industry is religious.
Because a physical restriction can be disregarded, and very various ideas be done.
Therefore, even if the same thing is done, the method is quite different depending on the person.
It is according to circumstances because of becoming the fight over the level which method to be believed.
Here..where..excellent method..judge..in a word..performance assessment..problem..become.
The following standard is often used as a standard by which the performance of the algorithm is compared.
Computational speed(It is ending early excellent. )
Memory utilization(It is ending few excellent. )
Accuracy of calculation(It is computable accurately excellent. )
Easiness of program to make(It is excellent as it is possible to make it easily. )
After all, this point that should be paid attention is a computational speed.
Though the difference by the algorithm is not very ..one and other standard.. great
When the algorithm is different, only the computational speed has the difference of Heaven And Earth.

The problem of stable marriage is an interesting example of showing this.
These problems are the following problems when easily explaining.


[   Stable marriage   ]
Each of several men and women the single put it out, and the group met with a view to marriage, and put out the favorability to each other party.
When favorabilities are higher than my marriage partners, each other has an affair with them.
Find the combination of the marriages about which it is not worried that all members of them have an affair.
It explains easily though it doesn't introduce to a concrete program code.
It is a method of confirming whether there is other party of fickleness about all the combinations that hits on first.
Of course, it is possible to find an answer to a question even by this method.
However, it comes to take time by increasing of the number of people of men and women who meet it with a view to marriage.
When 15 people are exceeded for 30 minutes or more in 14 people if they are ten people though it is a few seconds, it is more than.
The calculation doesn't end while the human race has already lived when becoming 20 people.

The purpose is about why to take time like this to examine all the combinations.
The total of man and woman's combination can be requested by the factorial of the number of people.


[ The   floor multiplication   ]
1x2x3x4x5x6x7x8x9x10 Calculate.
It becomes more than the geometric progression and it becomes a great number when increasing.
Moreover, when fickleness is not confirmed by the second power of the number of people alone, it doesn't become it in the fickleness confirmation.
Then, it is necessary to calculate times of "The second power of factorial × number of people of numbers of people" to this algorithm.
Tabulate the number of people and the calculation frequency based on this.
Number of people Calculation frequency
1 1
5 3000
10 362880000
12 68976230400
14 17086945080000
15 294226732800000
20 973160803300000000000
When the number of people increases, it is understood that the calculation frequency increases the more rapidly more unbelievable.

Then, let's think this is sped up.
To begin with, all the combinations need not be examined.
First of all, the man proposes to a 1st choice woman.
At this time, engage it to a new man when the woman doesn't have the other party or the favorability is low even in case of being.
And, the [fura] [reta] man proposes from the woman to the woman under 1 rank who proposed ahead.
In a word, the woman decides the other party while raising the rank while dropping the rank by the man.

Because N person's man proposes to N person's woman in this algorithm, the calculation frequencies are the second power of the number of people.
Tabulate the number of people and the calculation frequency based on this.
Number of people Calculation frequency
1 1
5 25
15 225
20 400
50 2500
100 10000
The calculation frequency has decreased by not becoming the one compared with ahead.
The meeting with a view to marriage of a large scale of 100 people is computable in a few seconds if it is this algorithm.
In the case to use this algorithm with the family computer
When you use the last algorithm with PlayStation 2
It is a difference of the degree with more computable obviously fast family computer.


[   Super-efficient game machine and family computer   ]
The family computer was actually a super-efficient game machine though it became a complete bytalk.
If you think the game watch of the family computer appearance became popular ahead a little
I think that the difference of the performance is understood.
Music and the sound effect can be sounded at the same time by resolution 256x224 (It is larger than the advance) and 16 colors.
Sprite (overlapping processing of the character) is installed with hardware.
It is a miracle to be able to put out hardware like this in not big industry the game but the age.
It is the one that it wants you to feature it by project X by all means.
The computational speed is ..difference between the calculator and the super computer.. [demasu] according to the algorithm thus.
Therefore, the computational speeds are valued most in the performance of the algorithm.

[   Other standards   ]
The memory utilization is also different depending on the algorithm.
The speed doesn't have the difference though it is 2-3 times necessary in a high-speed algorithm.
Though the accuracy of the calculation is also different depending on the algorithm
The speed doesn't have the difference accurately in most algorithms.
The unexpectedly important one is easiness of the program to make.
Because it takes time in a more advanced algorithm and the bug increases easily, too
Easy one is used if there is only a velocity differential of the extent that can be disregarded.

It returns to contents.


[3] O ([o-]) notation

In the preceding clause, the computational speed of the algorithm was compared and the calculation frequencies were compared for the sake of comparison.
Though comparing it at the time that is executed with the computer and takes actually is more intuitive
Did you purposely compare it by the calculation frequency etc. why?

This is because time changes by the computer that executes it naturally.
On a computer with high performance and a low computer, naturally high one is computable fast.
Though there is a method of the comparison always with the same computer, too
In the world of a rapid progress computer, do not keep using the computer of the same performance.
And, it becomes unfair because there is compatibility of the computer and the algorithm, too.

Then, compare it in the comparison of algorithms based on the calculation frequency.
However, even if the frequency calculated accurately in each line is requested, it is not too significant.
It is a part that takes time in the calculation of the algorithm repeatedly processed.
The time of the part not repeated can be disregarded because it is very short.
In a word, if the frequencies are repeatedly compared, the computing time of the algorithm is roughly understood.

However, when the data of the calculation origin increases like the algorithm in the preceding clause
There is an algorithm that the frequency increases enormously repeatedly, too.
Therefore, ..the repetition comparison of the frequencies..
Whether how much the frequency increases repeatedly compared with an increase of the data of the calculation origin becomes important.

O([o-]) notation is used for the computational speed of the algorithm for such reasons.


[   O ([o-]) notation   ]
Value in which an increase in frequency is repeatedly requested from data number asymptotic.
In O notation, if the repetition do proportion of the frequency to n for the data of n piece, it is shown O(n).
However, even when the frequency repeatedly becomes 2n for the data of n piece, it is shown O(n).
..influence [hataka] of integral multiples.. [shireteirutame] and integral multiples are disregarded compared with the second power etc.
The purpose is for the data number to value the degree of an increase when it is very large most in O notations.

For instance, when the algorithm in the preceding clause is shown by O notation, Former..latter.


[ Sign of the   second power   ]
Use the sign named ^2 because it doesn't show the second power easily in the computer character.
Though the calculation frequency of the former was times of "The second power of factorial × number of people of numbers of people"
The second power with a wonderful square is disregarded compared with factorial.

If the computational speed is requested by O notation, it becomes the following chiefly values.

1、log2n、n、nlog2n、n^2、2^n、n!
When the data number increases in a right algorithm, it means the calculation slows explosively.
o(1)Be computable at time the same even if there are very a lot of data numbers for the drinking algorithm.
o(n)The computing time is proportional to the data number for the drinking algorithm.
o(n~2)The computing time is proportional to the second power of the data number for the drinking algorithm.

The performance of the algorithm is understood no execution with the computer when O notation is used.
Moreover, to understand how much to come to slow in calculating when the data number increases
It is very useful for the performance judgment of the algorithm.


[ The   worst calculation   ]
It is the maximum calculation time accurately though has written the computing time here.

The computing time changes depending on data even if it is the same algorithm.
For instance, even when you calculate the marriage of 20 people by a slow algorithm that examines everything
[Demasu] ..the answer at the moment.. when the answer is in the start of the combination soon.
Oppositely, it also takes thousands of years if the answer is.

In the algorithm, the maximum calculation time is valued.
It is because it is likely to become the worst situation in which the calculation doesn't end when the maximum calculation time is slow.

It is difficult to request an average computing time mathematically.

It returns to contents.


[4] Data structure

I ..word that seems to be unrelated to the algorithm seemingly.. hear it with the data structure.
However, the data structure and the algorithm are in an inseparable relation.


[   Data structure   ]
Mode of expression of information
The data structure means what shape you take when information is memorized.
Actually, there is already an explained data structure. It is an array and a structure.
The array expresses two or more information by arranging two or more variables of the same type.
The structure expresses information with relativity bringing the variable of a different type together.
Both expressions are difficult information in a usual variable though these are simple data structures.

Though it is necessary to calculate data and to find an answer to a question in the algorithm
It is very important by what method to memorize data at this time.
It takes time for the treatment when data is memorized in unnatural shape.
According to circumstances, it is even when the data structure is an algorithm.

It returns to contents.


< - Advanced -> to the returning following. the first  that returns