Tuesday, 2 December 2014

Problem Solving Episode Thing




PROBLEM: Piles of pennies
You are sitting in front of two drawers. The left drawer contains 64 pennies, the right drawer contains nothing. Can you arrange things so that one of the drawers has 48 pennies, using the following two operations:
L
If the left pile has an even number of pennies, transfer half of them to the right pile. If the left pile has an odd number of pennies, operation L is disallowed.
R
If the right pile has an even number of pennies, transfer half of them to the left pile. If the right pile has an odd number of pennies, operation R is disallowed.
What about arranging things so that one of the piles has other numbers in the range [0,64]? 



STEP 1 UNDERSTANDING THE PROBLEM:
You have two numbers, x and y. x is 64 and y is 0. The only operation that you can perform on these variables is: If one of the variables is an even number, add half of that variable to the other variable then divide the first variable by two.
Given this, is it possible to make x or y equal to all the numbers from 0 to 64.
It is possible to reach 48 by performing the operation on x twice.

STEP 2 DEVISING A PLAN:
One approach to this problem is to just start by randomly performing the operation and collect the data to see if there’s a pattern. Information obtained here may also help with other plans
Another approach is to try to work backwards. Start with your target x or y value and try to get back to x = 64 and y = 0. This can either be done for every x and y value, or a pattern can be found
A third approach is to look at the problem and try to think if there is a way to mathematically prove that it is possible for certain numbers
A fourth approach is to make a python program that can randomly do these operations until it has obtained every number from 0 to 64. (This is probably cheating).

STEP 3 CARRYING OUT THE PLAN:
Operation L halves x and operation R halves y.
Operation #
x
y
Operation performed
0
64
0

1
32
32
R
2
16
48
R
3
40
24
L
4
52
12
L
5
58
6
L
6
29
35
R
From these trials, it appears that an odd number is only obtained after 6 operations. This could be because 64 = 26 and 26 divided by 2 six times would obtain a 1. Also, we can note that we only need to find out if the numbers <32 or >32 can be obtained. This is because if x < 32, then y would be the counterpart number > 32 such that x + y = 64.
Looking at it another way, the pair 64,0 can be rewritten as 32(2), 0. This can then be operated on to become 16(2), 16(2). From here, it can be seen that the 2 is pretty much negligible. For example:
Operation #
x
y
Operation performed
0
16(2)
16(2)

1
8(2)
24(2)
L
2
20(2)
12(2)
R
3
10(2)
22(2)
L
4
5(2)
27(2)
R
At any step, 2 could simply be divided out by using the operation to get the desired number at that step. Thus, this would be like starting with x = 32 and y = 0 and finding if the numbers from 0 to 32 can be obtained. Similar to what was argued earlier, we would only need to find out if we could obtain numbers < 16.
We could then change it again to have 16(4), 0(4). We need to show that we can obtain the numbers < 8 to get the numbers [0, 16].
Then for 8(8), 0(8) we need to show we can obtain the numbers < 4 to get the numbers [0, 8]
Then for 4(16), 0(16) we need to show we can obtain the numbers less than 2 to get the numbers [0, 4]
Then we get to 2(32), 0(32). From here we see that 0 can be obtained and 1 can be obtained by doing operation L. So this means we can get [0, 4] which then means we can get [0, 8], which means we can get [0, 16], which means we can get [0, 32], which means we can get [0, 64].



STEP 4 LOOKING BACK:
What I did above is just speculation, I’m not sure if it entirely makes sense. I need to look over it more to see if it does. I could also make a tree with all the possibilities to check if the numbers from 0 to 64 are actually obtainable.

Monday, 1 December 2014

SLOG Final Week

Lectures:
There was only one lecture this week on Monday and I didn't bother to show up since it was a review class. Or at least that's what the CDF site says it is.

Assignment 3:
Some of the questions in assignment 3 were pretty simple such as the proof with the big omega since we had done many examples of those in class and in tutorials. However, the questions with l'hopital and halting were a lot more difficult since we didn't really get many examples from lectures or tutorials to help with them.

Overall thoughts on the course:
I thought this course was interesting. Learning how to properly use logical symbols and quantifiers really helped in being able to read some mathematical statements. My favorite part of the course though is the proof section, even though it was the hardest. Doing proofs and learning proof structure really helped teach me how to approach a proof question. Before that part of the course I was always really confused with proofs in calculus since I was not sure what we're allowed to do or how to even start the proofs.

Some issues that I had with this course is that it seemed kind of slow and repetitive at times. Going through all the proof examples during lectures helped remember proof structures a bit but it got really repetitive. Also, some of the content in the course such as quantifiers overlapped with what we learned in calculus.