# Today I Learned

Some of the things I've learned every day since Oct 10, 2016

## Monthly Archives: January 2017

## 105: Loitering Objects (Java)

January 31, 2017

Posted by on In Java (and possibly other languages, not sure), **loitering objects** refers to objects in memory which are no longer desired or will no longer be used in the future but still have pointers pointing to them, preventing garbage collection from freeing their place in memory. It’s generally good form to not waste memory in this fashion, but in extreme cases loitering objects can even lead to unwanted program termination due to a .

## 104: Bijectivity of Left- or Right-Multiplication by Group Elements

January 30, 2017

Posted by on Let be a group and be any element of that group. Then the functions

are bijective.

#### Proof:

Consider the function . By the left-cancellation property of groups, if , then . This means that if , then , and it follows that is injective. Since the domain and codomain of are the same (), this means that is in fact bijective.

The proof for bijectivity of is identical, but uses the right-cancellation property instead.

The intuitive significance of this is that left- or right-multiplication by a given element always sends distinct elements to distinct elements, which is pretty neat.

## 103: Dedekind Cuts

January 29, 2017

Posted by on The **Dedekind cut** is a method of constructing from . A cut is first defined to be a partition of into 2 non-empty subsets such that

- if and , then
- if , then there is a such that (meaning has no maximum element)

A cut can be equivalently determined solely by alone, rather than the pair .

Cuts can then be used to construct by defining any to be the cut where is the set of all members of such that . That is, is simply defined as the subset of rationals smaller than itself, and is the set of all such subsets.

## 102: Kernel Space vs. User Space

January 27, 2017

Posted by on **Kernel space** and **user space** are separate regions of virtual memory distinguished from each other in an operating system for purposes of security, stability, and centralizing control. Typically, user space is the space which user applications have direct access to and can work with, while kernel space is a privileged space which only especially stable and trustworthy programs, such as the kernel, can access. This barrier essentially insulates possibly insecure or unstable applications from power, preventing them from doing things like crashing the system or messing with other applications’ memory.

## 101: Non-Commutativity of Symmetric Groups

January 26, 2017

Posted by on In general, the symmetric group (the set of permutations of distinct objects under permutation composition) is non-abelian. The somewhat trivial exception is when .

## 100: Primitive Types vs. Reference Types (Java)

January 25, 2017

Posted by on In the Java programming language, values either have a **primitive type** or a **reference type**. The primitive types are:

- boolean
- byte
- short
- char
- int
- long
- float
- double

All other types not in this list are reference types.

A value with a primitive type stores the information determining the value itself, such as the binary code for a given integer or character. By contrast, a value with a reference type stores the *address* of the location in memory where this information can be found. For instance, after declaring and instantiating a variable

the variable doesn’t store the code for the String itself, but rather a ‘pointer’ to where this code can be found.

This has important consequences for how primitive values are assigned to variables or passed as parameters, as opposed to reference values. A primitive value passed or assigned will have the bits describing the value itself copied to the target, whereas a reference value will merely have the *address* of these bits copied.

## 99: Non-Orientable Surfaces and the Möbius Strip

January 23, 2017

Posted by on The **Möbius strip** is a canonical and minimal example of a non-orientable surface, in the sense that

- a surface is non-orientable if and only if it has the Möbius strip as a topological subspace, and
- the Möbius strip is the
*only*surface with this property.

## 98: Top Type, Bottom Type

January 21, 2017

Posted by on Given a type system, the **top type** is the type which contains every possible value in that type system, making every other type a subtype of .

By contrast, the **bottom type** is the type which contains no values, making every other type a supertype of .

## 97: The Archimedean Property of the Reals

January 20, 2017

Posted by on has the **Archimedean property**, which states that for any positive there exists an such that

.

Intuitively, this means that contains neither infinitely large nor infinitesimally small numbers. (The property would not hold if was infinite, or if was infinitesimal.)

#### Proof:

Finding an such that is equivalent to finding one such that . If there is no such , this means that for all and thus the number is an upper bound on . However, has no upper bound, so this is a contradiction, meaning such an must exist.

## 96: Euler’s Theorem (Number Theory)

January 20, 2017

Posted by on **Euler’s Theorem** is a sort of extension of Fermat’s Little Theorem. One way of stating Fermat’s is that where is prime and is any integer,

,

whereas Euler’s Theorem makes the more general statement that if are simply two *coprime* integers and is Euler’s totient function,

.

The reason Fermat’s is a valid special case of Euler’s is because when is prime, .

[The congruence in the statement of Euler’s theorem is actually equivalent (‘if and only if’) to being coprime.]

## Recent Comments