In high school you may have seen a definition of logarithm that included multiplication. We get by computing the product of three tens. We get by computing the product of ten twos. When we ask for the logarithm base ten of a number we are asking: “To what power must I raise to get ?”…
Selection sort vs. insertion sort
Let’s suppose that we are sorting a list of N elements. We have placed these numbers on a horizontal line. When we are done, each number will be greater than or equal to its neighbor on the left. The left-most number will be the smallest number and the right-most number will be the largest. Both…
Why study searching and sorting algorithms?
We study searching and sorting algorithms because they appear in the solutions of many problems. We study searching and sorting algorithms because they are simple. We can produce a program that searches or sorts data by writing just a few lines of code. We can see the whole program at once. We do not have…
Equivalence of Computers, Programs, and Languages
There are many makes and models of computers. There are many programming languages. Let’s say that two computer programs are equivalent if, when we run both programs with the same inputs, we get the same outputs. Let’s say that two programming languages are equivalent if, for each program that we can write using Language A,…
IEEE-USA Congressional Visit Day 2024
I participated in the IEEE-USA’s Congressional Visit Day on April 10–11, 2024. The Congressional Visit Day is an opportunity to… Learn more about IEEE here and more about IEEE-USA here.
And where do you stand, Professor?
I had a colleague who taught economics. He taught a course that focused on the economic experiences and circumstances of women. He invited students to explore possible explanations for differences in patterns of employment and income among men and women. In doing so, I believe that my friend took on a great challenge and exposed…
What is a variable?
In a course on mathematics we might define the word variable to mean “the unknown quantity.”We have an equation and we want to know: for which values of does the equation hold true? In a course on physics, we might define the word variable to mean “the adjustable quantity.” We have an electrical circuit. We…
3 Variations on sequential search
We are going to look at a simple problem. Things might look complicated at points along the way. Be patient. Some important lessons will emerge at the end. If I am successful, the algorithms will appear simple to you again at the end. Suppose that you are looking at a calendar. The page for July…
Why these algorithms?
If you choose to study computer science, you will almost certainly encounter these algorithms (or a very similar set of algorithms) early in your study: Some curricula include the selection sort but not the insertion sort, or vice versa. Other curricula substitute the quicksort for the merge sort and others ask students to learn both…
How and why to practice programming
Borrow code and make it your own Borrow a short program from your professor, a book, or the Internet. Make a small change to that program. Test the program. Confirm that your change produced the result that you expected or, through this experiment, learn more about what kind of change a modification to that part…