Next: About this document ...
MATH/CSCI 2113
Assigment 2
Due Wednesday, January 23, at the beginning of class.
For each of the following problems, show your work.
- Find the successors of the following permutations in a lexicographic ordering: (a) 15432 (b) 54312 (c) 35421.
- (a) Generate all rearrangements of the word BOOST, in
lexicographic order (where letters that come earlier in the alphabet
are smallest). (b) Check that the number of rearrangements you found
coincides with the formula for the number of rearrangements as learned
last week.
- (a)
- Determine the number of nonnegative integer solutions to
the pair of equations:
- (b)
- How many of these solutions have
? ( Hint: count
by complement.)
- Describe an algorithm which, on input of two integers
and
, where
, generates all subsets of size
of the
set
. Give a precise, step-by-step description of
your algorithm. You may also use pseudocode.
- Determine how many integer solutions there are to the equation
if
- (a)
for
,
- (b)
-
,
,
,
.
Hint: use inclusion/exclusion
Next: About this document ...
Jeannette Janssen
2002-01-21