Sunday, 16 December 2012

After reading Graham's "How to Get Startup Ideas"

Paul Graham's "How to Get Startup Ideas" is a great article. It's main idea, as he summarized in the very end, is "Live in the future and build what seems interesting." In simple words, in order to get organic startup ideas, we should become the people who are likely to have good startup ideas, and these people are usually at the leading edge of some rapidly changing field. FYI, Graham did convince me of his theorem after I read the article.

However, several questions come up as I was reading. The first question is why people always look at Facebook, Microsoft and Apple?? Well that's look at what they have in common. First, all these companies are huge and close to our live and were all brought up by grass-root founders. Second, all the companies are in the high-tech industries. Third, all the founders were rich at very young ages. Are these three points correlated? Probably. But, I want to keep in mind that there are many other kinds of entrepreneurship in other industries, like Priceline and Virgin Group, and it's very hard to be as successful as these three companies.

Another question I wanna ask is about 3D printing. It seems to me, 3D printing is a awesome technology, but why it's not popular and unsuccessful?? Maybe it's gonna work as Kickstarter shows a successful pledge of nearly $3M!

Wednesday, 5 December 2012

CSC236 SLOG #7

Here's the description of the question:

You are part of a group of friends who choose which to treat to lunch in the following manner:
  1. They arrange themselves in an (approximate) circle.
  2. They begin reciting the positive natural numbers, in order, in a counter-clockwise direction (viewed from above), starting with the friend at the northern extreme of the circle (who utters "one").
  3. As a friend utters an even number, he or she is eliminated from the counting (and consideration for lunch). The counting "wraps around" so that those who avoided one of the dreaded even numbers on the first round may be exposed on subsequent rounds.
  4. The last person left is treated to lunc.
For example, if there are friends f1, f2, f3, f4, and f5 arranged counter-clockwise, with f1 at the northern extreme, the first round would eliminate f2 and f4. Then f1 and f5 would be eliminated in the next round, leaving f3 to enjoy the free lunch.
If there are n friends, where should you position yourself to get the free lunch? Do you have a technique that will work for any positive natural number n?

Dec 3

When I first saw the question, I thought it's easy. I started by experimenting with different number of people, and see who gets the free lunch in each case. Below is the result I got from experimenting:
# of ppl:  1  | 2  | 3  | 4   | 5  | 6  | 7  | 8   | 9  | 10 | 11 | 12 | 13  | 14  | 15   | 16 |
winner:   f1 | f1 | f3 | f1 | f3 | f5 | f7 | f1 | f3 | f5  | f7 |  f9 | f11 | f13 | f15 |  f1 |

In each experiment, I draw a circle that fits the number of people, and then start eliminating in a counter-clockwise direction by crossing out the people who utter even numbers.

After contemplating on the question for a period of time, I come to two lemmas:
1. Obviously, people start with even numbers will never get the free lunch, because they will be eliminate in the first round of counting.
2. When n equals an odd number, the first person will never get the free lunch except n = 1, because he/she will be eliminate in the second run.

And then, I realize I can expand the second lemma to say that when n equals an even number, the third person will never get the free lunch. 

Then I struggled to find some points to build on for about an hour, I decide to call it a day.

Dec 4

Today, I tried to solve the problem from another angle, and it was success. Instead of looking at the process of elimination, I tried to look at the winners as a sequence of numbers. Surprisingly, that clearly showed a sequence - occurrence of 2^a of orderly odd numbers as a starts from 0 and orderly odd numbers start at 1. The way I separate the winners in the following groups will show the sequence:

# of ppl 1: f1
# of ppl 2-3: f1, f3
# of ppl 4-7: f1, f3, f5, f7
# of ppl 8-15: f1, f3, f5, f7, f9, f11, f13, f15
...

After a bit of calculation I come up to this formula: (let cap(n) be the smallest power of 2 that is equal to or greater than n) winner = (cap(n+1)/2 - (cap(n+1) - 1 - n)) * 2 - 1 = 2n + 1 - cap(n+1)

But how can I prove the formula is right? Or can I come up of an explanation?

So I tried to make a prove by induction. By the nature of increasing number of people 1 at time, I believed that if induction works, mathematic induction is the right choice. 

The base case is easy: when there is one people, he/she is the only choice. But what about the inductive steps? There is no obvious sign of induction. So I started contemplating the numbers again.

Then I came up with one more clues:
Except when n=1, the last count being eliminated is always (n-1)*2.

And then I realized that if n results in a winner of 7, the winner of n+1 could be either 9 or 1. Up to here, I was stuck. I couldn't any process after that. So I decide to move my mind to other objects.

Dec 5

After a day of fresh air, I came back to the free-lunch problem.

I came up with a thought on subway. I can explain when exactly n will result in a winner of 1. It's actually quite easy to understand. When n is a power of 2, the winner will be 1. The reason is that in every round of elimination, because the number of people is a power of 2, the last number being eliminated will be the first number on the right side of 1, which makes 1 the first number in the next run and the count of 1 will be an odd number. So 1 will be left to the end.

