Tuesday, 25 March 2014

#FLMobiGame: Introduction to solving complex problems

Introduction to solving complex problems

So far we’ve looked at solving simple problems using conditional and looping constructs. But what if there is a complex problem where a combination of conditional and looping constructs have to be used? Or, multiple conditions and multiple looping constructs have to be used? In this tutorial we’ll cover how to tackle some of these problems by applying what you have learnt so far in the course.
Consider a grading system with four different grades: A, B, C and D - where A is the highest grade and D the lowest. The system of grades is defined as shown below:
GradeMarks
Amarks > 75
B50 < marks <= 75
C35 < marks <= 50
Dmarks <= 35
The algorithm to determine the grade when a mark is given should go something like this:

  • Line 1: Begin
  • Line 2: Check marks
  • Line 3: If mark is greater than 75 then Grade A
  • Line 4: Otherwise,
  • Line 5: if mark is greater than 50 but less than or equal to 75, then Grade = B
  • Line 6: Otherwise,
  • Line 7: if mark is greater than 35 but less than or equal to 50, then Grade = C
  • Line 8: Otherwise, Grade = D

  • Line 9: End
This algorithm has several conditional statements. First it needs to be checked whether the mark is greater than 75. If the mark is not greater than 75, there are many possibilities. So there are two more conditional checks within the ‘Otherwise’ part of the first conditional statement. Because these conditional statements are inside one another they are described as ‘nested’ conditions.
Implementing this in a Java program using ‘if’ statements would look like this:
int mark;
String Grade;
if ( mark > 75 )
 Grade =  "A";
else {
 if ( (mark <= 75) && (mark > 50) )
 Grade = "B"; /*in the above condition you do not need to check (mark <= 75) as we only get to this point if it is so. We have shown it here for clarification*/
else {
 if ( (mark <= 50) && (mark > 35) )
  Grade = "C"; /*similar to previous condition check we do not need (mark<= 50) here as execution gets here only if that is true*/
 else
  Grade = "D";
 }
}
Now can you improve this program to check whether the value of ‘mark’ is non-negative? Not greater than 100?
To check the non-negativity you will have to add an additional conditionif ( mark >= 0 )
To check whether the mark is less than 100 you will have to add another condition if ( mark < 100 )
But if you want to make sure the mark is non-negative AND less than 100 you can use this condition:
if ( ( mark >= 0 ) && ( mark < 100 ) )

Nested looping

Here’s an example of nested looping: Suppose we have the marks for a class of four students and we want to sort these into ascending order. An algorithm can be used to design a program to do this.
First, you need to identify the steps required to rearrange the marks into ascending order.
The array, representing the marks of the four students, should start out like this:
070
160
226
39
After sorting the elements into ascending order the array should look like this:
09
126
260
370

Pass 1:

070
160
226
39
Step 1: Compare the element at index 0 with element at index 1 (in this example 70 and 60). Then swap them over to sort the two values in ascending order.
060
170
226
39
Step 2: Compare the element at index 1 and index 2. That is 70 and 26. Now switch them around.
060
126
270
39
Step 3: The element at index 2 is compared with element at index 3. That is 70 and 9. Because 70 is greater than 9 you will have to swap them over.
060
126
29
370
At this point the largest value of all has reached its correct position. So in the next pass you don’t need to compare the last element.

Pass 2:

060
126
29
370
Step 1: Compare the element at index 0 with the element at index 1; 60 and 26 and swap them over.
026
160
29
370
Step 2: The next comparison is between the element at index 1 and the element at index 2; 60 and 9. Swapping is done to achieve ascending order.
026
19
260
370
At this point the next largest value (60) has also reached its correct place in the sequence.

Pass 3:

026
19
260
370
Step 1: the elements at index 0 and 1 ( 26 and 9 respectively) are compared and swapped.
09
126
260
370
The marks are now arranged in ascending order, so no more swapping is required.

Implementing nested looping

Two loops (nested loops) can be used to implement this program.
First, these values need to be stored in the program. The marks are whole numbers between 0 and 100, so you can choose from shortint orbyte as the data type. The byte data type requires the least memory and, as it is sufficient to store this range of numbers, it would be the best choice here.
Four separate variables could be used to store this data, but this would be cumbersome. Because this data is of the same type, a single array can be used to store all of the marks. This would also allow this particular program to be easily reused for classes of different sizes.
‘n’ number of elements will be needed in the array where the ‘n’ is equal to the number of students. A byte array called myArray can be used to hold these values:
for (int index1 = 0; index1 < 3 ; index1++) {
  for (int index2 = 0; index2 + index1 < 3 ; index2++){
    if ( myArray[index2] > myArray [index2+1]){
      /*this means we need to swap the two elements*/

        byte tempValue = myArray[index2];
  /*store myArray[index2] in tempValue variable*/

  myArray[index2] = myArray[index2+1];
  /*assign myArray[index2+1] value to myArray[index2]*/

  myArray[index2+1] = tempValue;
  /*now assign myArray[index2]’s original value that was temporarily stored in tempValue to myArray[index2+1]*/

      }/*end of if section*/
    }/*end of for with index2*/
}/*end of for with index1*/

