A close relative of mine teaches Maths to school students in different Grades. During a casual chat some time ago, he mentioned that he was trying to adopt an automated approach to selecting assignment problems based on each student’s performance so far. Obviously, there are many ways in which this can be done, but he outlined one approach that he felt would be effective for him.

The basic idea is to come up with a hierarchy of * “Concepts”* (or core

*) in Mathematics, and associate one such concept with each problem given to the students to solve. The hierarchy models*

**Topics***” relationship showing how a concept*

**“depends on***one or more other concepts. Thus, each problem attempted by a student would be directly or indirectly associated with one or more concepts. When students submit their assigments or exam papers, depending on the correct/incorrect answers, it is possible to automatically infer which concepts need strengthening, and accordingly, which problems they should practise in future. A practical approach indeed.*

**“depends on”**Of course, the challenge here is to come up with a * Concept* hierarchy (in theory, multiple hierarchies are possible) and design problems to map to these concepts. This requires serious effort.

In this article, I will show how this problem can be modelled in * Prolog*. Of course, I have simplified the model to convey the core idea instead of getting bogged down in too much of detail.

Here is a simple (and partial) hierarchy:

The arrows depict * “depends on”* relationship. Thus, for example, in order to understand the concept of

*, one must be familiar with the concepts of*

**“Triangle”***and*

**“Straight Line”***.*

**“Pythogoras Theorem”**As I hinted before, this specific hierarchy might be debatable, but in general, an acceptable hierarchy can be arrived at.

How do we represent this model in * Prolog*? Here is what I have done:

The first part in the above diagram captures the concepts hierarchy. The second part assumes the existence of different problems, each mapping directly to exactly one concept. For example, the problems * “square-pblm1”* and

*both test the concept of*

**“square-pblm2”***.*

**“square”**The following * Prolog* predicates show the core reasoning logic:

Consider the notion of a particular student being weak in a concept. This is how we represent it in * Prolog*:

*A Student S is weak in a Concept C if:*

*a) There is a problem P that tests the concept C and S has solved P incorrectly*

*(OR)*

*b) The student S is known to be weak in a concept C1 and the concept C depends on knowing concept C1*

I hope you get the idea. The other predicates work similarly.

How can we recommend a set of problems for a student based on what he has solved so far? That and related logic is shown below:

I am sure you can understand the code above.

After I completed the simple * Prolog* model, I decided to build a

*-based*

**C#***application that can interact with the*

**Win Forms***engine and provide a convenient UI to show how this works.*

**Prolog**Here is one screenshot from the application:

Here, a student by name * “Diana”* has solved the

*correctly, but not the*

**“statistics-pblm”***. Based on this, the system concludes that Diana is strong in*

**“probability-pblm”***, but is weak in*

**“Statistics”***and*

**“Probability”***, and suggests the student to solve*

**“Bayes Theorem”***. The reason why the system infers that*

**“bayestheorem-pblm”***is weak in*

**“Diana”***is because the latter depends on*

**“Bayes Theorem”***and*

**“Probability”***is known to be weak in this topic.*

**“Diana”**Here is another example:

In the above case, * “Square”* is considered a weak concept for the student because, out of the two problems that exercise this concept, he got one right and the other wrong.

I hope you can understand the approach I have taken to construct this model. To implement the idea completely requires considerable effort, but I am sure it is worth it.

You can download my * Prolog* code from

*. I used*

**here***to implement the above.*

**Sicstus Prolog 4.5.1**Have a nice weekend!

## Recent Comments