1. In computer science, \textit{concurrent processes} are processes that occur simultaneously with shared memory. The steps of the processes may be interwoven in some unknown order that can change. At time
, the value of some variable

which is considered shared memory between Processes A and B is 6. Let the steps of Process A be
Step 1:
Step 2:
Similarly, let the steps of Process B be
Step 1:
Step 2:
Both processes A and B will run twice (with the steps interwoven in some order) and then stop. For some interweaving of the steps, what is the minimum possible value of
? (Note: the second run through of Process B may begin before the first run through of Process A finishes, or vice-versa. However, for a specific process, Step 1 occurs before Step 2.)
2. Consider a 2-dimensional array with a length of

and a width of

(entries, so we have a

grid of entries). We denote which row we are in with the index
, and which column we are in with the index
. The indices of each variable range from

to
, inclusive (integers only, of course). Initially all of the entries in the array are set to False. Then a program iterates through all of the entries, by passing through them row by row. For each entry, the code determines the values of

and
, and turns the value of the entry to True if and only if the sum of

and

are a multiple of
. When the program has terminated, how many entries are set to have a value of True (Sidenote: in Python, the condition that

and

sum to a multiple of

is represented by the statement
.)
3. A hash table contains eleven buckets, labeled with the numbers
. At this point in time, the ``0" bucket is empty. The remaining ten buckets each contain one element: a list of the positive integers up to
, where

is the label on the bucket (for instance the ``4" bucket contains the list
). Then the following program is executed two times, where the program's process is described as follows: randomly generate a list of the subset of the first ten positive integers so that each list (including the empty list) is equally likely to occur. The program returns a tuple of the length of the generated list and the list itself. This list is then mapped to the bucket corresponding to its length (for instance, a list of length

is mapped to the ``4" bucket, regardless of the contents of the list). After this program's two executions are complete, what is the probability that the ``7" bucket still contains
? You need not fully simplify your answer.
4. Consider the following algorithm, where the input is a positive integer

at least
. Identify the unique prime factorization of

such that

where

are positive integers and

are distinct prime numbers. Let

denote the application of the algorithm described above to
. Note that if

the algorithm does not terminate because it is caught inside an infinite loop. For the sake of this problem we say that

fails to terminate with respect to
. Find the sum of all positive integers

less than

for which

does fails to terminate with respect to

(note: if
, 
fails to terminate with respect to
, and
, we do not count

in our total).
5. Consider the following list of positive integers:

For reference, three-way merge sort works according to the following algorithm: if your list is one element, return that list (the base case). Otherwise, split the list into thirds based on the original order (e.g. in the above example the list is partitioned into
,
, and
), and assume they are sorted. Then return the three-way merge sort of the three sublists appended together (i.e. the recursive call). In this example every list and sublist has a length that is an integer power of

(don't worry about the resulting sublists being uneven in size). Let

be the number of steps to sort the above list using three-way merge sort (where for this problem we define a step as a partitioning of a list into thirds, and the sorting of any three already sorted sublists counts as two steps). Let

be the number of steps to sort the above list using insertion sort. Compute
.
6. Consider the set
. We wish to make a set cover of
. A set cover is a collection of sets

such that
. However, the sets you have to choose from to make the set cover are predetermined. In this case you have a ``wild card" set
. It can be any subset of

that you please. Moreover, you also have these other subsets of

to consider:






You wish to make a set cover using

and exactly three of the other sets

and
. What is the smallest possible cardinality of
?
This post has been edited 2 times. Last edited by Kingofmath101, Aug 4, 2017, 10:23 PM