Pass 1:

index1 = 0 (Throughout Pass 1, index1 is equal to ‘0’)
index2 = 0
060
170
226
39
index2 = 1
060
126
270
39
index2 = 2
060
126
29
370

Pass 2:

index1 = 1 (Throughout Pass 2, index1 is equal to 1)
index2 = 0
026
160
29
370
index2 = 1
026
19
260
370

Pass 3:

index1 = 2
index2 = 0
09
126
260
370
The program has finished executing and the marks are now in ascending order. By creating an algorithm first each of the steps that were required to sort the marks into ascending order could be identified and a program could be created that performed these steps.
This sorting problem uses two nested for loops. It also has a conditional statement within a loop. These constructs can be used in a wide range of combinations to solve different types of programming problems.
When you use nested constructs it is a lot easier to make mistakes. When programs are not producing the desired output, you can use a debugger to check through the code to find where it is going wrong.

Wednesday, 19 March 2014

#FLMobiGame - Week 4 - Exploring Massive Open Online Courses

The University of Reading has several exciting free online courses coming up (see here). Also our School (Systems Engineering) is considering couple of online courses and I am a member of the project board supporting the development and delivery of new online courses. I am taken by the idea of a course that will include making a robot!  I have already volunteered to be a tester for the course, who would not want to be a tester for an awesome course like that?

Photo: By Saad Irfan from http://farm5.staticflickr.com/4035/5168814511_2e387e26be_b.jpg


We have some ideas for research surrounding MOOCs, which I thought I'd share with our FLMobiGame participants on my Week 4 mid-week email.

Community Building around a MOOC is a topic that I have been interested in. The small team of educators and mentors in a MOOC (such as FLMobiGame) rely on community support to a large extent in facilitating the course. In FLMobiGame 2nd run we are very lucky to have some 'FLMobiGame run 1 alumni' here helping us. We have also seen some fantastic support from our 2nd run participants in the course. Some of them are experienced in programming while some are beginners. Together as a community we are supporting each other in the course.

We have already done some work exploring what is considered "dropout" from MOOC participant's perspective and our paper Dropout: MOOC Participants' Perspective was presented last month (February 2014) at the 2nd European MOOC Stakeholders Summit in Switzerland. We have identified various scenarios of 'dropouts' from our previous work and we are looking to improve our understanding on this too Here is the link

Another interesting thing that we observed from Reading MOOCs is that the engagement patterns of MOOCs in different disciplines vary widely. For example, the engagement patterns of University of Reading's Beginner's Guide to Writing in English and Begin Programming courses are very different. It would be interesting to explore these differences.

Please feel free to share your thoughts and if you want to support our research please leave a message we will get in touch. :)

Saturday, 15 March 2014

#FLMobiGame: Linking to a Post on FutureLearn Forums


At the moment FutureLearn does not provide functionality to search forums other than the browser search facility. So there are difficulties to locate useful posts in the forums.
As a remedy we have asked our participants to 'like' the post if they found it useful. So that by sorting on likes, useful posts can be found.

I see that in many posts participant's say "I found XXX's post useful" but unfortunately without the ability to search this does not help much. So I thought of doing this blog to show how to provide a 'link' to a useful post in the forums.

(Edit: 1st June 2015)
This is what you can do:

1. Right-click on flag mark  below the post that you want to link to (shown below)
Right-click on flag


2. Now select 'Copy Link Address' from the pop-up menu

3. Paste the link on to the comment you are making
Paste the copied link to your post

4. Now delete the bit at the end of the link that says '/moderation_reports/new'.
Remove '/moderation_reports/new' at the end of the address URL
5. Now post your comment and it will have a link to the post you wanted to link to.

Wednesday, 12 March 2014

#FLMobiGame - Karsten Lundqvist wins Technological Innovation in Teaching Excellence Award

We all are delighted that our colleague, #FLMobiGame lead educator, Karsten Øster Lundqvist won 'Technological Innovation in Teaching Excellence Award' for his effort to flip the classroom in his 2nd year Java Module.

Unlike other teaching awards that are awarded by institutions, this award was offered by the RUSU (Reading University Students Union) and the nominations were made by students.

I managed to capture Karsten with his award at his office.



Tuesday, 4 March 2014

Visiting UNISA Pretoria - Research & Innovation Week

The University of South Africa, one of the leading open distance learning institution, is hosting a Week long event on Research & Innovation. On Thursday, the 6 March 2014, the Institute for Open and Distance Learning is hosting a symposium on "Innovation in ODL Research Teaching and Learning" focusing on the them “Exploring the potential of MOOCs and OER in enhancing teaching and learning in ODL". I've been invited as a keynote speaker at this event and I am delighted to be back in South Africa. I really enjoyed my last visit September 2013 to Cape Town and I hope Pretoria will be even more exciting.

