The bedroom window was a very seedy and disreputable hard-felt hat.

Jeremy Brett as Sherlock Holmes

A Markov chain is a type of statistical model that's used to describe things that happen sequentially. You begin in one state, then there is a certain probability that you will move to each of the next possible states, which is useful for things like finding conserved DNA sequences.

This can also be quite a fun thing to play with - it's great for taking in text and trying to make sensible-sounding sentences out of it. The idea being that instead of understanding what the sentences actually mean, you can just see what word usually comes after the word you started with and pick one of them to go next.

So I decided to model the English language as a Markov chain, using the text from The Adventures of Sherlock Holmes (from Project Gutenberg) as training data, and produced about as much coherence as you'd expect from such a method. If you go to http://bethmcmillan.com/geek/markov/, you can generate your very own pseudo-sentence.

I also made a Twitter bot that tweets these nonsense Holmesian sentences.

In brief, I installed node.js, which lets you run JavaScript without a browser, and added the "twit", "jsdom" and "jquery" modules. I followed this tutorial for making a twitter bot. The bot tweets every 5 minutes (I might change this if it turns out to be too much). After stripping the newlines, quotation marks and double spaces from the text, it picks a random word to begin with. Then, it takes this random word and the one that follows it, and finds all of the other places in the text where this pair of words can be found. Next, at random, it picks one of these locations and takes the next word in the sentence. Finally, the process repeats with the two newest words until there's a tweet-length phrase.

All my code's available under the fold, for anyone who's interested. Feel free to follow @markov_holmes for entertaining gibberish!

Continue reading The bedroom window was a very seedy and disreputable hard-felt hat.

...

Lessons from talking to teenagers

My new anatomically correct friend

I've had the opportunity twice recently to talk about my research to a group of 14-17 year old secondary school students as part of the Women in Computer Science schools outreach programme in my department. This has been strange and interesting. The last time I had to address such a group, I was the same age as them, and they were people I had known for years. The dynamic feels very different from the other side.

I felt like my first talk was more successful than my second. The first time I made a point of talking about the different types of computational modelling that went on in the department - aided, beautifully, by the lovely detachably-organned anatomical model pictured above. I took out her organs and passed them around the class, explaining that yes, people did model all of these things. Yes, even the naughty bits (seriously, I have a friend whose PhD project is modelling the C. elegans gonad). I think I planned this talk better and aimed it more clearly at a young audience, and I managed make the experience quite interactive with questions and answers.

They were a small group, and there was one student who was clearly more engaged and interested than the rest. He answered my every question eagerly and accurately. I hadn't realised before just how much of an impediment this can be if you're trying to talk to a group! I was always that kid at school, and it drove me crazy that the teacher would wait for someone else to respond when I knew the answer and I wanted to get to the next part of the lesson already.

The second time I gave a talk to school children (today!), there were about a hundred of 'em and I was concentrating more on describing my own research, because they'd heard all about computational medicine that morning. There were fewer jokes and I spent more time trying to get them to understand the material. I think I made it a bit too dry and technical, when it needed to be more of a fun overview of the subject. However, they totally laughed at all two of my jokes. I now understand how my dad managed to maintain his stock of terrible jokes over the course of his teaching career.

I was following a brilliantly charismatic speaker (this guy!) who really managed to get the kids' attention and keep them engaged. He really made sure to keep the content appropriate for the audience (social networking and selfies came up a lot!) and gave out practically every piece of information in the form of a question and answer, forcing everyone to stay alert. He made jokes all the way through and kept them laughing and happy. I'm more used to a straight lecture-and-questions format from years of university education, and I'd almost forgotten the give and take that happens with school classes.

I really enjoy talking to young people and I hope to do lots more schools outreach in the future. The next time I give a talk I'm going to make it a lot more fun and a lot more interactive!

...

Crowdfunding to help a plucky young choir make it to America

Edit: we did it, you guys! Thanks so much to all of our sponsors.

Somerville College Choir rehearsing at Douai Abbey

The choir I'm currently in are trying to get together enough money to go out to Washington and Boston to sing this July. We're quite unusual as Oxford college choirs go - Somerville College was one of the first women's colleges to open, but it's actually one of the newer colleges, because women weren't allowed into Oxford until 1920. It's not particularly famous or well-funded, and it doesn't have much of a choral tradition.

Our singers come from a lot of different backgrounds, and for most of us, this is our first opportunity to travel so far afield.

We're trying to raise part of the money for our tour through gifts from our friends and family. If you'd be willing to consider helping us reach our goal (I'd be really grateful!), you can donate at https://hubbub.net/p/somervillechoirtour/ .

Alternatively, you could buy a copy of our excellently Christmassy second album "Advent Calendar".

If you can't make a financial contribution to our project, it'd be great if you could spread the word about what we're trying to do to anyone who you think might be interested.

...