Frog puzzle to cross the river


A frog wants to cross a river that is 11 feet across.

There are 10 stones in a line leading across the river, separated by 1 foot. He can either jump to the next stone or jump over a stone, and if he jumps over a stone he must land on the next one. The furthest he can jump is 2 feet. Also, he always moves forward (toward the other side of the river). In how many different ways can he cross the river?

For example, one way to cross would be 1,2,2,1,1,2,1  with representing the frog moving 1 foot forward to the next stone, and representing the frog jumping over one stone, moving 2 feet forward.

The total distance jumped must be 11 feet; that is, if the frog is at 10 feet, the frog can’t jump by 2 feet.

Hint: What are the possible conditions before getting to the stone?

Bonus: Try to come up with a recursive routine to calculate this value for  stones.


Correct answer: 144

To get to (n+2)th stone, he could either come from (n+1)th  stone or nth  stone. For instance, the frog can either get to 5th  stone from 4th  stone or from the  3rd stone.

Let’s examine what this means with a few smaller examples. If there is one stone, then the frog can either jump on it, or jump over it:

Option 1 Stone
1 On
2 Over

If there are two stones, then the following options are available:

Option 1 Stone 2 Stone
1 On On
2 On Over
3 Over On

There are only 3 options, because the frog cannot jump over two stones straight to the other side. At most his jumps take him 2 feet forward.

If there are three stones, then the following options are available:

Option 1 Stone 2 Stone 3 Stone
1 On On On
2 On On Over
3 On Over On
4 Over On On
5 Over On Over

There are 5 options.

This is actually enough to start seeing a pattern. The number of ways to get to the 3 stone is a3 = a2+a1  or 5 = 3 +2 . If you continue with 4, 5, 6, etc. stones, you’ll find that this pattern continues. So, the number of ways to get to nth   stone is an = an-1+ an-2 or the famous Fibonacci numbers.

With this formula we can predict the 11 stone as the 11 term of the Fibonacci sequence,


Simple algorithm for fibonacci series:

def fibonacci(n):
        if n < 0:
                raise ValueError("invalid index!")
        if n==0:
                return 0
        if n==1:
                return 1
        return fibonacci(n-1) + fibonacci(n-2)

What are useful social skills that can be picked up quickly?

What are useful social skills that can be picked up quickly? by William Beteet

Answer by William Beteet:

  1. Speak Loud and ClearMake it easier for people to hear what you have to say
  2. Show Your Teeth When you SmileIt looks better and genuine
  3. Make StatementsThey are more fun than questions
  4. Always Finish Your SentenceDon’t let people interrupt you
  5. Laugh When People are FunnyDon’t hold back, it makes them feel better
  6. Act Like Everyone is Your FriendIt makes it easier to make friends
  7. Talk About a Meal You ate Earlier That Day People love talking about food
  8. Tell Great Stories About the Mundane People love hearing great stories that’s why we watch sitcoms. (Modulate your tone and use your hands to tell the story)
  9. Be Cocky but Make fun of Yourself Makes you interesting and fun
  10. Share Intimate Details About Yourself Makes people trust you faster
  11. Call People out for Being RudeA simple “Not cool” works wonders for bad behavior
  12. Tell People What You Like About ThemIt can make their day
  13. Talk About the Taboo – It leads to more interesting conversations and makes you memorable
  14. Ask Fun Questions – What did you eat for breakfast? Always leads to a great conversation
  15. Saying “I ran out of things to talk about” – Is sometimes the best thing to talk about.
  16. When in Doubt Talk Loud It tricks your brain into becoming more comfortable

If you want to hear some of my conversations check out my podcast!
The Lazy Philosopher

What are useful social skills that can be picked up quickly?

Do people get tired of learning how to code?

Do people get tired of learning how to code? by @WebDev_Cave

Answer by Ayoub Nejjari:

Please Don’t quit!

It’s very normal to get tired. It’s very normal to get frustrated, feel sick, have headaches, and want to quit. maybe you’ll feel bored sometimes. But Just Don’t! If you feel tired then that means you are putting efforts and doing your best which is a very good thing! Work isn’t fun, if it’s not tiring, then we shouldn’t call it WORK, right? Especially if you don’t have a passion for it, but that’s not a reason to quit, and I’ll tell you why:

First, Great things never come from Comfort Zone. It’s always hard to push yourself to the next level, because it requires something more than your usual. It requires additional efforts and energy, which tires us physically and mentally, but don’t think about that. Think about the result, think about the achievement, you’ll be in the next level, you’ll take a step towards the top, no matter how small it is, It is still a step!

Second, programming and software development can be very exhausting even for the very experienced gurus in the field, you should know that, this is how it works, it is always challenging, after all it’s all about problem solving, right? Especially, because you are expected to come up with the best solution possible. You should be comfortable with tiredness and exhaustion. 😉

