Tag: education

Sample Programs for Teaching Programming in Kannada

Yesterday, I was asked to explain Arduino concepts to a group of teachers from rural schools in Karnataka at a workshop.

So, I created a set of slides and a set of illustrative computer programs in Kannada.

I was really keen to hear what the teachers had to say because I had been extremely apprehensive about whether anyone would be able to type software in Kannada (the standard keyboards available in India are ASCII keyboards labelled with Roman letters).

So, at the beginning of the class, I asked the teachers whether they could type Kannada using ASCII keyboards.

They said that they could.  They said that they were used to typing using Nudi or Baraha software (that allows one to type Kannada using a Roman alphabet keyboard).

Since I didn’t have Nudi or Baraha installed, I showed them how Google’s Input Tools worked, and they liked them very much (those with laptops insisted that I install Google Input Tools for them after the lecture).

Apparently, all the teachers could type using a Roman keyboard.  They could also all speak some English.

But their level of comfort with English was low when it came to reading and comprehension.

This group of teachers said they found it much easier to read Kannada than English though they typed Kannada on a Latin keyboard.

And they said that for that reason (ease of reading and comprehension), programming tools in the Kannada language would be useful to them.

Acknowledgements: The workshop yesterday was organized by Workbench Projects.  There had been a similar workshop at ArtScienceBLR on March 29th.  So, anyone wishing to learn to program Arduino boards in Kannada can contact either of these organizations.

You can download and explore the Indian language tools from here http://www.aiaioo.com/arduino_in_local_languages/download and the commands are listed here http://www.aiaioo.com/arduino_in_local_languages/index.php.

Below are screenshots of some of the programs:

  1.  Storing an Integer in Memory and Reading it Back


2.  Adding Two Integers


3.  Dividing Two Real Numbers


4.  Logical Operations


5.  Conditional Transfer of Control


6.  Repetition

For Loop


While Loop


7.  Electronics


Visit Aiaioo Labs

Programming in Hindi and Tamil in addition to Kannada

For children who are taught computer science in Indian languages, conventional software programming can pose a challenge because most programming languages use the Roman alphabet.

We’ve created a way to allow students and teachers to write Arduino programs in Indian languages (at the request of Arduino India).

Arduino boards can now be programmed in Hindi and Tamil in addition to Kannada (as already described in an earlier post).

The Indian language extensions can be downloaded from our website.

These are the words used as replacements for English words: http://www.aiaioo.com/arduino_in_local_languages/

The website allows one to comment on and discuss the keywords picked as replacements for English words.

There’s still a lot of work to be done on the choices.

Very specifically, we’re looking for ways to simplify the words so that school children will find them easier to remember and type.

Any ideas for facilitating the learning process for children would be very welcome.

Illustrative Example

For example, we used to translate analogWrite as “ಅನಂಕೀಯವಾಗಿ_ಬರೆ” in Kannada, (“अनंकीय_लिखो” in Hindi and “அனலாக்_எழுது” in Tamil) using the coined word ‘anankiiya’ (negation of ‘ankiiya’ meaning digital) or the transliteration of ‘analog’.

However, during a discussion, a physicist who helped with the Kannada (thank you, Padmalekha) suggested that we use the phrase “write without spaces” for analogWrite.

And then it hit us that we could just use the phrase “write value” for analogWrite and “write number” for digitalWrite.

The following translations for analogWrite: “ಮೌಲ್ಯವನ್ನು_ಬರೆ“, “मूल्य_लिखो” and “மதிப்பை_எழுது” are much more intuitive.

The new translations for digitalWrite are also just as easy to comprehend: “ಅಂಕೆಯನ್ನು_ಬರೆ“, “अंक_लिखो” and “எண்ணை_எழுது

The process of simplification is an ongoing one, and we hope in a few months’ time to have a generally agreed-upon set of translations, after taking everyone’s inputs into consideration.


The Arduino IDE with extensions now supports syntax highlighting in Indian languages. This makes it easier to program in the local language.

This is how Kannada code looks:

Kannada Code


And here is how it looks in Hindi and in Tamil.

Hindi Code


Tamil Code


