exercise:05eec0c9b5: Difference between revisions
(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...") |
No edit summary |
||
Line 1: | Line 1: | ||
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 | |||
<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> | 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 | 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 | corresponding binomial numbers are odd.) Use your pictures to explain why this is | ||
true. | true. |
Latest revision as of 23:14, 12 June 2024
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.