Thirdly, This thing isn’t about smartness. It’s about practice, and the more you practice the concept the easier it will be for you. Also, it’s very normal to find something hard to get the first time you run into it. That’s something inevitable. You need a proof? Try to read about something new with total focus, even if you don’t understand it. Then, try to read it a second time.I am so sure that you will find it easier than the first time, and many things will make sense this time. Try to google the terms you don’t understand. Then come back, read it the third time. Try that and tell me! 😉

Let me give you some advises!

  • Don’t work alone, always work in a group if you Can
  • Train yourself to work with discipline not motivation! Motivation is not reliable trust me!
  • Always try to understand new concept using different resources, that will help seeing the concept from different perspectives which will help you better get it.
  • Frustration, boredom, tiredness, exhaustion, are all normal, very normal, they don’t indicate that you are not the right person for software development, They Say You are putting Effort and doing your best!
  • Practice, and Always ask! believe me Quora and Stack-overflow are my best friends, and there are always people who are willing to help, you can get the best answers to your questions with them! I remember reading two books to understand a concept related to computer networking, I couldn’t get it, and it took me writing one sentence asking about it here in Quora, after 4hs, I felt like I am the happiest man on earth.

Please Don’t Quit! You’re in the right path!

Do people get tired of learning how to code?

Mobile payment in India

What is payment actually? How peoples usually pay money in ancient times? How the evolution of mobile payment takes a major impact in the current world?

In the ancient times, people usually exchange their goods mutually and share the things they used to produce in the fields. As days passed they started to use golds, copper coins, and paper money. Now in the modern world, the huge exchange of currency happens through the secure platform through banks. But as days passed by the late 90’s the evolution of mobile payment become a key role in the today’s society.
What is mobile payment?
The payment means paying a certain amount of money to someone for buying something or for certain cause. Then what is mobile payment? It is nothing but the mode of payment happens through mobiles, instead of using traditional cash system or cheques or cards. A person can send money to buy goods just by tapping his fingers on his smartphone.

How is it applied in India?
In India, the mobile payment is mostly bank led which means the user needs to register his bank to provide to provide the service, mostly which is called as net-banking. Mobile Payment Forum of India(MPFI) is the umbrella organization which is responsible for deploying this mobile payment.

Growth of mobile phones in India
India is the second largest telecommunication market in India which it crosses more than a billion usages. The evolution of smartphones for past decade is increasing at a boom. It is quite easy to see the people in the villages to use smartphones and checking WhatsApp.

Introduction of mobile payment to India
On November 22, 2010, National Payment Corporation of India(NPCI) launched Immediate Payment Services(IMPS) to offer an instant 24-hour×7, interbank electronic fund transfer service through mobile phones. It offers the features of instant money transfer, 24×7, 365 days services, simple and easy to use and fast, inexpensive services. To use IMPS, there should be a bank account and the 10 digits mobile number. The mobile number should be registered in the particular bank to enable payment services.

What is the latest project of NPCI?
NPCI recently developed a mobile app named BHIM named after Bhim Rao Ambedkar. BHIM stands for Bharat Interface for Money which was launched by Narendra Modi, the Prime minister of India. It is initiated to facilitate e-payments directly through the bank by one’s smartphone as a part of 2016 Indian bank note demonetization.

BHIM – Unified Payment Interface
It is based on the Unified Payment Interface(UPI). This app supports all banks in India and it instantly helps to transfer money based on the Immediate Payment Service(IMPS) infrastructure and allows the user to instantly transfer money to any users.

Where is all this Bhim app acceptable?
1.Online Shopping websites(Flipkart, Paytm, Snapdeal etc.)
you can pay through BHIM app on Online shopping websites, in the payment section choose UPI option just insert your VPA address and click to payment process now open BHIM app in your mobile, accept payment inserting MPIN.

2. STORES OR SHOPS- You can pay in the stores and shops if an owner is accepting payment through UPI.

you can pay through QR code scan, mobile number, VPA address.

If you use UPI, OR BHIM app for payment then maybe you can win prizes under the government scheme Lucky Grahak yojana.

Why words matter?