Visit Aiaioo Labs

O(log n) algorithm for education

The amount of time required to train a certain number of students in some skill is usually proportional to the number of students.

In this post, I wanted to talk about a process for training people using ‘social networks’ that can work much faster and better.

The method was developed by a social start-up called Digital Green from Bangalore.

Digital Green’s mission is to educate farmers and help them improve their farm yields.

There are about 263 million people in India who depend on farming and many of them are illiterate and uneducated.

Therefore, education for farmers, if done right, can make a real difference.

Government agricultural research institutes have, for a number of years, been evolving farming best-practices, and trying to educate farmers on the same.

The government’s method of choice for educational initiatives is rural field officers who do the rounds of the villages.

But the process is often ineffective in driving change on the ground.

Digital Green discovered the reason for that.

It turned out that farmers were hesitant to abandon or change practices that had worked for their ancestors for thousands of years.

They were finding it difficult to trade time-tested ways of doing things for new methods.

Digital Green discovered that what farmers found more convincing was recommendations from early adopters from nearby villages.

They were less resistant to ideas from persons they knew.

So, Digital Green went about using their insights to change how education was delivered to farmers.

They started by constructing a social network without computers.

They made video CDs of early adopters engaging in a farming practice that needed to be promoted.

They then mailed the CDs to nearby villages – in each of which television and video equipment had been installed – and showed the videos to people there.

The farmers watching the videos would see familiar faces, places, soils and crops, and might also be tempted to adopt the practice in order to be able to star in the next video.

So, the practice would spread virally, from one early adopter to his connections, and from them to their connections, and so on.

This model of training is very similar to the model of information dissemination in social networks. Like in many other forms of viral transmission, the amount of time it takes to reach out to a certain number of people grows logarithmically with the number of people. In other words, it scales very well.

So, Digital Green’s approach is an O(log n) algorithm for education.

The following BBC article on Digital Green contains an interview with its CEO Rikin Gandhi:  http://www.bbc.co.uk/news/technology-23867132

You might also like this article we wrote in 2012 on another O(log n) algorithm for educating large numbers of people:  Is there an algorithm to combat poverty?

Algorithms to combat poverty

Causes of Extreme Poverty

An excellent study of poverty and its causes may be found in a book by the name of “The End of Poverty” by Jeffrey Sachs.

One of the examples that Jeffrey uses to explain the phenomenon of extreme poverty is a family farming a plot of land that is too small to feed it.

Because the plot is too small to even feed the family, there is no excess food to sell, and consequently, no way to build up any savings.

Without savings there is no way to make any investments that could result in more crops (like fertilizer) or in developing other skills (like education).

So, a family on a very small plot of land ends up trapped in a cycle of poverty – one that it cannot escape the cycle without external aid.

Extreme Poverty in India

Could such a scenario ever materialize in India?  Could a family ever come to have so little land that it does not suffice for its own needs?

It seems so.

In India, by tradition, land is divided equally among children.  So, as the population grows, the average size of land farmed by a family decreases.

The danger is also difficult to spot ahead of time.

When a person inherits a plot of land too small to support a family on, (s)he is usually already an adult and it is too late for him/her to leave farming for another profession.

That is a model that could explain both the huge disparities in income and the widespread poverty that exist in India.

In some other parts of the world, land holdings are inherited by only one child of a farmer, usually the first-born.  The other children need to “go out into the world” to “earn their fortune” by becoming apprenticed to a tradesman, or by becoming a soldier, or by entering the priesthood.

In such a system (which is called primogeniture), there is a built-in safety mechanism that guards against the danger of  land holdings becoming too small for a family.  In each generation, the land only feeds as many people as it did the generation before.  So, there is always a guaranteed surplus of money with which to pay for the training of other children into other professions.

With the Indian system of inheritance, on the other hand, all of the children of a well-off land-owner could find themselves inheriting holdings that are too small, at a time when they are too old to go back to school.

Whatever be the cause of the problem, it seems reasonable for us to assume that as of today, there are around 400 million people living in abject poverty in India because they have plots of land so small that they cannot feed a family, and no skills other than that of a farmer.

Education as the Solution

