BrainFood : What to do to enhance brain power (or so they say!) – Part I

This post is not related to programming or puzzles, but is more focused towards other stimulants for our brain. This information from various sources and it is scattered all over the internet. I will try to be as precise as I can. Here we go.

Food: What you eat and drink:

Healthy food=healthy body=healthy mind. Nothing is better than a proper healthy diet with lots of green veggies and other nutritious food items out there. Below is the list which can supplement a healthy diet. They are still subject of different studies, with some saying that they are good for a healthy brain, while other studies finding no such results. I am going to go along with the studies which claim these food items to be good, because, at least, they are not harmful if taken in moderation, and have other health benefits as well.

  1. Omega-3 food source: Food rich in omega-3 fatty acid is good for memory! For vegetarians, there is choice of nuts like walnut, flax seed, pumpkin seeds etc. For non-vegetarians, fishes like salmon, sardines, trout, tune, herring, and mackerel make an excellent source. The important thing to remember is to control the size of these type of food as they are rich in fat. There is a complete article about it at wikipedia. I suggest you read it before starting.
  2. Blueberries/Grapes/Pomegranate : They are known to contain powerful antioxidants, which are beneficial for memory and clarity in thinking. Eating them in the morning is one sure way to be alert for the day, they say.
  3. Tea/Coffee/Dark Chocolate: Here is something that I love. Green tea/black tea/coffee raise alertness by the virtue of their content. While tea is renowned for its antioxidant content, coffee is well known for caffeine it contains (hence to be taken in moderation). Chocolates are good as well, but in strict moderation. It is best to avoid table sugar in all the above three: Tea, coffee and chocolate. Green tea with mint flavor is my favorite, and next is why.
  4. Mint: Our brain is affected by smells. Peppermint, cinnamon, lemon etc are towards good side of food chain.
  5. Glucose: Low to Moderate amount of glucose is good for brain and offers a short boost to memory. But large amount of it is bad..very bad for both body and brain.

Triangular and Tetrahedral Numbers

This problem comes from http://open-cs.net/problems.php?id=18

Triangular numbers can be represented by balls which can be stacked over one another to form perfect triangle. For example, 1 is the smallest such number. Then comes 3, where 2 balls can be a base, and 1 ball can come on top of them. Third number is 6, where 3 balls form the base, 2 balls come on top of that, and 1 ball is on the top. Read More “Triangular and Tetrahedral Numbers” »

Game with marbles

There is a clever game I saw two kids playing with marbles. The rules of the game were simple. Out of 17 marbles that they had in between them, they were to pick minimum one and maximum four marbles. The game involved each player to pick marbles in turn one after the other. The last person who picks the marbles wins.

If you were to play the game and make the first move, what would it be, and how would you continue to play the game?

How to run away from a zombie

Suddenly one day, you wake up to find that you are on a boat, which is at a exact center of a perfectly circular lake filled with piranhas. Moreover, at the shore of the lake stands a highly intelligent zombie, patiently waiting for you to reach the shore. Zombie cannot swim, and always runs slower than a you. But the problem is you cannot swim in the lake, and the boat is so slow that zombie can run on ground at 4 times the maximum speed of the boat in water. How do plan your escape such that when you reach the shore, the zombie is not there to catch you?

What should you do in a game show?

I will tell you a prophecy. Tomorrow, you will get a call from a game show. There will be exactly three doors and a host of the game who knows what is behind each door. Only one door will contain a mega prize, while the other two will be empty. You will have to choose one door. After you have made a choice, the host will open a door to a room which is empty. After he opens the door, he will offer you a chance to change your choice. What will you do?

After you have made you choice, see comments.

Let the numbers bounce : playing with bouncy numbers

Numbers can be classified into three groups: increasing, decreasing and bouncy. Increasing numbers are like 12345, where none of the digits to the right are less than the ones to the left. Decreasing numbers are the reverse, example 54321. Bouncy numbers are those which are not increasing and decreasing, example 54231.

For any given digit n, there are x numbers less than n, which are bouncy, and n-x numbers which are either increasing or decreasing. Let’s call this ratio (x/n-x) as bouncy ratio. For numbers less than 100, this ratio is 0. It keeps increasing as we increase n.

The problem is to write an efficient program which takes the ratio as input (say, z), and finds the smallest number n such that the ratio of (x/n-x) is z. Again, please avoid brute force.

Finding minimum number of changes in shortest time to change one word to another

This problem is simple if done via brute force method. But that is not what is expected. We have write a program to find the minimum number of changes required, in least amount of time, to change one word to another. Only one letter can be changed each time. Each intermediate word is to be a valid word, of same length as original. The program takes source and target words as input and uses one of the dictionaries found here.

The problem involves both data organization and logic to achieve results faster.

An example is to change cat to dog. The intermediate words are: cot, dot, dog.