• Boolean logic

    Posted on December 3rd, 2009 Richard Taylor 1 comment

    OK, time for some proper librarianship now.

    Boole_George

    Men in cravats…

     

     

     

     

     

     

     

     

    boole

     Mutton-chop whiskers…

     

     

     

     
    This is George Boole, his strict Victorian values can help you use databases. 

    Let’s just wait a moment for the students to leave… Bye! Have a nice time on Facebook. Don’t slam the door.

    George Boole’s views on logic laid the foundations for all future databases, including – yes – even Google. One of Boole’s underlying principles is that there are several logical “operators” – “AND”, “OR”, and “NOT” – which determine the relationship between different variables or values, eg the words which you enter into a search engine.

    The classic way to explain Boolean logic, seared onto the brain of every librarian since about 1974, is via 3 Venn diagrams. Imagine you’re writing an essay called “Shakespeare in the cinema – discuss the approaches taken by two different adaptations”. You then decide to search a database for journal articles…

    Boolean AND

    By searching your database for Shakespeare and cinema, you’ll only retrieve journal articles that mention both Shakespeare and cinema. You won’t find a journal article that only mentions Shakespeare, or one that mentions only cinema.

    Note that a Boolean AND search won’t necessarily find results where your search words are in the same order, or where they appear next to each other! Eg a database search for fish and chips could retrieve a journal article with the sentence “Howard Hughes ate some fish fingers for tea, passing the waiter a rack of $100 roulette chips”.  Instead, to search a database for an exact phrase, use quotation marks around your search words, ie “fish and chips”.

    Boolean OR

    By searching your database for Shakespeare or cinema, you’ll retrieve journal articles that mention only Shakespeare or cinema, as well as those that mention both Shakespeare and cinema. The OR search can easily swamp you with too many search results – it’s best employed if you’re looking for an obscure topic and need to broaden your search.

     Boolean NOT

    By searching your database for Shakespeare not cinema, you’ll retrieve journal articles that mention Shakespeare – but nothing that mentions cinema, even if it also mentions Shakespeare.

    Why does all this matter? Well… the Boolean AND is particularly crucial because databases work in very different ways. Some databases, like Google, will automatically run a Boolean AND search if you enter several search words, even if you don’t actually type AND. (If you do type AND between your search words, the worst that will happen is that you get exactly the same number of search results).

    Other databases, like the library catalogue, assume that you only want to be shown results where your search words appear in the exact order (or close proximity) that you typed them in – unless you type AND between them. Effectively they’re putting quotation marks round your search words, and searching for them as a phrase. If you’re searching this type of database, failure to type AND between your search words could mean you get 50% fewer search results, without even realizing it.

    To sum up…

    • Use “” quotation marks to search databases for an exact phrase.
    • Type AND between your search words if you’re searching for information about 2 or more different concepts and their effect on each other, eg Marxism and teaching.

     Next time around… achieving better grades with Charles Babbage’s difference engine.

     

    1 responses to “Boolean logic” RSS icon


    Leave a reply