Search for:
  • Home
  • Applying
  • Programme
    • Courses
    • Internships
  • Who we are
    • Faculty
    • Alumni
  • Blog
  • Contact us
  • Students Login
  • email scicomm@unitn.it
SciComm Trento
  • Home
  • Applying
  • Programme
    • Courses
    • Internships
  • Who we are
    • Faculty
    • Alumni
  • Blog
  • Contact us
  • Students Login

Blog

A proven trick for dating nerdy

access_time27 Settembre 2022
perm_identity Posted by SciComm
folder_open Communication

Dating nerds entails many wonderful things. I do love the sparkle in someone’s eyes when they tell me how fascinating sorting algorithms are. But when they start detailed discussions on the best Magic card in the new set, I get lost.
In situations like these, it is good to have a joker up your sleeve, some way to turn the conversation. My trick for these situations is nerd sniping. The idea is to introduce a problem or interesting concept that captures their attention. It should be easy to talk about, but complex enough to keep their interest for more than five minutes (or long enough to steer them away from Magic cards).
One proven way to snipe your nerd’s attention is to explain hash tables. They are a fancy, yet easy to explain concept from computer science and perfect for some nerd sniping. If you do not yet know how to explain hash tables, don’t worry, here is a quick guide.

  1. Explain the Basics

Start with the basics: hash tables are data structures that store data packages. These packages can have any size, so they might be a single number or the encyclopaedia Britannica. The point of hash tables is to have a designated spot for each package, so you can find it again.

2. Use an Illustration

If you explain hash tables, you might use an example to illustrate it. I like to compare them to libraries. In many ways, hash tables resemble bookshelves, that are separated into single cells. Each cell can contain one book. As in hash tables, it is important in libraries to have a system that allows you to find a book quickly within kilometres of bookshelves.

hash table like bookshelf
Hash tables are like bookshelves

3. How to make sure you find your package

If a user looks for a certain book, they get a shelf marker that tells them the book’s position within the library. With hash tables it is similar. Every package has a key, with which you can find the package in the table.

Hash function transforms the key into the hashed key, which indicates the data packages position

The key is transformed into the hashed key using the hash function. The hashed key indicates the position in the table.
In a library, the key would be the book’s title and author that are transformed into the book’s shelf marker. When the library acquires new books, the shelf maker is generated by a librarian who then brings it to its new position. In hash tables, it is the same, just without the librarian. The data package is assigned to a cell, according to the hashed key.

4. The magic of hashing

You might get the question: why do I need the hash function, can I not just put the data packages in the table? The answer is: because you want to be able to find the packages again. If you just put them in the table without a system, you will soon be lost. Moreover, hash tables get slower the fuller they are. That means you also want to avoid bulks of filled cells. Therefore, we need the hash function. It generates hashed keys, in a way that they do not cluster at certain points.

5. How to deal with conflict

Whilst filling the hash table, you will encounter the problem that a package is supposed to go into an already taken slot. The probability of such collisions rises as the hash table fills up. Some hash tables allow multiple packages in one cell (e.g. hashing with chaining), but many do not.

When we imagine a librarian in a classic library sorting books in a shelf, she will place the book in the correct position by pushing the other books to the side. In a hash table-like library that would be a lot of work because the librarian would have to move each book one slot further until she reaches the next free slot. The method is called Robin-Hood-Hashing and leads to very tidy shelves: the books are perfectly ordered by their shelf marker.

Robin-hood-hashing in a bookshelf
Robin-Hood-Hashing

To save time, the librarian could also just go right, down the shelf and look for the next free cell. Users will still be able to find the book when they go to the location indicated by the shelf marker and look to the right. If they get to a free cell before finding the book, they know it is currently on loan. The professional term for this is Linear Probing.

Linear probing in a bookshelf
Linear Probing

Proof of concept

Whilst writing this post, I gave my quick guide to several friends dating nerdy. They used it and explained hash tables to their dates and partners. The reports varied slightly, but all nerds successfully sniped, some even swept from their feet.
It also works the other way around: If you are the nerdy part of your date and you are looking for an interesting, witty conversation topic, maybe try hash tables. I know from personal experience, that it worked at least once.

LEILAH JAETZOLD MAIER


Tobias Maier —  Karlsruhe Institute of Technology

The Master of Hash Tables

The nice nerd who explained hash tables to me is Tobias Maier. He is doing his PhD in theoretical computer science at the Karlsruhe Institute for Technology and can spend hours discussing magic cards if you do not switch the topic.
https://github.com/TooBiased

Newer Walter Alvarez and the mystery of the dinosaurs’ extinction
Older Does the “visual” brain shut down in the blind?

Lascia un commento Annulla risposta

Devi essere connesso per inviare un commento.

Search the website
Search for:
Follow us

Tweet us
Tweets by ScicommTrento
Master Scicomm | University of Trento Department of Sociology  | Via Verdi, 26 - 38122 Trento
keyboard_arrow_up
Cookies and Privacy policy
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Sempre abilitato
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
ACCETTA E SALVA