Skip to main content
Logo image

PreTeXt Sample Book: Abstract Algebra (SAMPLE ONLY)

Exercises 5.10 Parsons Exercises

1. Parsons Problem, Mathematical Proof.

Create a proof of the theorem: If \(n\) is an even number, then \(n\equiv 0\mod 2\text{.}\)
[Ed. If you examine the source, you will also notice the <exercise> lacks a @language attribute. It is relying on the docinfo/parsons/@language value that is in bookinfo.xml. If present, that attribute will be used for any Parsons that lack a @language.]
Hint.
Dorothy will not be much help with this proof.

2. Parsons Problem, Partial Ordering.

Parsons problems can specify a partial ordering that allows for multiple valid solutions.
Try putting the blocks in a valid order to calculate and printc Only use the required blocks. There are many valid orderings.

3. Parsons Problem, Programming.

The Sieve of Eratosthenes computes prime numbers by starting with a finite list of the integers bigger than 1. The first member of the list is a prime and is saved/recorded. Then all multiples of that prime (which not a prime, excepting the prime itself!) are removed from the list. Now the first number remaining in the list is the next prime number. And the process repeats.
The code blocks below can be rearranged to form one of the many possible programs to implement this algorithm to compute a list of all the primes less than \(250\text{.}\) [Ed. this version of this problem requires the reader to provide the necessary indentation.]
This reprises Exercise 2.5.1.

4. Parsons Problem with executable.

Parsons problems that have a language specified that corresponds to a valid activecode language can be made runnable.
Complete the Python function isolateRed(p) If either the blue or green is higher than the red, average the three color values and set red, green, and blue to be that average. Otherwise, do nothing to p.
After you check a correct answer you will be able to Run the code you created - it will be used to modify the image shown below.
Data: golden-gate.png

5. Parsons Problem, Programming.

The Sieve of Eratosthenes computes prime numbers by starting with a finite list of the integers bigger than 1. The first member of the list is a prime and is saved/recorded. Then all multiples of that prime (which not a prime, excepting the prime itself!) are removed from the list. Now the first number remaining in the list is the next prime number. And the process repeats.
The code blocks below can be rearranged to form one of the many possible programs to implement this algorithm to compute a list of all the primes less than \(250\text{.}\) [Ed. this version of this problem does not require the reader to provide the necessary indentation, which is the default.]
This reprises Exercise 2.5.1.

6. Parsons Problem, Mathematical Proof, Numbered Blocks.

Create a proof of the theorem: If \(n\) is an even number, then \(n\equiv 0\mod 2\text{.}\) [Ed. This version has numbered blocks, online they are on the right end of the block.]
Hint.
Dorothy will not be much help with this proof.

7. Parsons Problem, Programming.

The Sieve of Eratosthenes computes prime numbers by starting with a finite list of the integers bigger than 1. The first member of the list is a prime and is saved/recorded. Then all multiples of that prime (which not a prime, excepting the prime itself!) are removed from the list. Now the first number remaining in the list is the next prime number. And the process repeats.
The code blocks below can be rearranged to form one of the many possible programs to implement this algorithm to compute a list of all the primes less than \(250\text{.}\) [Ed. This version has numbered blocks, online they are on the left end of the block.]
This reprises Exercise 2.5.1.
You have attempted of activities on this page.