000- Monchoka! Weekly Algos by your neighbourly scheme-r ;)

28 views
Skip to first unread message

Bonface Munyoki K.

unread,
Feb 9, 2021, 12:26:47 PM2/9/21
to nairobi-gnu

Issue 1 - Hamming Weight
Source: https://is.gd/lR9u7I
Submissions: https://is.gd/b99nd2

#### Prelude

Hi folks! In the last LUG--- atm of this writing,
there was a discussion around having community
events, and algo's and CTF's were enthusiastically
proposed. The idea was to have our community hack
on something over on (this past) Sunday, but that
unfortunately never came to be--- I guess people
never just got the bandwidth. That withstanding, I
had volunteered to take up posting an algo problem
every other week as we figure out how to make
those community events more practical; so here we
are!

I'll be scavenging for cool algos, CTFs and post
them as weekly challenges. Let's see how this
goes(I really hope I can keep this up!)

Let's take this as an opportunity to:

- explore new lang features (I've learnt quite a
bit about GUILE this way, and I hope to do so
with Rust);
- get some form of intellectual stimulation;
- prep for interviews in an enjoyable fun way; and
- <insert your awesome reason here>

PS: If you have any cool suggestions, feel free to
reach out to me on mail :)

PSS: Forgive the cheesy subject. It sounds really
nice in my head. It's origin is from some meme
that had been doing the rounds a while back. I
hope it doesn't come off as spammy(?)

#### This Week's Challenge

Write a function that takes an unsigned integer
and returns the number of "1" bits it has.

--8<---------------cut here---------------start------------->8---
Examples:
Input: n = 00000000000001011
Output: 3

Input: n = 0000100000
Output: 1

Input: n = 11111111110
Output: 10
--8<---------------cut here---------------end--------------->8---

Post your solutions as comments to
https://is.gd/b99nd2

--
Bonface M. K. D4F09EB110177E03C28E2FE1F5BBAE1E0392253F
Humble GNU Emacs User / Bearer of scheme-y parens
Curator: <https://upbookclub.com> / Twitter: @BonfaceKilz
signature.asc

Benson Muite

unread,
Feb 10, 2021, 12:43:45 AM2/10/21
to nairo...@googlegroups.com
This is nice. Maybe we can also get students involved? So far Kenya has
only participated in International Olympiad in Informatics once:
http://stats.ioinformatics.org/countries/KEN

and has not participated in ACM ICPC
https://icpc.global/

Nigeria, South Africa and Egypt tend to participate regularly in these.

Bonface Munyoki K.

unread,
Feb 10, 2021, 1:39:14 AM2/10/21
to Benson Muite, nairo...@googlegroups.com
Benson Muite <benson...@emailplus.org> writes:

> This is nice. Maybe we can also get students
> involved? So far Kenya has only participated in
> International Olympiad in Informatics once:
> http://stats.ioinformatics.org/countries/KEN
>
> and has not participated in ACM ICPC
> https://icpc.global/
>

That's a good idea. First step would be to get the
students; and perhaps some sponsorship if they
need it. Hope you don't mind my ignorance(and
laziness), but how do you apply?

> Nigeria, South Africa and Egypt tend to participate regularly in these.

signature.asc

Benson Muite

unread,
Feb 10, 2021, 1:59:06 AM2/10/21
to Bonface Munyoki K., nairo...@googlegroups.com
On 2/10/21 9:38 AM, Bonface Munyoki K. wrote:

>
> That's a good idea. First step would be to get the
> students; and perhaps some sponsorship if they
> need it. Hope you don't mind my ignorance(and
> laziness), but how do you apply?
>
Nigeria has a center that promotes these activities -
http://nmcabuja.org/csp.html

However, may be good to see how many people would participate in
programming challenges that would be eligible for these competitions.
For IOI may look at secondary school associations to see if they would
have interest in promoting this activity. In many countries, in addition
to or instead of government support, companies that develop and use
information technology solutions do sponsor such participation,
especially at collegiate level since it is one way of identifying
possible future employees. People who have participated in these
activities also tend to support them and help train others.

Bonface Munyoki K.

unread,
Feb 10, 2021, 3:38:45 AM2/10/21
to Benson Muite, nairo...@googlegroups.com
Benson Muite <benson...@emailplus.org> writes:

> On 2/10/21 9:38 AM, Bonface Munyoki K. wrote:
>
>> That's a good idea. First step would be to get
>> the
>> students; and perhaps some sponsorship if they
>> need it. Hope you don't mind my ignorance(and
>> laziness), but how do you apply?
>>
> Nigeria has a center that promotes these
> activities - http://nmcabuja.org/csp.html
>

This sounds really cool.

> However, may be good to see how many people would
> participate in programming challenges that would
> be eligible for these competitions.

I'll float this to chat and see whether there are
any students. Perhaps find a poll to see whether
this is viable?

> For IOI may
> look at secondary school associations to see if
> they would have interest in promoting this
> activity. In many countries, in addition to or
> instead of government support, companies that
> develop and use information technology solutions
> do sponsor such participation, especially at
> collegiate level since it is one way of
> identifying possible future employees.

We may also have to reach to a bunch of employers
and see how this goes. Once we figure out if
students can hack this, perhaps we could now
reach out to employers. Perhaps folks who've
sponsored LUG meet ups awhile back and see what
they have to say about it.

> People who
> have participated in these activities also tend to
> support them and help train others.
>

Ah yes! Volunteers! Have you done one of the
Olympiads before?
signature.asc

Martin Akolo Chiteri

unread,
Feb 10, 2021, 8:02:18 AM2/10/21
to nairobi-gnu, Benson Muite
Hi,

