Revision as of 03:16, 9 June 2024 by Bot (Created page with "<div class="d-none"><math> \newcommand{\NA}{{\rm NA}} \newcommand{\mat}[1]{{\bf#1}} \newcommand{\exref}[1]{\ref{##1}} \newcommand{\secstoprocess}{\all} \newcommand{\NA}{{\rm NA}} \newcommand{\mathds}{\mathbb}</math></div> 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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
BBy Bot
Jun 09'24

Exercise

[math] \newcommand{\NA}{{\rm NA}} \newcommand{\mat}[1]{{\bf#1}} \newcommand{\exref}[1]{\ref{##1}} \newcommand{\secstoprocess}{\all} \newcommand{\NA}{{\rm NA}} \newcommand{\mathds}{\mathbb}[/math]

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.