exercise:05eec0c9b5: Difference between revisions

From Stochiki
(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:
<div class="d-none"><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
\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 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 00:14, 13 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.