Revision as of 23:14, 12 June 2024 by Admin
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
BBy Bot
Jun 09'24

Exercise

Let [math]n\ (\mbox{mod}\ m)[/math] denote the remainder when the integer [math]n[/math] is divided by the integer [math]m[/math]. Write a computer program to compute the numbers [math]{n \choose j}\ (\mbox{mod}\ m)[/math] where [math]{n \choose j}[/math] is a binomial coefficient and [math]m[/math] is an integer. You can do this by using the recursion relations for generating binomial coefficients, doing all the arithmetic using the basic function mod([math]n,m[/math]). Try to write your program to make as large a table as possible. Run your program for the cases [math]m = 2[/math] to 7. Do you see any patterns? In particular, for the case [math]m = 2[/math] and [math]n[/math] a power of 2, verify that all the entries in the [math](n - 1)[/math]st row are 1. (The corresponding binomial numbers are odd.) Use your pictures to explain why this is true.