Abstract
Back in Chapter 9 your VIC added up the first 1000 odd numbers. In that case we simply told the computer to increment by two to reach another odd number to add into the sum. Now we pose the problem: how do we teach your VIC to figure out whether any given integer is even or odd? This innocent problem has a number of solutions. We will use a variant of a solution to this problem to examine a classic question in probability—the Random Walk. We will write a program that will calculate the average time it takes a drunken bug reach the edge of the screen. For the computer to realize that the little fellow has reached the edge it has to solve a simple algebraic equation very similar to the one that solves...
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 1983 Birkhäuser Boston, Inc.
About this chapter
Cite this chapter
Kahn, D., Scrimshaw, N.B. (1983). Number Theory 2. In: Discover Your VIC-20. Birkhäuser Boston. https://doi.org/10.1007/978-1-4615-9816-9_14
Download citation
DOI: https://doi.org/10.1007/978-1-4615-9816-9_14
Publisher Name: Birkhäuser Boston
Print ISBN: 978-1-4615-9818-3
Online ISBN: 978-1-4615-9816-9
eBook Packages: Springer Book Archive