So now we know what will happen if (n+1) is a power of 2. What happens if it's not a power of 2??

After half an hour of contemplating, I realize that the game will not end with a odd counting number, because the game ends when the second last number standing is eliminated and the counting has to be even. Following the logic, the counting before the last counting will be on the winner. Given that, if n people has a winner of x, then the winner of n+1 people will be the that number that counts next after x is eliminated, because the counting is shift up by 1. Given that even number cannot be the winner, the winner of n+1 will be x+2.

So when n+1 is a power of 2, the winner will be 1. If it's not power of 2, the winner will be 2n + 1 - cap(n+1) + 2 given that the winner of n people is 2n + 1 - cap(n+1)  # IH.

Let's see if it real works mathematically. 

when n+1 is a power of 2: 
cap((n+1)+1) = (n+1)*2, thus 2(n+1) + 1 - cap((n+1)+1) = 2n + 3 - 2*(n+1) = 1.
When n+1 is not a power of 2:
cap((n+1+1) = cap(n+1), thus 2(n+1) + 1 - cap((n+1)+1) = 2n + 3 - cap(n+1) = (2n + 1 - cap(n+1)) + 2.
Then, the formula holds in both cases.

Combine the base case and the inductive steps, we can conclude that when n people is playing, the (2n + 1 - cap(n+1))th person will get the free lunch.

Cheers, I have solved the problem finally!!!


Sunday, 2 December 2012

CSC236 SLOG#6

I have had a madly busy week. I have worked all day in every day of the week to get the assignments due, which makes me recall a funny incident in my statistic class. In the other day, the professor is asking when would think a bath-tub distribution occurs in real life. And then, a student answered, "the time you spend studying throughout a semester. Haha, that was good.
I have just handed in another computer science assignment tonight. Part of the assignment was asking us to describe a modification on an existing code in order to carry out some extra features. The tricky part is, it does not want us to make the modification, instead, it want us to describe it so other people can understand. Quite frankly, I found the work much harder than and more tedious than modifying the code directly. I was joking to myself maybe that's way I am in computer science instead of social science. Then I realize that codes and the language we use for proof in CSC236 are designed to be concise, uniform and unambiguous, unlike real language. When we try to convey ideas through real language, I have to make assumptions about others' knowledge, intelligence and even emotional state. More importantly, there are many ways to convey the same thing in real language; and what is even more serious is that different things can be conveyed by the same sentences. So I am still struggling between the real language and the computer language...
I am starting to solving a challenging math question that I found on the problem wiki website. The problem I am woking on is the free lunch question. It is quite interesting, and I am already making some progress. I will get it update soon.
Now I need to get some sleep, night!

Monday, 26 November 2012

Thoughts on how should you perform in school, for one who's looking for a exciting life only

Why we go to school?
Because we want a successful life.
What's a successful life?
To be rich? To be full of wonderful experience? To be peaceful and happy? ...

Sometimes I am wonder, why am I in university? If I want to be rich, I can do it without a college diploma. Steve Jobs did it, Bill Gates did it, many entrepreneurs from China did it. And then there are enough people to ensure you these examples are just exceptions; and study shows that people with a college diploma made more money on average than those don't. Then I thought, exceptions only appear to those who believe them to be exception. To the second argument, I can only say that if the contrary is true, who the hell will spending $10k to torturing themselves for 4 years?!

So then, after a flush of light, I am in fourth year ready to graduate. I ask myself, what hell have I done in the last three years? Well, I've learnt some math, accounting, financial statements, "marketing" and "organization behaviour" etc. Ok? While I haven't done any real business. Then, I go ahead ask my father that question "why am I in University, while I believe I can pretty much learn these stuffs by myself if I really want to? And you know, if I really want to learn this it would be much more efficient!" Well, his answer was that "University is some where you can not only learn knowledge, it also gives you the environment and experience that lift your life-views and ideas." Honestly, this answer is somewhat satisfying to me now. It's just I didn't know how to interpret it until now, literally now, while I am writing this. As a smart student with tons of ideas and questions, it's not arrogant to say that I have pretty much come to understand how to excel a course. If you look at my marks, they are pretty good, and I am confident to say that if I want I can get A+ for every course I take. But the ultimate problem is, some times you just don't want to learn this shit, even though you know people are generally short sighted by nature and some course might be very helpful 5 years from now. This being said, shall I excel all my courses then? Hell no, the only reason why people want to excel at every course is the people want to get a secure job in the future, well, I have to say that is what most people want. But not me.

The one thing that I have learnt or I have been born with is the idea that life is full of possibilities and I can achieve anything if I believe in it and work hard. It's not fairy tail for me since I am not a child. Even keep this in mind, I still can escape the brain wash of the Chinese education system for the first 14 years of my life. So when I was 15 even though I am in Canada, I came to believe that I should excel every course I take. Ok that's fine, people learn from mistakes. So until one day, you realize that you are staying home brainlessly in the holiday season, because you have no life, because your life is dominated by the education system...

Things start to change, I start not only focusing on study but also on altitude. I start to see so many flaws and negative thoughts I have as a person. And then, I also see so many good things about myself that I didn't care before. Recently, I came to believe one thing that altitude is everything to your everyday experience - if you feel everyday is awful, most likely that's because your altitude is awful and you can improve it through efforts.

If you are looking for a exciting life instead of a secure job after graduate, you should probably start to spend some time on something you want to work on instead of trying to excel every course...

Yes, many things to do and many things need to be improved... to be continue

CSC236 SLOG #5

After another busy week, today is Nov 26. About a school week left until examine period and winter break.

Last two weeks lecture is on languages, and language of languages. It is quite interesting. When people talk about languages, we start thinking about history and anthropology which I had taken in my high school. From my point of view, exploring language on languages is a step toward artificial intelligence, because language is one of the magical things about human being. People use language to convey so many things - ideas, feelings, facts etc. And when two people try to say the same thing, the use of different languages can lead to two totally different results. Please forgive my wandering mind. Usually computer science people are considered nerds with disadvantage on social skills, in other words, language. At the same time, computer science people are so skillful with the computer languages including some language of languages. What a interesting contradiction!?

Tuesday, 13 November 2012

CSC236 SLOG#4

I did the second midterm on last Thursday, the questions were not what I was expected. I talked to some friends in the morning session, they were getting questions on Upper and Lower bounds and proving closed form. But we were tested on the correctness and master-theorem. However, since I did my review for all materials, I am able to do most of the questions. 
The correctness proof was not challenging for the most part except the proof for termination. I know how to proof the termination, it is just that I do not know which format I should use since we never do proof of termination in lecture formally.
The second question suppose to be easier, but I made some mistake there. In part a, the "b" for master theorem suppose to be 2, but I wrote 3. My reasoning was that - "b" represents the number of pieces we divide the problem into, since we divide the problem into three parts (two parts of n//2 and one part of n%2), I figured "b" is three then. However, I talked to the professor later, who suggested the last part is not valid because it only recurses once. 
But then I was thinking should "b" depends on wether the parts are recursive? In wk7's lecture, we did an example on multiply lots of bits. It occurs to me, there are four parts recursing in the recombined equation, but we got "b" equals 2. I will great appreciate if anyone can answer me what "b" really is? I guess I will need to ask professor about this since no one really looks my slog lol.

Saturday, 3 November 2012

CSC236 SLOG #3

I have finished the assignment 2 on Friday. The assignment is not bad. When you really started working on it, it seemed much easier than the first time you read the questions. For me, the hardest thing in writing up the assignment was actually putting in the symbols and unusual parameters, such as ceilings, n_hat, theta etc. What I used to do was go to google, and search for "logical symbols". Then I would arrive to a wikipedia page, and I could copy-paste the symbols I need to my word file. However, I cannot find a copiable character for ceiling, floor, and n_hat. So, if any of you knows a way to get these notation into a word file or any text-editor, please let me know, it will be greatly appreciated.

I remember last week, I went to youtube and watched Vihart's videos about Fibonacci Sequences under prof. Heap's recommendation. It was fascinating. The videos talked about how plants and flowers naturally grow in a pattern that is basically Fibonacci Sequences or its alike. It looks like magic. Suddenly, you feel things are connected together. You realize that high-level math is not something that should be studied in another planet. I wish I could watch more videos like that that link math or conceptual stuff to our everyday lives. I hope the school teachers and professors could do this when they are teaching. 

Tuesday, 23 October 2012

CSC236 SLOG #2

So many things were going on last week, I have missed the class last Thursday. I am trying to go through the contents and catch up. The new material is kind of long and complex.
Recurrence is an interesting ideal in mathematic proofs. It's a different way of thinking comparing with the original straight forward manipulation. And in some sense, I feel like induction is mean to be used in proving recurrence problems, because the each recursive step is one step toward the base case, it's like the induction being reversed.
Another thing that is interesting is the master theorem in the end of last thursday's lecture. It's sweet to have such simple theorem that work on many recursive problems. I am trying to figure out the reasoning behind the theorem.

Monday, 8 October 2012

CSC236 SLOG #1

This is a blog that I have created for some time. I sometimes post articles about interesting thoughts that I come up with. I don't mind to put the CSC236 SLOG in the blog, since the SLOG will capture some valuable experience in the course. However, I will start the title as CSC236 SLOG to help people distinct the blog from my other blogs.

I use to write lots of blogs in other place, blog is like a diary book that you keep for other people to see. But then, I was too busy to keep writing blogs. What a shame. I think it is great we can earn some marks by just writing blogs.

Regarding the course, I have some thoughts that I want to share with you guys. In Assignment one, question 3, I got a formula by my inference:
for any set with n+3 elements, there are [(n+2)(n+1) + (n+1)(n) + ... + (2)(1)] / 2 3-subsets.
I believe the formula give same output as the combination formula we otherwise use. It's just I don't know how to simplify the formula. If you know a way to simplify the formula please let me know.