Do you know when did Binary Search was first used?

Niraj Jain
3 min readJun 16, 2020

There are so many algorithms and data structures which makes our applications so much reliable and fast.When I studied various data structures and algorithmic approaches to solve typical problem of computation ,I feel like this are so amazing ,just by using some tricks or conventions we can get our work done.At first I thought all these algorithms where invented because of the arrival of computers in our life (to better utilize the resources),But I found some deeper roots of various approaches from which ,i am going to discuss as you may have guess i.e. “Binary Search”.

Binary Search finding element in just half the way instead of parsing whole array

From the picture you can understand,how Mr. Mario is finding its mushroom,by not traversing whole blocks ,but by just comparing and updating three elements first ,middle and last.Like Mr. Mario knows how the mushroom looks like (Size=40)and the all blocks containing mushroom are arrange in sorted order with respect to size,but he dont know where it is ,so he will compare it with middle one mushroom whose size is 30.So there he comes to know that his mushroom ,will obviously not be there before middle mushroom as blocks are arrange in sorted order .Like wise it will update its first element and find its mushroom .Though ,i am not going to talk about how binary search is implemented this you can find here https://www.hackerearth.com/practice/algorithms/searching/binary-search/tutorial/.

So ,my main motive is not to teach you binary search but yes to share something interesting about it.

This story is from Jataka Tales,back in times of Buddha , one of monk ,name Elder Losaka Tissa.Well,his father was fisherman and they where living in a fishing village (village of 1000 fisherman families).From the beginning,Losaka Tissa was so misfortune that after his birth his parents died because of some diseases.Then,he was conceived by a some fisherman wife in the village of a thousands families in Kosala.And on the day he was conceived all those thousand families, where started facing misfortune in their life too ,as all the fisherman of village failed to catch not even one single fish on that day. And that bad fortune plagued them from that day forward.

After his birth, the village was destroyed seven times by fire, and it was attacked seven times by the King’s vengeance. So in time the people fell into a woeful existence. Reflecting that it had not always been this way, and that now they were going to rack and ruin, they concluded that someone in their village was to be blame. They decided to divide into two groups. “Now this is where binary search was used first or noted first in olden text”.They did this created two groups of five hundred families each,as there where total 1000 families in village. After that, misfortune came to the group that included the of the Losaka, while the other five hundred families prospered. So the first group decided to go on dividing their group into two. They kept doing this until one family was separated from the rest. Then they knew that the cause of misfortune was in that family where Losaka was living, and they drove them away.

Because of his past life deeds ,deeds like he has prevented others from receiveing alms(alms- money or food given to poor people),as in that days monks where need to go door to door to ask for food ,but his fortune was so bad that everytime he use to go,he would return either empty handed or with insult,but at the end he was true disciple of Buddha,throughout his journey from when he become monk ,despite of so many misfortunes he has faced because of his past life deeds,he has tolerated and followed the words of Buddha and you won’t believe the man like him has attain Arahantship(fourth and highest stage of enlightenment )as per Buddhist teaching.

So,yes Elder Losaka Tissa was a perfect example of more the adversity more you grow!

But the take away is Binary Search was used at that time,i think so 5000 years ago?(estimated). To find who is the one causing bad fortune to the whole village.

This is my first step to connect Computer Science with our Roots.Please let me know how do you like the blog.Thankyou!

--

--

Niraj Jain

Niraj Jain is Full Stack Developer,Backend Developer,speaker,writer. Learn UnLearn ReLearn <-