Читать книгу Algorithms For Dummies - John Paul Mueller, John Mueller Paul, Luca Massaron - Страница 23
Describing algorithms in a lingua franca
ОглавлениеAlgorithms do provide a basis for communication between people, even when those individuals have different perspectives and speak different languages. For example, Bayes’ Theorem (the probability of an event occurring given certain premises; see https://betterexplained.com/articles/an-intuitive-and-short-explanation-of-bayes-theorem/
for a quick explanation of this amazing theorem)
P(B|E) = P(E|B)*P(B)/P(E)
appears the same whether you speak English, Spanish, Chinese, German, French, or any other language. Regardless what language you speak, the algorithm looks the same and acts the same given the same data. Algorithms help cross all sorts of divides that serve to separate humans from each other by expressing ideas in a form that anyone can prove. As you go through this book, you discover the beauty and magic that algorithms can provide in communicating even subtle thoughts to others.
Apart from universal mathematical notations, algorithms take advantage of programming languages as a means for explaining and communicating the formulas they solve. You can find all the sorts of algorithms in C, C++, Java, Fortran, Python (as in this book), and other languages. Pseudocode is a way to describe computer operations by using common English words. Some writers rely on pseudocode to overcome the fact that an algorithm may be proposed in a programming language that you don't know. In addition, pseudocode can be more concise than a programming language because you can use intuitive ideas that the programming language may not capture well.