I don't know if this adds any value to the discussion. When I was in high school we had a provincial Math challenge, the (St. Patrick's) Iten Math contest [0]. A handful of top Math students in each school would be given two tough problems to solve in a weekend. After K.C.S.E, there was a clear trend that participants who did well in the challenge almost always ended up in the departments of engineering or medicine in university.

Participating in the Math olympiad would most likely open more doors to participants.

[0]: St. Patrick's day Math contest - https://www.pinterest.ca/pin/79798224623532043/

Martin.

--
You received this message because you are subscribed to the Google Groups "Nairobi GNU/Linux User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nairobi-gnu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nairobi-gnu/868s7wwc5a.fsf%40bonfacemunyoki.com.

Benson Muite

unread,
Feb 10, 2021, 8:49:07 AM2/10/21
to Martin Akolo Chiteri, nairobi-gnu
Martin,

The information is helpful. The link does not seem to be helpful, but
the Wikipedia page is helpful:
https://en.wikipedia.org/wiki/St._Patrick%27s_High_School_(Iten,_Kenya)

It is nice that such a famous school has an academic contest, and also
seems to have computers.

Some papers by Bruce Merry on what is needed for computer science
contests in high schools:
https://ioinformatics.org/journal/INFOL036.pdf
https://ioinformatics.org/journal/INFOL026.pdf

The first one discusses Linux security and the second one discusses a
three round selection process that has been used in South Africa. The
first round is a paper and pencil contest on algorithmic thinking and
math. An approach they used because not all schools could provide access
to computers. Expect internet access has broadened learning
opportunities a little more today in South Africa, but probably still
relevant for most of Africa.

There are also Olympiads in other subjects such as:
Math http://imo-official.org/
Chemistry https://www.ichosc.org/
Physics https://en.wikipedia.org/wiki/International_Physics_Olympiad
etc

On 2/10/21 4:02 PM, Martin Akolo Chiteri wrote:
> Hi,
>
> I don't know if this adds any value to the discussion. When I was in
> high school we had a provincial Math challenge, the (St. Patrick's) Iten
> Math contest [0]. A handful of top Math students in each school would be
> given two tough problems to solve in a weekend. After K.C.S.E, there was
> a clear trend that participants who did well in the challenge almost
> always ended up in the departments of engineering or medicine in
> university.
>
> Participating in the Math olympiad would most likely open more doors to
> participants.
>
> [0]: St. Patrick's day Math contest -
> https://www.pinterest.ca/pin/79798224623532043/
> <https://www.pinterest.ca/pin/79798224623532043/>
>
> Martin.
>

Martin Akolo Chiteri

unread,
Feb 10, 2021, 12:05:56 PM2/10/21
to Benson Muite, nairobi-gnu
Thanks a lot for the comprehensive links Benson. I actually looked up info on the Iten Maths contest and ended up getting some odd links to FB threads of high school students talking about a specific contest from 2015.

The other reason I sent the link was to show that the contest is not original or unique to Iten. Also, younger kids can participate in it like South Africa's junior Math division for grade 9 students and below. There have been great Mathematicians who achieved prominence in their pre-teen years. One of them is Terrence Tao Terence Tao https://twitter.com/3blue1brown/status/1154460617270415361 Others include Maryam Mirzakhani, Karl Gauss  and Lev Landau among many other child prodigies.

Including contests for other Science subjects would be great too!! Maybe future competitions could also be regional ...

Martin.
On Feb 10, 2021, at 6:49 AM, Benson Muite <benson...@emailplus.org> wrote:

Martin,

Benson Muite

unread,
Feb 10, 2021, 12:31:49 PM2/10/21
to Martin Akolo Chiteri, nairobi-gnu
Regional contests are good. Setting up these contests can take some time
though. Keeping them going consistently also requires good
organizational ability and effort. Iten has done well for this for long
distance running.

Martin Akolo Chiteri

unread,
Feb 10, 2021, 12:52:11 PM2/10/21
to Benson Muite, nairobi-gnu
I agree with you. Regional contests can be considered later, held maybe once every two - three years, if the national competitions take off.

Martin.

Benson Muite

unread,
Feb 10, 2021, 1:17:28 PM2/10/21
to Martin Akolo Chiteri, nairobi-gnu
Sorry, was unclear, setting up good contests and training can be time
consuming in general, not comparing regional and national contests.

Regional contests are often held as qualification contests for
international informatics competitions. This helps in raising the
standard of the competitions, especially in collegiate level, and gives
practice for international competitions. They are also cheaper than
international contests if travel is involved.

More motivated and knowledgeable people developing the contests helps,
though regional collaboration may require a little more effort.

Benson Muite

unread,
May 2, 2021, 12:27:32 AM5/2/21
to nairo...@googlegroups.com

Bonface Munyoki K.

unread,
May 3, 2021, 12:11:04 PM5/3/21
to Benson Muite, nairo...@googlegroups.com
Thanks for the share!

> On 2/10/21 9:17 PM, Benson Muite wrote:
>> Sorry, was unclear, setting up good contests and
>> training can be time consuming in general, not
>> comparing regional and national contests.
>> Regional contests are often held as
>> qualification contests for international
>> informatics competitions. This helps in raising
>> the standard of the competitions, especially in
>> collegiate level, and gives practice for
>> international competitions.  They are also
>> cheaper than international contests if travel is
>> involved.
>> More motivated and knowledgeable people
>> developing the contests helps, though regional
>> collaboration may require a little more effort.
>>

--
Bonface M. K. D4F09EB110177E03C28E2FE1F5BBAE1E0392253F
Free Software Activist
signature.asc
Reply all
Reply to author
Forward
0 new messages