What is the difference in usage, if any, between дыра and дырка? For comparison, my impression is that нуль and ноль are largely equivalent except that there are some standard phrases using one word but not the other, phone numbers with 0 use ноль, and technical settings with numbers use нуль.
In mathematics, neither дыра nor дырка are commonly used to denote an point/set that is excluded from another set.
However, the actual terminology is somewhat similar: If some set has the point A removed from it (usually with its neighbourhood included in the set), it is said: Точка A выколота. Similarly, a set that includes all points close to A but not A itself is called проколотая/выколотая окрестность точки A. The direct translation, Punctured neighborhood of A, is also used in english literature. I'm not aware of any english analog for the first phrase, though.
Also, generally, scientific nicknames for certain objects (adjective hole) tend to have hole translated as дыра only. The only two examples I can think of are ozone and black holes, but there's probably more. Although there are definitely some other uses where дырка is the only option.
There are also uses where only one of the words is commonly used, for example:
A hole in the ground (дыра only)
Vulgar synonym to "woman" (дырка only)
It would probably also be good to mention that there are at least three other words meaning holes of different sizes: дырень/дырища for exceptionally large holes and дырочка for small ones (smaller than дырка) or for exaggerating/pointing out the smallness.
Another fact worth mentioning is that дырка and дырочка almost always mean a "clean" hole, while дыра is often used to refer to holes with irregular/jagged edges.
All of those words, especially the three mentioned above, may also convey the feeling of the speaker in respect to the hole in question:
Using дырень/дырища usually implies awe, surprise, or disgust. Using дырка instead of дыра implies that the hole is no big deal/not worth your attention, unless you try to direct the listener/reader's attention to the hole, in which case дырка means a non-serious hole and дыра can mean both.
засунул руку в карман, а там дырка. the hole is no big deal, I'll fix it when I get home
засунул руку в карман, а там дыра. there's a big hole in my pocket, I should be careful not to put anything in until I fix it
посмотри, у тебя дырка в кармане!
посмотри, у тебя дыра в кармане!
these two sentences mostly mean the same: You have a hole in your pocket, fix it ASAP. The first of them implies a hole at least smaller than the pocket itself, though, whereas the second could refer to a hole of any size.
Finally, дырочка is probably the most emotionally-neutral of these words, meaning just a small (typically smaller than a finger, but could be anything depending on what is considered small in a particular context) hole.
Lev Landau submitted a manuscript of a book on solid-state physics to a publishing house. A corrector girl calls him a month later and says: "Prof. Landau, I am awfully sorry, but... you know... you are writing a serious book and are using such a childish language... I have replaced дырка with отверстие throughout your book."
Grammatically, дырка is a form of the word дыра, just like Катя — Катька, рама — рамка. In many cases, suffix -к- has a diminutive meaning, and this is just the case here. So one can say большая дыра и маленькая дырка.
In "normal" use the word дыра often implies that there is a defect (дыра в кармане, дыра в заборе), while дырка can also be considered as a colloquial synonym of the word отверстие: дырка в ремне (see Gramota for example), дырку в носу проковыряешь etc.
But дырка and дыра have a couple of uses where these are two different words:
- 'black hole' is translated as чёрная дыра only.
- 'hole' (in solid-state physics) is translated as дырка only
It worth to mention that, aside from the fact that "дырка" is definitely more colloquial, "дыра" has one very widely recognized and used meaning which "дырка" completely lacks.
"Дыра" stands for a remote and/or forsaken and/or ramshackle place. Example:
В какую же дыру мы с тобой попали or Слушай, ну какой Урюпинск, я туда не поеду, это же дыра, там нечего ловить!