The Mengenlehreuhr (German for "Set Theory Clock") or Berlin Uhr (German for "Berlin Clock") is the first public clock in the world that tells the time by means of illuminated, coloured fields, for which it entered The Guinness Book of Records1 upon its installation on 17 June 1975. Commissioned by the Senate of Berlin2 and designed by Dieter Binninger, the original full-sized Mengenlehreuhr was originally located at the Kurfürstendamm on the corner with Uhlandstraße. After the Senate decommissioned it in 1995, the clock was relocated to a site in Budapester Straße in front of Europa-Center, where it stands today.
The Mengenlehreuhr consists of 24 lights which are divided into one circular blinking yellow light on top to denote the seconds, two top rows denoting the hours and two bottom rows denoting the minutes.
The clock is read from the top row to the bottom. The top row of four red fields denote five full hours each, alongside the second row, also of four red fields, which denote one full hour each, displaying the hour value in 24-hour format. The third row consists of eleven yellow-and-red fields, which denote five full minutes each (the red ones also denoting 15, 30 and 45 minutes past), and the bottom row has another four yellow fields, which mark one full minute each. The round yellow light on top blinks to denote even- (when lit) or odd-numbered (when unlit) seconds.
Given the photo of the clock above as an example, two fields are lit in the first row (five hours multiplied by two, i.e. ten hours), but no fields are lit in the second row. Therefore the hour value is 10. Six fields are lit in the third row (five minutes multiplied by six, i.e. thirty minutes), while the bottom row has one field on (plus one minute). Hence, the lights of the clock altogether tell the time as 10:31. Here are some more examples:
Note that the Mengenlehreuhr can indicate theoretically any point in time from midnight (00:00) until 24:59, which is beyond the upper limit 23:59 on a 24-hour clock. However, one minute past 23:59, all lamps on the Mengenlehreuhr are switched off at the start of a new day.
Define a class Mengenlehreuhr that implements clocks of type Mengenlehreuhr in Python. This class must support at least the following methods:
An initialization method that takes two natural numbers, indicating the hours $$h$$ ($$0 \leq h < 24$$) and minutes $$m$$ ($$0 \leq m < 60$$) on a 24-hour clock. If the arguments are not integers within the given intervals, an AssertionError must be raised with the message invalid time.
A method updateHours with an optional parameter that may take a number $$h \in \mathbb{Z}$$ (default value: 1). The method must move the current time of the clock forward (if $$h > 0$$) or backward (if $$h < 0$$) with the given number of hours $$h$$. In doing so, it must take into account that 23 hours is followed by 0 hours on a 24-hour clock, and likewise that 0 hours is preceded by 23 hours. The method must return a reference to the object on which the method was called.
A method updateMinutes with an optional parameter that may take a number $$m \in \mathbb{Z}$$ (default value: 1). The method must move the current time of the clock forward (if $$m > 0$$) or backward (if $$m < 0$$) with the given number of minutes $$m$$. In doing so, it must take into account that 23:59 is followed by 00:00 on a 24-hour clock, and likewise that 00:00 is preceded by 23:59. The method must return a reference to the object on which the method was called.
A method lamps that takes no arguments. The method must return a tuple containing four natural numbers that indicate the number of lamps that are lit on each row of the triangular clock (listed from the top to the bottom row), ignoring the lamp that indicates the seconds.
A method __repr__ that returns a string representation of the object. This string must contain a Python statement that indicates how to instantiate an object of the class Mengenlehreuhr that is set to the current time of the object on which the method was called. Take a look at the example below to see how the string representation must be formatted.
A method __str__ that returns a string representation of the object. This string must contain a graphical representation of the Berlin clock, in which each row of the clock is displayed on a separate line. The row containing the lamp that indicates the seconds is ignored. Lamps on rows containing four lamps are represented by four pound signs (####) and lamps on the row containing eleven lamps by a single pound sign (#). The representations of the lamps on the same row are separated from each other by a single space. Lines representing rows containing four lamps are prefixed by an extra space. None of the lines ends with spaces. Take a look at the example below to see how the string representation must be formatted.
>>> clock = Mengenlehreuhr(10, 31)
>>> clock.lamps()
(2, 0, 6, 1)
>>> clock
Mengenlehreuhr(10, 31)
>>> print(clock)
#### #### ---- ----
---- ---- ---- ----
# # # # # # - - - - -
#### ---- ---- ----
>>> clock.updateHours()
Mengenlehreuhr(11, 31)
>>> clock.lamps()
(2, 1, 6, 1)
>>> clock.updateHours(9)
Mengenlehreuhr(20, 31)
>>> clock.lamps()
(4, 0, 6, 1)
>>> print(clock)
#### #### #### ####
---- ---- ---- ----
# # # # # # - - - - -
#### ---- ---- ----
>>> clock.updateMinutes()
Mengenlehreuhr(20, 32)
>>> clock.lamps()
(4, 0, 6, 2)
>>> clock.updateMinutes(42)
Mengenlehreuhr(21, 14)
>>> clock.lamps()
(4, 1, 2, 4)
>>> print(clock)
#### #### #### ####
#### ---- ---- ----
# # - - - - - - - - -
#### #### #### ####
>>> clock.updateMinutes(165)
Mengenlehreuhr(23, 59)
>>> clock.lamps()
(4, 3, 11, 4)
>>> print(clock)
#### #### #### ####
#### #### #### ----
# # # # # # # # # # #
#### #### #### ####
>>> clock.updateMinutes()
Mengenlehreuhr(0, 0)
>>> clock.lamps()
(0, 0, 0, 0)
>>> print(clock)
---- ---- ---- ----
---- ---- ---- ----
- - - - - - - - - - -
---- ---- ---- ----
>>> clock.updateHours(10).updateMinutes(17)
Mengenlehreuhr(10, 17)
>>> clock.lamps()
(2, 0, 3, 2)
>>> print(clock)
#### #### ---- ----
---- ---- ---- ----
# # # - - - - - - - -
#### #### ---- ----
>>> Mengenlehreuhr(42, 42)
Traceback (most recent call last):
AssertionError: invalid time
Feel free to play around with this interactive version of the Mengenlehreuhr.
The Mengenlehreuhr may be the key to the unsolved section of Kryptos3, a sculpture at the CIA headquarters.
After revealing that the part of the deciphered text in positions 64-69 of the sculpture reads BERLIN, the sculptor — Jim Sanborn — gave the New York Times another clue in November 2014, that letters 70–74 in part four of the sculpture's code (which read MZFPK) will become CLOCK when decoded. A direct reference to the Berlin Clock. Sanborn further stated that in order to solve section four
You'd better delve into that paricular clock.
However, Sandborn also said that
There are several really interesting clocks in Berlin.