Words!! From the ancient period to the modern world, from the early man to modern people, from the ancient scripts to the modern WhatsApp emojis, the one thing is still unchangeable, it is nothing but the words. The style and fonts of the words change periodically with the evolution of time, but it uniquely conveys something to the world.
A proverb, “A Pen is mightier than Sword” clearly explains the power of words in this world. Words are nothing but the facts that conveys something to the society. A positive word becomes the vibrations and inspirations to the person and the negative words become threats to the person.
There is a saying that “Our mind is the best servant but worst master”. The words that arise in our mind also follow the same. One of greatest Tamil poet and the philosopher, Thiruvalluvar, has literally narrated the power of words in just seven words.
“When pleasant words are easy, bitter words to use, Is like, leaving sweet ripe fruit, the sour unripe to choose.”
Words have the power to create an impact in the readers or the listener’s mind. According to the butterfly theory, the butterfly wings has the power to cause the hurricane in China. Then what about our words? Words are an extremely super power which should be handled with care.
The deadliest weapon is nothing but one’s tongue. It has the most supernatural power to kill the person instantly. Words spoken from a podium must be heard. Jokes cracked in private must be ignored.
In the famous water crystal experiments conducted by Dr. Masaru Emoto, words were shown to have a transformative impact on a molecular level. Words like JOY, LOVE, GRATITUDE were taped on water containers. Then the water was frozen into crystals that, when observed under a microscope, looked like beautiful and uniquely patterned snowflakes. But when words like HATE or FEAR were used, the crystals were disfigured, asymmetrical, or unformed.
Even the crystal shapes become beautiful while using smoothly. Then you, not our human life? Try to use the power of words as because of word matters!!!
Ramya Chinnadurai

What are some must know tricks and hacks in life?

What are some must know tricks and hacks in life? by Nisarg Soni

Answer by Nisarg Soni:

Here are some hacks:

  • Get the WiFi password to almost anywhere by checking the comments on Foursquare.
  • Placing an envelope in the fridge for an hour will unseal it. A good tip to know if you forgot to include something.
  • Drinking two cups of water before meals can make you lose an average of 4.5 more pounds within 12 weeks than if you don’t.
  • Mosquito bite? Press a HOT spoon onto the bite. The heat will destroy the chemical heat caused by the reaction and the itching will stop.
  • Solve “spot the difference” puzzles instantly by crossing your eyes. The differences will appear immediately.
  • Don’t know what to get someone for birthday? Have them make three guesses of “what you got them”. BOOM, three things he/she wants.
  • If you ever have to park in a city at night, park in front of a bank. Why? They’re lit up and have cameras everywhere.
  • To clean a microwave: Put a bowl of water inside and microwave for 3 minutes. The steam will moisten everything up making cleaning simple!
  • Hold the floor number and door closing number at the same time while riding an elevator to skip all of the other floors.
  • If someone hands you gum and you want to know if it is sugarless, fold it in a half. Sugarless gum will break, but normal gum will just bend.
  • If you drop an earring, ring, or small screw simply turn off the lights and look with a flashlight. They’ll light right up.
  • On camera, wearing yellow makes you look bigger and wearing green makes you look smaller.
  • Exhale when your left foot hits the ground to avoid cramps while running.
  • To stop yourself from vomiting, eat a mint/chew minty gum.
  • Struggling to grasp a concept at school/work? Try Googling the subject with “site:edu” and “type:ppt”. This will give you power-point presentations on the given subject from universities.
  • Have a good 20 minute work out in the morning. Then you can be lazy for the rest of the day, and you won’t feel guilty!
  • Sugar can cure a burnt tongue.
  • Putting your phone on airplane mode will stop ads while playing games.
  • Wrinkly shirt? Throw it in the dryer with a few ice cubes for 5 minutes. Wrinkles gone.
  • A cure for headaches: Take a lime, cut it in half, and rub it on your forehead. The throbbing should go away.
  • If a disk is skipping, rub a banana over it to seal the scratches. Remember to wipe it off before you stick it back in.
  • Need to tell a believable lie? Include an embarrassing detail, nobody doubts a story that makes you look dumb.
  • Getting nauseous from reading in a car? Tilt your head side to side and it’ll go away.
  • If you have a tough decision flip a coin, not to decide for you, but you’ll realize what you really want when it’s in the air.
  • Lick your wrist and smell it. This is what your breath smells like to others.
  • Put that you were Time’s 2006 person of the year on CV. in 2006, Time made “Everyone” the person of the year.

EDIT- adding some more:

  • To convert Celsius to Fahrenheit, double the Celsius number and add 28.
  • Life tip: If you have to yell, you already lost the argument.
  • When trying to look for percentages (eg. 40% of 300) drop the 1st digit of the number and multiply by the 10s digit of the %(4 * 30 = 120).
  • Simply touching money has been proven to reduce physical and emotional pain.
  • If you peel a banana from the bottom, you won’t have to pick the little “stingy things” off of it.
  • If a man takes a pregnancy test and it comes back positive, he may have testicular cancer.
  • Buying something from Amazon? Buy it on Part of the proceeds go to a charity of your choice.
  • On you can put in everything on your shopping list and it will give you coupons for each item.
  • Sleeping on your right side helps you fall asleep faster than sleeping on your left side.
  • Always feel tired even after getting a good, long sleep? You’re probably dehydrated, drink some water right when you wake up.
  • Having trouble falling asleep? Try the 4–7–8 technique: 4 second inhale, 7 second hold, 8 second release, and repeat. It really works.

What are some must know tricks and hacks in life?