One solution to the problem would be some form of retraining to equip the 400 million people with skills that would enable them to obtain alternate employment (by that I mean just anything that does not include laboring on a farm).

The government admits that between 300 and 400 million people in India are illiterate (they cannot write or read).  The number of the innumerate is probably far higher.

The most straightforward solution seems to be to pool some money and set up a number of schools for people in rural areas, staffed with teachers.  Supposing we knew what to teach and were able to find the teachers, would we have solved the problem?  Let’s do the math (starting with some assumptions).

Assume we have 1000 teachers, and that each of them can teach a class of some 100 pupils.

Assume further that it takes 3 years to train a person into a new profession.

With this setup, how many years will it take to retrain 400 million students?

The answer is …

12,000 years.

Now that must come as a shock to some.  What if we instead had 100,000 teachers?

It would still take us 120 years, not counting the time it would take to train 100,000 teachers.

Lack of Government Investment in Education

We played a bit more with the numbers to see what would happen if the government doubled the annual allocation for education.  The allocation for education in 2011 was 11 billion dollars.

For another 11 billion dollars, the government could hire just around another 1 million teachers (assuming an annual salary of around 5 lakh rupees per annum) and solve the problem in around 12 years (not counting the number of years of training the teachers would need).

In fact, the total allocation for education across the board in India has been of the order of 3.5% of GDP.  Most Western countries, with far higher per-capita incomes than India, allocate approximately 8% of GDP to education.  India in reality needs to allocate somewhere close to 10% of its GDP to education.

And just as a digression, every time you read in the news that the Indian government is about to import military equipment for between 5 billion and 11 billion USD – Dr. Manmohan Singh’s government paid that sort of money for Sukhoi fighters in 2011, for an aircraft carrier and planes for it in 2012 and for 10 military transport planes in 2013, while Mr. Modi’s government paid a similar sum for six submarines in 2014, and for 36 fighter planes in 2015 – take a moment to pause and think about the amount of money that is being misspent, because that money is comparable to the federal education budget of India, and a better use for that money would have been education.

So, one obstacle in the way of prosperity in India, is that the government of India refuses to spend the money collected as taxes from Indians on education for Indians.

The Difficulty of Skills Planning

Another problem is that appointing more teachers may make people more literate, and even numerate, but not necessarily more employable.

The reason is that the skills that make a person employable are not just basic reading and writing skills.

Higher skills that would enable the students to earn money – perhaps engineering skills or a craft (a friend of mine recently helped out with a government program that taught web development skills at scale) – would be needed.

One problem with a brute-force approach is that there would be no feedback from the market in the beginning as to what skills would be needed and in what quantities.

An investment would have to be made blindly in teachers equipped to teach certain skills, and it would only be decades later that we would know if we had picked the right skills in the right quantities.

So, there is a chance that this method wouldn’t work out very well for the students in terms of equipping them with marketable skills.

Apprenticeship and Skills Development

But is there another way to skill up such a large number of people?

Well, it turns out that there is.  And the method was used in Europe for hundreds of years.

It is called apprenticeship.

Consider a system where one person trains a small number of people, say 10 people, and each of them in turn trains another 10 people.    Assume further that these ten trainees work for the trainer and get paid while they are being trained.

This is how people learnt a trade in Europe for hundreds of years.

Under this model, if each person trains only once and then needs train people no more, 1 becomes 11 in 3 years.  11 becomes 111 in another 3.  111 becomes 1111 at the end of nine years.  In about thirty years, all 400 million people would have been completely retrained, with no massive initial financial investment and with market forces deciding at every stage what skills might be needed most in the coming years.

So, you have an algorithm that can reskill a large number of people at scale in about 30 years.

The Complexity of an Algorithm

Why does one method work so much better than the other?

The brute-force method of skilling people (using traditional schools and a large number of teachers) is what we call an algorithm of complexity O(n).

What that means is:  should the size of the problem double, the time to solve the problem also doubles.

Apprenticeship is what we call an algorithm of complexity O(log n).  In an algorithm of this sort, when the size of the problem grows exponentially, the time to solve the problem only gets multiplied by the exponent.