Algorithms For Dummies. John Paul Mueller
Чтение книги онлайн.
Читать онлайн книгу Algorithms For Dummies - John Paul Mueller страница 10
www.dummies.com
and scrolling down the left side of the page that opens. The source code is also at http://www.johnmuellerbooks.com/source-code/
, and https://github.com/lmassaron/algo4d_2ed
.
Where to Go from Here
It’s time to start your algorithm learning adventure! If you’re completely new to algorithms, you should start with Chapter 1 and progress through the book at a pace that allows you to absorb as much of the material as possible. Make sure to read about Python, because the book uses this language as needed for the examples.
If you’re a novice who’s in an absolute rush to get going with algorithms as quickly as possible, you can skip to Chapter 3 with the understanding that you may find some topics a bit confusing later.
Readers who have some exposure to Python, and have the appropriate language versions installed, can save reading time by moving directly to Chapter 5. You can always go back to earlier chapters as necessary when you have questions. However, you do need to understand how each technique works before moving to the next one. Every technique, coding example, and procedure has important lessons for you, and you could miss vital content if you start skipping too much information.
Part 1
Getting Started with Algorithms
IN THIS PART …
Defining algorithms and their design
Using Google Colab to work with algorithms
Performing essential data manipulations
Building a matrix manipulation class
Chapter 1
Introducing Algorithms
IN THIS CHAPTER
Defining what is meant by algorithm
Relying on computers to use algorithms to provide solutions
Determining how issues differ from solutions
Performing data manipulation so that you can find a solution
If you’re in the majority of people, you’re likely confused as you open this book and begin your adventure with algorithms, because most texts never tell you what an algorithm is, much less why you’d want to use one. Hearing about algorithms is like being in school again with the teacher droning on; you’re falling asleep from lack of interest because algorithms don’t seem particularly useful to understand at the moment.
The first section of this chapter is dedicated to helping you understand precisely what the term algorithm means and why you benefit from knowing how to use algorithms. Far from being arcane, algorithms are actually used all over the place, and you have probably used or been helped by them for years without really knowing it. So, they’re stealth knowledge! In truth, algorithms are becoming the spine that supports and regulates what is important in an increasingly complex and technological society like ours.
The second section of this chapter discusses how you use computers to create solutions to problems using algorithms, how to distinguish between issues and solutions, and what you need to do to manipulate data to discover a solution. The goal is to help you differentiate between algorithms and other tasks that people confuse with algorithms. In short, you discover why you really want to know about algorithms, as well as how to apply them to data.
The third section of the chapter discusses algorithms in a real-world manner, that is, by viewing the terminologies used to understand algorithms and to present algorithms in a way that shows that the real world is often less than perfect. Understanding how to describe an algorithm in a realistic manner also helps to temper expectations to reflect the realities of what an algorithm can actually do.
The final section of the chapter discusses data. The algorithms you work with in this book require data input in a specific form, which sometimes means changing the data to match the algorithm’s requirements. Data manipulation doesn’t change the content of the data. Instead, it changes the presentation and form of the data so that an algorithm can help you see new patterns that weren’t apparent before (but were actually present in the data all along).
Describing Algorithms
Even though people have solved algorithms manually for thousands of years, doing so can consume huge amounts of time and require many numeric computations, depending on the complexity of the problem you want to solve. Algorithms are all about finding solutions, and the speedier and easier, the better. A huge gap exists between mathematical algorithms historically created by geniuses of their time, such as Euclid (https://www.britannica.com/biography/Euclid-Greek-mathematician
), Sir Isaac Newton (https://www.britannica.com/biography/Isaac-Newton
), or Carl Friedrich Gauss (https://www.britannica.com/biography/Carl-Friedrich-Gauss
), and modern algorithms created in universities as well as private research and development laboratories. The main reason for this gap is the use of computers. Using computers to solve problems by employing the appropriate algorithm speeds up the task significantly. You may notice that more problem solutions appear quickly today, in part, because computer power is both cheap and constantly increasing.
When working with algorithms, you consider the inputs, desired outputs, and the process (a sequence of actions) used to obtain a desired output from a given input. However, you can get the terminology wrong and view algorithms in the wrong way because you haven’t really considered how they work in a real-world setting.
Sources of information about algorithms often present them in a way that proves confusing because they’re too sophisticated or even downright incorrect. Although you may find other definitions, this book uses the following definitions for terms that people often confuse with algorithms (but aren’t):
Equation: Numbers and symbols that, when taken as a whole, equate to a specific value. An equation always contains an equals sign so that you know that the numbers and symbols represent the specific value on the other side of the equals sign.