I plan to talk about MOOCs and developing countries - how they can (or can not) meet learner needs in that part of the world. I will be sharing the latest information in MOOC research I gathered in EMOOCs 2014. I will also look at learner personas to discuss how MOOCs will (or will not) be useful to learners from developing countries.

The session takes place at Senate Hall, Muckleneuk Campus, Preller Street, Muckleneuk, Pretoria and my presentation slides are shared.

--
Updated 10th March 2014
News Item about the event can be found here

Unisa’s Research and Innovation week addresses MOOC appeal


Wednesday, 26 February 2014

FLMobiGame Feb 2014 - Frequently Asked Questions

Begin Programming: Build Your First Mobile Game started Monday 24th Feb with over 33,000 participants and this is the second run of the MOOC.

We introduced 'import' method to setup the environment because last time we found 'manual' method was too difficult for many beginners. However, the import can cause errors in some instances. We have identified several solutions to this and here I am linking to an answer for the most common issue.

I get error messages from Eclipse before I run the emulator
When I import the project I get an error saying “MainActivity] Unable to resolve target ‘android-17’
Sometimes the automated import does not work. There are two solutions to this, either
Create a new version of it following the ‘ALTERNATIVE INTRODUCTION TO THE IDE’ step. This should work.
OR
•try to install the Android target that is missing. Start the ‘Android SDK Manager’ (usually a small button underneath the menu in Eclipse) and select and install the appropriate SDK level.
This is explained by one of our Mentors Matthew and I have copied here his response in the forum

"firsly make sure you have opened the SDK Manager (Either through Eclipse via the picture of the Android man inside a phone, or through the SDK Manager.exe inside the folders downloaded, if on Windows) and downloaded the Android API (The latest version is API 19/Android 4.4.2), once this is done inside Eclipse if you right click your project -> properties a window of the properties for the project will appear, click onto the Android tab and within the Project Build Target it should show all the versions of Android installed, make sure The Android 4.4.2 one is ticked (If that is the version you downloaded). Click apply then ok and everything should be working"

Hope this helps

Thursday, 6 February 2014

#rhizo14 Challenge Week 3 - Embrace Uncertanity

Week 3 Challenge - How do we make embrace uncertainty in learning? How do we keep people encouraged about learning if there is no finite achievable goal? How do we teach when there are no answers, but only more questions?


Photo by Roadsidepictures http://farm3.staticflickr.com/2657/4048229871_c539bcb915.jpg


I have not been able to document my thoughts on this until now (better late than never?). Anyway after reading great posts by Jenny Mackness and Cathleen, it inspired me to put my thoughts into words. 

What is uncertainty? To me things that are not predictable that can have a great influence/affect other connected things are uncertainties. For example, if I am to pick children from the nursery and I were to travel by train it is an uncertainty for me. If I am on train and there is a signal failure or the like (which unfortunately happen so often) I will be stuck not being able to collect kids on time. Will there  be careers until I get there, will the children be scared, will they refuse going back to nursery, hefty fine etc are the repercussions. Another example as Jenny has shown is employment. As I have been on couple of short term contracts when the end of contract is near I get the feeling of uncertainty kicking in. 

When we get into a routine it becomes more or less certain. So for example when I started driving every day was a challenge - a uncertainty for me. I still remember coming home and thinking to myself 'thank god, I'm alive, I managed today'. But now a little more than a year into driving (unless there is something major) it  is my routine. 

Our routine is a comfort zone to us. We know it inside out and we know how to handle things within that. If we step out of that, it is unknown, uncertain territory where we feel uncomfortable and perhaps fearful?. But once we stay in that for long enough it becomes our comfort zone. In the previous example, driving was out of my comfort zone but once I stepped there it came with in my comfort zone. Effectively widening or expanding my comfort zone. I loved reading "Feel the Fear and Do it Anyway" by Susan Jeffers which talks about the fear of unknown and taming that fear.

Going back to the second part of the question how to encourage learning if there is no finite achievable goal? Well... in my view at lower levels of learning it may be overwhelming to know this but when you are learning at higher levels I think when you read more and more into a topic you discover that there is more unknown than known; unless you take the things at face value and stop questioning - which is not what is expected at that level. For example if I told my son or daughter who will be starting primary school this year about the unknowns and the uncertainty in learning: they might not understand it at all; they may not be interested in learning at all as it is all an unknown so what is the point; or anything in between. It is highly unlikely that a learner at that stage will embrace the uncertainty. (This is not the same as letting them know that I do not know the answer to something but I will find it out.) But if the conversation was between a PhD student and his/her supervisor, it may even inspire the learner. So I think as educators we need to help the learners build that - I would like to call it learner maturity.