How to use the Christmas ‘vacation’

The Christmas ‘vacation’, a time for merriment and cheer as we celebrate the close of a fun, work-filled year and the beginnings of a fresh and unexplored one in a frenzy of parties and mass gluttony. Well, not quite…

Indeed, the Part 1Bs were tasked with the vital challenge of enlightening the 1As as to the true meaning of Christmas.

They laid down the main objectives of the holidays:

  • Understand the material you have learned
  • Learn how to learn (?)
  • Recover!

Then swiftly leapt into dispensing wise (?) words, detailing a select few of the particular ways of constructing plans (YOU do make one, right?) and explained how to “actually do the work.” This involves sleeping and rewarding yourself… as well as building in a consistent routine and building revision material including, but certainly not limited to,

  • Revision cards
  • Small one-liners
  • Massive A3 spider diagrams
  • Detailed notes
  • Writing a book on a topic…

The 1Bs emphasised the importance of working with each other over the holidays to alleviate the… fun, lest they overload themselves. Quizzing each other via skype or Google hangouts, discussing intellectual problems they can’t solve in the isolations of their rooms and maintaining motivation throughout the long weeks. The importance of passing their ticks, using their supervision work and attempting Tripos papers was emphasised in order to provide more time for studying in Lent term.

Continuing with the theme of solid, vital information, the 1Bs moved onto notes, indicating that notes should: be condensed, (potentially) visual tools, ready for the exams and that they should be made tactically. One of the 1Bs detailed their struggle with notes, having spent too long on them and so sacrificed precious time spent on those notorious Tripos questions. Her story concluded with tips on how to make notes by selecting key points and not aiming to perfect them.

After notes had been polished off, another of the 1Bs stepped into the breach and addressed that difficult topic of determining how you actually learn how you learn. His tips included trying visual aids such as diagrams, making notes, watching videos on the topics and working on a practical project or collection of small programs to solidify concepts.

Unfortunately, the best laid plans do often go awry and so another 1B took the stand to illuminate the 1As on why this is the case with a list of three:

  • Issue #1: Hofstadter’s law: It always takes longer than you expect, even when you take into account Hofstadter’s Law
  • Issue #2: Work expands so as to fill the time available for its completion
  • Issue #3: Real life is fun… Concerts/Family/Friends/Lunches/ Movies/Dinners/Writing an Operating System/ Lots of Alcohol/Travel/Rowing

He proceeded to describe a series of strategies that could be deployed to counter these problems. Which effectively led back to planning, rewarding yourself and to be as productive as possible when working (close that Facebook tab I know you have open!).

The address drawing to a close, the 1Bs finished with a typically computer scientist ending, because, as always, xkcd is right:

xkcd

Merry Christmas and a happy New Year!

What is the Internet?

This is a surprisingly difficult question to answer in under two minutes. You can listen to me having a go on the NakedScientists radio show.

Here is a direct link to the particular segment of the show: http://www.thenakedscientists.com/HTML/content/interviews/interview/1001038/

If you want to listen to the whole thing – including an description of the ‘dark web’ – this is available online too.

Matt spent his summer working with the NakedScientists building an Android app for their show. Its currently got a rating of 4.2 out of 5 on the Android Play Store. Well done Matt…

Predicting the Future: Language Modelling

Jeppe presented his third year dissertation to the weekly gathering of Computer Science students at Queens’.

After a hard day of lectures, practicals and supervisions, the first slide in Jeppe’s presentation was quite a relief.

Screen Shot 2014-11-25 at 21.48.00

It’s not a trick question. Being able to predict the next element in a sequence can be quite intuitive…to people.

Screen Shot 2014-11-25 at 16.49.40

To model a language, more history than just the previous word needs to be considered. The average length of a sentence is 20 words. Jeppe explained that Recurrent Neural Networks (RNNs) are appropriate because they allow the storage of more elements compared to previous methods such as Bayesian N-gram models (limited to tracking only 5 previous states). In a language modelling context the RNN should, given a partial sentence, be able to estimate the most likely next word in the sentence.

Jeppe introduced Hessian Free (HF) Optimisation which has recently been used to train RNNs…slowly. He talked about how this problem could be minimised for larger data sets using GPUs, offering from 5 to 100 times the speed. Jeppe may extend this project using a cluster of GPUs, instead of just one, so that HF optimisations can be run in parallel. This will greatly increase the speed.

Possibly the most obvious applications of this powerful machine learning algorithm are predictive text on smartphones and speech recognition. Both of which seem to have a lot of room for improvement.

Jeppe, we wish you the best of __?__.

Drawing in 3D

Last Wednesday Holly gave a presentation on her part II project.

The projects goal is to ease the creation and development of 3D models. After providing us with multiple statistics about long it can take to produce a high quality model (16 hours +), Holly went on to demonstrate how her project works, what outcomes can be achieved with it, and how it tackles the problem of the long durations needed to craft detailed models.

The idea behind the project, is to allow an artist to draw a shape in 2D, and then have this 2D shape crafted into an inflated 3D model. The results were honestly quite spectacular, with an example of a simple 2D fish being converted into a respectable 3D model of a fish (shown below).

 

Drawing in 3D

