Friday, June 30, 2017

My simple answer to the grandest staircase problem

For those who have heard of the_grandest_staircase_of_them_all problem, this is my simple solution. However, it is not my final solution. My final solution is an optimized version of this. The bigger the value of n, the longer this version will take, since it is recursive and the recursions become deeper and wider when n gets bigger.

def answer(n):
    def times(x, y):
        count = 1
        for k in range(x + 1, y // 2 + 1):
            if k < y - k:
                count = count +
times(k, y - k)
            else:
                return count
        return count

    counter = 0
    for i in range (1, n):
        if i < n-i:
            counter = counter +
times(i, n-i)
        else:
            return counter
    return counter

Friday, June 09, 2017

Hope is hope... not!

When my boss tells me, "I hope to see the report tomorrow," I take it to mean that I better make sure the report is on his desk tomorrow or I will find myself without a desk soon.

When the mafia boss tells his underlings, "I hope that pesky reporter has an accident," his underlings are not going to walk away and drink beer. They are going to go and fix something up to make it look like an accident.

When wife tells husband, "I hope to have ___ for my birthday," boy, he better get ___ for her for her birthday.

Hope is hope only when there is no power relationship between two persons.

Tuesday, June 06, 2017

Japan offers to work with China on Silk Road initiative

Abe offers conditional cooperation with China's Silk Road initiative

China is probably laughing at this.

The Silk Road Economic Belt and the 21st-century Maritime Silk Road, also called The Belt and The Road in short, uses the name "Silk Road" because of its historic significance. The Silk Road linked China to India and Europe in the past. This led to the flourishing of trade and culture along the route. And historically, China has held influence (big or small, depending on China's domestic situation at each point in history) over states along the route. China had always sought to maintain security along the route, for the benefit of the trade and its positive effects on China's economy.

So naming this new initiative "Silk Road" is a blatant way of saying that it is for China's benefit, and it is going to be a way for China to influence nations along the route (actually, two routes; one land, one maritime). And in the past, states not directly on the route could still benefit indirectly if they bowed down to China. Japan was no exception; when relations were fine with China, Japan was able to obtain goods from Europe and India that came through the Silk Road to China.

Make no mistake: the new initiative is for China's benefit. Not solely; if you happen to be along the route, you will benefit too. But if you are not on the route, and you want in, you will only be included if it is to China's benefit. That is to say, you can only get in if you bring something to the table that China wants (like in the old days, when vassal states brought tribute to the Chinese emperor). So unless Japan can bring something that China can't resist (maybe some of the rare metals that they just found off Chiba)... well, China will just look at Japan and laugh.

Monday, June 05, 2017

PowerPoint makes us lazy

Or at least, that's what I think.

Because in PowerPoint, we usually write in point-form, and not full sentences. And we usually only write in the key points, without filling in the details on how we arrive at them, or how they link or lead to each other. All those details are usually verbally explained during the presentation (if there is one) or simply left for the reader to figure out (if there isn't an actual presentation and only the slides are sent out.)

This is not a problem if the slides are created based on a full document, properly written with all the details on how things were arrived at, and how they link to each other, etc. The slides are a summary of the key items, and readers can (and should) always refer to the full document to get a comprehensive idea of the issue being talked about.

But it is a problem if the writer starts right from PowerPoint, generating just the slides. While the key points are there, the writer might not have fully developed the idea, might miss out important (or non-critical but important) factors or aspects that would have been explored if he had started by writing the issue out as a document (be it essay, proposal, research paper, or even just as an email). Because grammar forces us to consider the relationship between objects and subjects, think about time (past tense, present tense, etc.), and how to link things together.

Long story short: use slides for what they were meant for, as a summary of a document. Don't be lazy, write the document, then develop the slides to help others better understand the document.

Friday, June 02, 2017

U.S. leaving the Paris Climate Agreement

And there you have it.

Trump has announced that the U.S. will be leaving the Paris Climate Agreement. All because it will cause the U.S. to lose jobs.

If jobs are lost because companies are not environmentally-friendly, I think the onus should be on the companies to comply with climate rules even as they take on production. Change their methods of production, look into what they are using for raw material, you know, make an effort. It may be a bit more costly, but in everything we do, there is a cost. That's the basics of economics. Companies either bear the monetary cost of environmentally-friendly production, or society will have to bear the social cost of pollution.

Personally, I think these rules are good. They force companies to think about the environment, so that they bear the monetary cost of production, rather than passing it on as social cost to society as a whole. Companies will find ways to be profitable no matter what the rules--necessity is the mother of invention. Instead of allowing companies to grow lazy and still reap profits at the expense of the environment, we should keep these rules to protect our environment, since companies will find ways to profit anyway.

Oh well, I am not the leader of any country, so I guess what I think or say doesn't really matter. Time will tell if decisions are sound. I just hope we still have an Earth by that time.