Math
A friend claims that she has discovered something interesting.
After looking over the lottery 649 draws for the last 5 years, she has noticed
that, quite often, when six numbers are drawn, at least two of them are consecutive.
For example:
2 21 23 24 25 39 (this has at least two consecutive numbers 23, 24)
5 16 21 34 39 42 (this has no consecutive numbers)
19 21 22 29 34 49 (this has at least two consecutive numbers 21, 22)
How often should one expect this to happen in lotto 649?
Computer Science
Consider a sequence of integers of size n. Assume that the only thing
that can be done to the sequence is to look at the elements and to reverse the order
of the first few consecutive elements.
- Using only these operations, is it possible to sort the sequence
into non-decreasing order.
- If the answer is yes above, how quickly can a sequence containing
initially random integers be sorted? We charge 1 each time the first few elements are reversed.
If you like Java, I have some code you can play with.
Below is an initial sequence
8 6 9 4 2
If I reverse the order of the first 5 elements I get
2 4 9 6 8
If I now reverse the order of the first 3 elements I get
9 4 2 6 8
If I now reverse the order of the first 2 elements I get
4 9 2 6 8
If I now reverse the order of the first 5 elements I get
8 6 2 9 4
So far, this has cost me 4 reverses, and I have made no progress towards
sorting the sequence.
Math
Characterize all squares with vertices on the integer grid.
That is, are the only squares with integer endpoints, those that are alligned
with the axis? If not, then what do they look like?
For example, the following is a square with integer endpoints, it
has sides which are alligned with the axis.
(0,0),(0,2),(2,2),(2,0)
Computer Science
We say that words x and y are jumbles of eachother if
the letters of x can be rearranged to get y.
Given a dictionary (file, consisting of one word/line)
find the largest group of words, each of which are jumbles of eachother.
For example: If the dictionary contained the words
arts
rats
star
car
arc
then arts, rats and star are all jumbles of eachother.
The largest group of words, all of which are jumbles of eachother
is the above group.