To achieve the results seen above, Holly uses various techniques published in papers that show how some continuous calculations can be transformed into discrete calculations, and therefore more easily computed.

Drawing in 3D

With the ability to edit the curvature of the model produced (shown above), as well as having fixed “heights” in the model to give more definition, the project should result in an easy, and very quick way of creating mock-up models for use in a wide range of industries.

 

 

How to give a presentation (and give feedback to others)

Over the upcoming weeks we’ll be having presentations from the third year students. The format is that they will speak for 30 minutes and then they’ll sit down and we’ll give them feedback on how they presented for 30 minutes.

To give us some basis for discussion I gave a talk this week on “What makes a good talk good?”.

The majority of the talk was based around this TED talk:

We paused the video at appropriate points and talked about the good things the speaker is doing to engage the audience and get the message across. If you are watching the video watch out for him repeatedly refreshing the main points and using the Rule of Three. There are so many things going on in this video that we spent 40 minutes talking about the first 10 minutes of the talk.

After watching the video I talked about some other techniques not visible in the talk (use of slides for example) and how we might structure our thinking when trying to give feedback to others.

I’m looking forward to seeing the presentations from the third years in the following weeks.

Wednesday Meeting SpaceChem Challenge

Another week flew by in Cambridge and before we knew it we were back in the top floor of CC meeting again with our fellow Queens’ Computer Scientists. Our Wednesday sessions are a chance to reconvene and participate in whatever Andy has in store for us! After a couple of weeks of presentations, both inspiring and daunting for myself as a first year, we knew we would be doing something a little different this time around…

IMG_20141029_190412

We settled down in the pairs, each pair with a laptop, soon to discover the purpose behind bringing such devices. Andy gave us a URL and off we started!

SpaceChem, a familiar name to some prior enthusiasts, is a puzzle game which uses a visual programming language to allow the user to tackle various chemistry related challenges.

In its simplest terms, the aim of the game is to produce a certain number of each required product molecule by controlling the movements of the input molecules. As you can see in the GIF above, the reactor can look rather complicated when in use, which is why you need to be able to think ahead when designing your solution. One of the cooler features of the game is seeing how your solutions compare to those of actual other players.

Why might we be playing computer games in term time when we supposedly have a gazillion other things to be getting on with? Well there’s a reason behind the gaming, Andy reassures us. There are a few applications of the skills that the software teaches to our own courses.

Besides the obvious programming and solution building connections, there are some concepts that it helps to bring out in our CompSci brains. In particular, an understanding of concurrency is required to complete later levels. As you may be able to see in the GIF above, these harder levels require multiple molecules to be bonded together. This means you have to ensure that the molecules moving along the different paths arrive together at the same time in order to bond. You can use sync points to make certain molecules wait for the other ones to catch up, to fine-tune process so the required ones join together at the right place and at the right time. This is in a similar vein to parallel processing which is an important part of Computer Science. SpaceChem gave us a chance to visualise this idea and put it into practice.

IMG_20141029_190417

And of course, to make the session extra special we were given prizes for showing Andy something ‘impressive’.  Our pair created a solution which used every space on the grid to get earn some well-appreciated caramel bites.

IMG_20141029_190358 IMG_20141029_190424

Grateful thanks to Zach@SpaceChem for allowing us to run the session.

Multiplying two digit numbers

We were chatting at dinner the other day about mental arithmetic and Navid had a neat trick for multiplying numbers in his head.   He’s written it out below.

Mentally multiplying two digit numbers is difficult for the majority of people. This is probably due to our limited working memory overflowing when we try to store the partial products, leading to errors.

In many cases, I use a trick to simplify the problem, which is the subject of this blog post. It requires a bit of investment, but lets us compute products such as 84*78 both accurately and (in due time) quickly.

 

Theory

This trick works for a * b when a + b is even, that is to say either a and b are both even or both odd, for example 65*43 and 88*78. Furthermore, it works best when a and b are close together, but as your proficiency increases this becomes less important.

The essence of the trick is in the difference of two squares, namely, we want to write a * b =       (c + d) * (c – d) = c^2 – d^2                  

We quickly find that. c = (a + b) / 2 and d =|a – b| / 2

In other words c is the average of a and b, whereas d is the difference between the average and a or b. Note that the condition that a + b is even ensures that both c and d are integers.

You are probably wondering what the point of this complication is. Well, in many cases computing c^2 – d^2 is easier than working out a * b. For example, take 43*57, it is easy to see their average is 50 and the difference is 7. Hence, the product reduces to 502 – 72 = 2500 – 49 = 2451. Try it out on the following examples:

a) 66*62                             b) 98*84                             c) 39*33                             d) 44*76

 

Tips and Conclusion

After doing a few problems you will find that most of the time d is small enough to recall d^2 from memory. The trickier part is calculating c^2, fortunately, we can use the fact                 (x + y)^2 = x^2 + 2xy + y^2 to aid us. For example, writing 82 = 80 + 2 we find that 822 = 802 + 2*2*80 + 4 = 6400 + 324 = 6724. Personally, I found that this speedy computation of c^2, removed the major bottleneck from the method.

Some practice is required but soon you will be able to multiply the majority of numbers of this form in under ten seconds.