Filtered by Mathematics

Page 2

Reset

Google PageRank algorithm in Python

March 21, 2004
27 comments Python, Mathematics

There are many articles on the net about how the PageRank algorithm works that all copy from the original paper written by the very founders of Google Larry Page and Sergey Brin. Google itself also has a very good article that explain it with no formulas or numerical explanations. Basically PageRank is like social networks. If you're mentioned by someone important, your importance increases and the people you mention gets upped as well.

We recently had a coursework in discrete mathematics to calculate PageRank values for all web pages in a web matrix. To be able to do this you have to do many simplifications and you're limited in terms of complexity to keep it possible to do "by hand". I wrote a little program that calculates the PageRank for any web with no simplifications. The outcome is that I can quickly calculate the PageRank values for each page.

Here's how to use it:


from PageRank import PageRanker
web = ((0, 1, 0, 0),
       (0, 0, 1, 0),
       (0, 0, 0, 1),
       (1, 0, 0, 0))

pr = PageRanker(0.85, web)
pr.improve_guess(100)
print pr.getPageRank()

Truncated! Read the rest by clicking the link below.

Finished the bulk of my dissertation

March 15, 2004
1 comment Mathematics

This weekend I finished the bulk of my dissertation, which is a web application for academic staff to publish their academic papers online. The first target audience is for staff at City University Mathematics Department to whom I will deliver the project. The idea is that doctors and professors can submit their scientific papers on this web application. They enter some meta data about the paper such as title, abstract and co-authors and lastly upload the PDF or Word document that actually is the paper. The administrator will with time compile "Issues" which are basically bundles of papers published together with a little comment.

Registration is open to anyone but requires moderation. I.e. you can't log in straight after you have registered. Also all papers that registered members submit will need moderation too. This is done by a group of people (currently only me) who have administrator access.

My dissertation is about the computer science in building a web application. I.e. planning, data structures, algorithms, design, content management etc. It has "nothing" to do with mathematics even though I'm an undergraduate student of the mathematics department.

Please do go and visit the site and use it to help me get it as good as possible. There might still be bugs or spelling misstakes that needs to be taken out. When you register I will moderate you and please avoid rude words and try to make your example data as real as possible.

Now the last thing for me to do is to write the actual report about the project. That is what I will submit but my grade will based on the judgement of the web application. When I have finished my report I hope to show that on my web page too if I'm allowed.

MathML and displaying Math on the web

January 23, 2004
3 comments Mathematics, Web development

My near-future hope is to set up my own weblog where each new blog item is my write-up of notes from my math lectures. The purpose of this is twofold:

  • Study my notes from lectures
  • Learn more about web development with odd content/format

I then need to be able to write mathematical expressions in my HTML using TeX syntax and have the expressions converted to images. TeX (father of LaTeX (father of Itex)) looks like this:


\[ \sum_{n=1}^\infty \frac{1}{n} \text{ is divergent, 
but }  \lim_{n \to \infty} \sum_{i=1}^n \frac{1}{i}
- \ln n \text{ exists.}\]

Truncated! Read the rest by clicking the link below.

Same but new keyboard, lovely change

January 21, 2004
0 comments Mathematics

Today I got my new keyboard. A Microsoft Internet Keyboard. It's exactly like the one I had before. The old one work just fine except that the keys were starting to get squeaky. The difference is very subtle but I felt I had to punch the keys from directly upwards. With this new one it's so much easier to type. Small difference on the outside but a really big difference for me.

Today I've also had my first "Object Oriented Programming in C++" lecture and lab. This is as far as we got today:


#include <iostream>
using namespace std;
int main() {
   cout << "Hello world!\n";
   return 0;
}

Actually we did a few more things. Next lecture I think we'll start with classes and stuff. A requirement for this course is that you already know programming (in Java) so we'll be able to skip while loops and if statements. Good.

Today was also the first lecture in Bottom Up Computing and Discrete Mathematics. A combination of elementary discrete math plus some general knowledge of how computers work. We'll even have a lab where we take apart a laptop to learn about the hardware inside. This lecture we spent discussing how Google's PageRank works. I'm looking forward to doing some serious math on algorithms like this. It will help a lot in understanding how Google does it.

How old is Bettys dad?

January 11, 2004
0 comments Mathematics

Translated (by me) from a Swedish science magazine I bought when I flew back to the UK a couple of days ago:

"How old is your dad?" Karin asked, "he looks much older than my dad". "Ridiculous!", Betty replied somewhat angry over her friends insensitivity, "but now you'll see if you can work it out. His age is three times the first digit plus five times the last." How old is he?

If you can work it out. Don't just tell me an answer you've come up with by testing several numbers. Show me some proof!

Two exams on the same day

December 30, 2003
0 comments Mathematics

At the moment I'm here in a snowy Sweden in my parents house, with a cold and worries about not studying enough during this break.

It now appears to be so that I have to take two exams on the same day and same hour. What they do then is that they arrange so that I can take one of the two exams later in the afternoon. It is only me who has this clash of two exams on the same day and hour.

They will then have to "supervise" during the day so that I can't have any contact with my fellow students. I wonder how they do that. In fact I'm now curious to find out. Are they going to have some goon to follow me around wherever I go? Will I not be able to have my mobile on?

Well, we'll see what happens.
For now: Happy New Year

Tangram

October 28, 2003
0 comments Mathematics

We're doing a project on this in the Data Structures and Algorithm. The game of Tangram is simple. You've got 7 pieces of certain size and shape. Two are idientical, so thus 5 unique ones.

Try the game and see if you can work it out.

The total number of solutions is HUGE and our project is about sorting and storing information about solutions. We don't have to populate the storage but to at least have a principle of deciphering a shape into some sort of code.

Any ideas?

First day back at university

October 1, 2003
0 comments Mathematics

So it started today. Term I on my third and last year of Mathematical Science with Computer Science at City University.

The lectures I had today were Data Structures & Algorithms and Fluid Dynamics

Both are potentially interesting. The DSA course might be "too easy" since I have programming experience from before and most people in the course don't. Lecturer seems alrite but I've never seen a lecturer so nervous before. Maybe it was just because it was his first lecture too.

Fluid Dynamics may be difficult but it's good with challanges. Looking forward to do this module.

Perfect parking formula

September 2, 2003
0 comments Mathematics

This is fun. Someone has calculated/modelled the perfect S-shaped turn for parking your car.

You'll need to measure a few things first: the width of your car, your turn radius at a paricular rotation of the steering wheel and exactly where your midpoint is between the front and rear wheels.

The author of this 1 page long paper is Dr Rebecca Hoyle