-
Notifications
You must be signed in to change notification settings - Fork 0
/
dem.py
92 lines (60 loc) · 24.5 KB
/
dem.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import nltk
import random
from nltk.tokenize import word_tokenize
from nltk.probability import FreqDist
text_data = """Enlightenment philosophers were vexed that their expanding empirical science of the external, material world collided with long-standing religious and moral traditions premised solely on internal, a priori knowledge. But for Immanuel Kant, the ‘sensible world’ of appearances emerged from cognitive faculties of the human mind, constitutive of observations gained through human experience. ‘We can cognize of things a priori only what we ourselves have put into them,’ he wrote. Kant analogised his reframing of metaphysics to Copernicus’s heliocentrism, in which the astronomer’s observations made sense only when he placed the Sun, rather than Earth, at the centre. ‘An object of the senses’ like a new planet observed from a telescope, wrote Kant, ‘conforms to the constitution of our faculty of intuition’, resolving the perceived discrepancy between the observable world and the mind’s contemplation of it.
The Enlightenment’s radical political philosophy, shifting Europeans’ governance from aristocratic absolutism to freedom gained through reason, dovetailed with Kant’s philosophy of science. Observations of a band of stars that appeared to enring the sky led him to surmise that the solar system was shaped like a disc around the Sun. ‘Matter [is] … bound to certain laws, and when it is freely abandoned to those laws, it must necessarily bring forth beautiful combinations,’ he wrote in 1755. ‘There is a God just because nature even in chaos cannot proceed otherwise than regularly and according to order.’ A reasoned universe and a reasoned mind operated together.
Kant’s ‘sensible world’ of the 18th century was Earth, the solar system and the stars in the sky. If Kant’s philosophy holds true, then anticipated astrophysical phenomena of the observable cosmos must continue to be integrated into humans’ self-emplacement in an ever-expanding internal universe as well. Increasingly sophisticated technologies of visual perception – from Galileo’s spyglass to ground- and then space-based telescopes – mediate our entwined expanding astrophysical and moral universes.
Data from NASA’s James Webb Space Telescope (JWST) began returning images in July 2022, and is poised to deepen humans’ sensibility of the cosmos and ourselves. Astronomers expect that it will reveal novel astrophysical phenomena both one step beyond the familiar and the presently unimaginable. With its 6.5-metre gold-coated primary mirror and unprecedented sensitivity to long infrared wavelengths, the telescope’s deep field resolves distant star clusters in unparalleled detail. These images could help astronomers model the ‘cosmic spring’ that led to the formation of galaxies through gravitational mechanisms and life itself. The JWST could also pave the way to realise NASA scientists’ long-quested goal to detect extraterrestrial life, expanding beyond microbes on the surface of Mars or in the Venusian atmosphere, which would shore up a generalised theory of biology and evolution. The apprehension of biosignatures – indications of life in exoplanetary atmospheres – would demand a reordering, not only of how humans perceive the Universe, but of ourselves as living, if perhaps not lonely, beings within it. The cosmos as Kant understood it and cosmos as astronomers today understand it differ. The latter is more anticipated and sensible, but together they are just two points in a series of ruptures in humans’ perception of conjoined physical and philosophical spacetimes.
These ruptures have unfolded chronologically and spatially in tandem. Each new scalar bound from the Earth – to the Moon, to the local solar system, to alien planets and galaxies, to the very fringes of the Universe – has prompted the reformation of our sense of being. To test how the discovery of nature orders the nature of discovery of ourselves, we time-hop to Renaissance Italy. Galileo Galilei improved on existing telescopes, and turned his spyglass to the heavens, writing of striking discoveries in his epochal treatise Sidereus Nuncius (1610), or ‘Starry Messenger’. Observing what a contemporary had dubbed the ‘strange spottednesse’ of the Moon, Galileo wrote that its surface was not ‘smooth, uniform, and precisely spherical’ but rather ‘uneven, rough, and full of cavities and prominences, being not unlike the surface of the Earth.’ As the art historian Samuel Y Edgerton, Jr describes it, Galileo, disciplining his eyes and hand through artistic practices flowering in Florence, rendered the Moon in both soft sepia watercolours and dramatic chiaroscuro engravings.
Galileo’s Moon – an imperfect body rife with craggy geologies, pockmarked by ancient collisions – related familiar terrestrial to unfamiliar lunar features, and required a symbolic reordering. Because the Catholic Church’s Moon, upon which the Virgin Mary reigned, referenced the Immaculate Conception, Galileo’s depiction called into question the concept of the Moon – and therefore God’s universe – as perfect and pure. Galileo had corrupted Dante’s ‘eternal pearl’, and the new Moon’s representation came to enter religious frescoes – a tacit if wary acceptance of a morphing moral order. Next, in careful logs over December 1609 and January 1610, Galileo reported curious pricks of light gambolling about the planet, ‘four planets never seen from the beginning of the world.’ Upon observing only two celestial bodies on the 11th night, Galileo ‘mov[ed] from doubt to astonishment’: he realised that the objects were not fixed, independent stars, but instead orbited at ‘marvellous speed around the star of Jupiter’.
Galileo’s findings came to radically disrupt humans’ perception of their world
We now know these objects as the moons Io, Europa, Ganymede and Calisto, and NASA’s Jet Propulsion Laboratory is planning to send a probe to Europa in 2024 to investigate the possibility of life in its watery oceans. But four centuries ago, Galileo hastened an insuperable fracture of entwined astrophysical and moral beliefs. Further substantiating Copernicus’ model, Galileo fatally destabilised the prevailing geocentrism that the Church had held for centuries.
This time, the Church met Galileo’s observations with explicit resistance, imperilling his carefully constructed position in nuanced Italian court politics. The historian of science Mario Biagioli describes how Galileo had, initially, ingeniously manipulated the tides of power in the Florentine court, leveraging his astronomical discoveries to fashion himself as a philosopher (not a mere mathematician of lower social grade). By dubbing the moons the ‘Medici planets’, he augmented that family’s supposedly God-given mythology. But in 1633, the Roman Court found Galileo ‘vehemently suspected of heresy, namely for having held and believed a doctrine which is false and contrary to the divine and Holy Scripture: that the Sun is the centre of the world and does not move from east to west, and the Earth moves and is not the centre of the world.’ Galileo was condemned to house arrest for the remainder of his life.
Biagioli attributes the ‘fall of the favourite’ to fickle papal dynamics rather than merely to religious or scientific resistance. In Kant’s parlance, Galileo’s freshly ‘sensible’ moons could not be reconciled with short-sighted power struggles. Nevertheless, Galileo’s findings came to radically disrupt humans’ perception of their world. A half-century later, Sir Isaac Newton reworked Galileo’s findings in his monumental Principia (1687). ‘The motions of the planets, the comets, the Moon, and the sea,’ Newton wrote, ‘are deduced from these forces by propositions that are also mathematical.’ He decisively located gravity as an empirical description of all objects and a fundamental theory even beyond the observable world. The laws of motion governed not only humans’ relationship to objects in their world and their place on Earth, but alien bodies outside of immediate perceptibility.
Time-travel three centuries to the Harvard College Observatory in 1912, when the ‘computer’ Henrietta Swan Leavitt earned 30 cents an hour to determine stellar brightness, positions and movements over time. Although the observatory’s director Edward Pickering ‘chose his staff to work, not to think,’ Leavitt’s tedious labour afforded her intimate familiarity with the photographic plates. Partially deaf, her visual immersion let her track the stars in the Large and Small Magellanic Clouds (objects we now know to be dwarf galaxies, macerated and then regurgitated by the Milky Way). Leavitt formulated the relation between the length of a ‘Cepheid variable star’s’ brightening and dimming to precise time intervals, leading astronomers to calculate not only their distance from Earth but the scale of the galaxy.
By the 1920s, astronomers debated if the Milky Way galaxy contained the whole of the cosmos or if spiral nebulae were their own separate ‘island universes’ – a distinction that would define the scope of the cosmos. Edwin Hubble used the world’s most powerful telescope at the Mount Wilson Observatory near Los Angeles to study the Andromeda ‘spiral nebula’ in unprecedented resolution. In a now-famous image, Hubble crossed out the ‘N’ and replaced it with ‘VAR!’ as he realised that the ‘nova’ star was actually a ‘variable’ star; calculating its distance from Earth, he realised that Andromeda was too far away to be incorporated into the Milky Way. We might read Hubble’s ‘!’ as a punctuation of surprise as he too ‘mov[ed] from doubt to astonishment’: his galaxy was surely just one of many that populated a vast cosmos.
Leavitt lent Hubble the means to harness a sophisticated telescopic technology to amplify natural ‘sensibility’, but her foundational insight was hard-won. Pickering glossed over Leavitt’s contributions, publishing the results in his name; similarly, the Harvard astronomer Cecilia Payne-Gaposchkin’s work on stellar atmospheres – later hailed as ‘the most brilliant PhD thesis ever written in astronomy’ – was diminished and then co-opted by her advisor Henry Russell. But the astronomical contributions of Leavitt, Payne-Gaposchkin and others eventually led to a progressive social perception: that women could research the cosmos on equal ground with their male colleagues.
Hubble returned spectacular ‘baby pictures’ of the Eagle Nebula’s ‘Pillars of Creation’
NASA honoured Hubble decades later with the eponymous telescope that launched into outer space in 1990. Its grand mission was to research black holes, the solar system and, through its unparalleled sensitivity to visible wavelengths, the most distant galaxies in the Universe. But there was an issue: the telescope returned fuzzy images. After five missions to outer space, astronauts repaired the mirror, which NASA described as ‘fix[ing] the flaw much the same way a pair of glasses correct[s] the vision of a near-sighted person.’ In 1995, the now beloved and long-lived telescope returned spectacular ‘baby pictures’ of the Eagle Nebula’s ‘Pillars of Creation’ – billowing columns of gas and dust that are inchoate stars. The Hubble Deep Field layered 342 separate exposures over 10 days in 1995 to show thousands of young galaxies 12 billion lightyears away. Astronomers confirmed that matter is evenly distributed at very large scales, further evidence of an expanding and cooling post-Big Bang universe. Though scientists had suspected the prevalence of black holes in the Universe, they learned from Hubble images that supermassive black holes cluster at the centre of galaxies. The visual metaphors that NASA and the media used to describe Hubble’s technical attributes (‘needing glasses’, or capturing the Universe’s ‘baby pictures’) extended to material revelations. Astronomers used the data to unveil Pluto’s minuscule moon Styx, to analyse the aurorae around Ganymede and infer its saltwater ocean, and even to fortuitously catch the Refsdal supernova’s overpowering luminescence as the star explodes and dies. The Hubble telescope was also crucial to astronomers’ observations of distant supernovae in 1998 that revealed that the Universe is not only expanding, but accelerating. The mysterious ‘dark energy’ pushes spacetime to the unfathomable sublime, and accounts for about two-thirds of the Universe, forcing physicists to fundamentally rethink cosmological models.
Coming out of the 1970s, particle physicists struggled to unify cosmological theories to describe all matter in the Universe. Recalling his days as a graduate student, the physicist Alan Guth at MIT tells me he was driven by the assumption that ‘nature was governed by a strong sense of simplicity.’ But the observable Universe (its density, its composition) wasn’t matching the theoretical models, leading Guth to develop the concept of cosmic inflation: the early Universe had undergone exponential expansion from 10-36 to around 10-32 seconds after the Big Bang, accounting for density fluctuations that led to the large-scale structure of galaxies and, ultimately, the physical conditions for life.
Cosmic inflation strongly supported the Big Bang explanation. Data from NASA satellites in the 1990s further confirmed what the physicists Arno Penzias and Robert Wilson had detected in 1964 – the crackle of microwave radiation that is the afterglow of the Big Bang. In 1992, scientists used satellite data from the Cosmic Background Explorer (COBE) to announce that they had evidence of temperature fluctuations in the early Universe that had led to the creation of gravity, allowing matter to clump together and form galaxies, stars and planets. Before, Guth explained, ‘you could choose to believe the thermal spectrum if you wanted to.’ But, he adds, ‘it was pretty easy not to because the data was so scattered.’
The data made a connection between the beginning of light 13 billion years ago and the origin of matter
Guth remembers that the COBE’s ‘absolutely gorgeous data changed cosmology overnight from being a speculative exercise to a precision science. It really was spectacular.’ David Kaiser, also an MIT physicist who collaborates with Guth, notes how special that moment was back in 1992, when Kaiser was a senior at Dartmouth College and the faculty raised a Champagne toast. ‘It was so unusual – this moment of awe – that these fluctuations had been measured at all, let alone relatively convincingly, let alone in a pattern so consistent with what Alan [Guth] and others had calculated a decade in advance.’ At a lecture at Vassar College in 2016, the Nobel Prize winner John Mather, who led the mission, told the audience (myself included!) that, when the COBE image was revealed, it received a standing ovation, cheers and tears.
The above images display minute fluctuations in the temperature of light from when the Universe was very young. The patterns of slightly hotter (in yellow or orange) and slightly cooler (slightly blue or green) temperatures give evidence to cosmic inflation. The COBE (top left) was just the beginning of cosmology as a ‘precision science’; data from the Wilkinson Microwave Anisotropy Probe (WMAP), launched in 2001 (top right), and the Planck satellite, launched in 2009 (bottom), let astrophysicists describe shape, density, size and rate of expansion of the Universe in ever-increasing detail.
The profound effects of these data extended beyond the physics community because they helped make a connection between the beginning of light about 13 billion years ago and the origin of matter, the stuff not only of superclusters of galaxies, but of human DNA, a butterfly’s wing, a blue whale. ‘We are in essence formed from little quantum ripples in the sky,’ mused Kaiser. Cosmic inflation links the unfathomably small and swift with the magnificently grand and long-lasting. The bubbling quantum world only a trillionth of a second old scales to the cobwebs of galactic superstructures that developed over billions of years. Reconciling the physical mechanics of two worlds – the quantum and the cosmological – could unlock answers to the future of the Universe and life on worlds beyond Earth.
As recently as 1992, although Earthlings could see the myriad stars that pricked the night sky and had long dreamed about other worlds beyond Earth, astronomers had not yet confirmed if our Sun was unique in hosting planets. But, as of February 2023, astronomers had detected 5,250 exoplanets, mostly through the Kepler space telescope and the Transiting Exoplanet Survey Satellite (TESS). These telescopes use the transit method, in which an exoplanet crossing the face of its host star causes that star to dim. Astronomers calculate the planet’s diameter, orbital period and temperature – characteristics to evaluate a planet’s Earthliness. As a graduate student in the 1990s, the exoplanet hunter Sara Seager at MIT pioneered a technique to study atmospheres of planets as they transited and were backlit by their star. One goal of JWST is to home in on these atmospheres for potential biosignatures.
This process is far from straightforward. Even in our own solar system, the methane on Mars is not a biosignature; we haven’t linked ingredients of life to an actual detection of life. This summer, Seager’s team will use the JWST to observe TRAPPIST-1, a system 40 lightyears away. If the astronomers get incredibly lucky, they could speculatively use the JWST’s spectrometer (a device that separates light into distinct wavelengths to determine the atmosphere’s chemicals) to observe the transits, establish the existence of an atmosphere, and infer extant water vapour. ‘That would be a giant milestone: just knowing that there’s one or more rocky planets with water oceans,’ Seager told me. The JWST could offer tantalising hints to life beyond Earth. ‘We might not get there, but we’re the ones who can first really be on the doorstep of actually doing that.’ With the next instrument, scientists might be able to walk through.
The variety of detections from outer-space telescopes has prompted astronomers to imagine unfamiliar combinations of alien suns and exoplanets where life could be otherwise. The JWST promises to spark at least as many questions about cosmological richness as it attempts to answer. The astrobiologist Sara Walker at Arizona State University told me: ‘We’re realising how little we know about these exoplanets, and how limited our ability to infer, even from very obvious features in atmospheric spectra, other characteristics.’ The JWST will study exoplanetary atmospheres that could be similar in composition to Earth’s (mostly nitrogen and oxygen) but that would be scant evidence for living processes.
There may be alternative pathways for exoplanets to have developed life, including ones without liquid water
Instead, for Walker, JWST is an instrument that will set the stage for re-perceiving a deeply complex process that results in what we now call life. ‘We’ve had this fixation on looking for the molecules,’ Walker explained, ‘but we need to start looking for a theory of life that is about more than complexity, information or evolution.’ Using Earth as a foil for the extraterrestrial, Walker says: ‘When I characterise our planet as one with life on it, I say that our planet has 4 billion years of acquired memory.’ Successor instruments might go beyond mere spectra to be able to detect causal structures of living processes. ‘We need new ways of seeing,’ she told me, ‘and they may not be the same kinds of technologies of perception we had before.’
Penny Boston, the former director of NASA’s Astrobiology Institute, came to the concept of ‘weird life’ – life as we don’t yet know it – through her work in caves. ‘Caves [often] have a very particular aroma,’ she told me, from microorganisms. Bacteria, archaea, fungi, yeast and ‘other weird things that are perched on borders between these groups’ express the ‘beautiful choreography of an ecosystem … that’s just as perfectly complex as an Amazon rainforest.’ These eclectic ecosystems suggest that there may be alternative pathways for exoplanets to have developed life, including ones without liquid water as a solvent. The JWST data on exoplanetary atmospheres and planet formation, complementary to, or divergent from, Earth’s pathway, could yield a generalised theory of life. ‘Candidate properties can be eventually applied to exoplanets and also other bodies in the solar system.’
The meaningfulness of JWST data go beyond what new insights might be gained from the images alone. ‘While the images themselves are striking and allow us to look at new things in the Universe, it’s also about the introspective process,’ Walker told me. ‘It’s the fact that we’re part of a physical system, on a tiny planet, that can build a machine that allows us to see so deeply into the Universe that, to me, is the most profound feature of those images.’ Extended external ‘sensibility’ leads to new modes of human self-perception as intelligent, technological, self-conscious Earthlings that are imbricated with, and contributors to, our planet’s ‘acquired memory’.
Leaping from the Moon, our solar system, the Milky Way, to secret pockets of outer space, I have told a story of an expanding universe of knowledge shaded by empirical, social and philosophical reformations. Galileo saw far-flung moons twirling and twinkling around Jupiter, further disrupting ancient cosmologies that placed Earth at the centre of all things. Leavitt’s creation of a cosmic yardstick aided Hubble to evince the vastness of outer space. And astronomers’ use of the Hubble Telescope unveiled unsettling mysteries about the long future of the cosmos.
Last summer, the JWST alighted 1 million miles away from Earth. Astronomers held their breath as NASA engineers sent commands to the telescope to unfurl its tennis court-sized sunshield and puzzle together its aureate, honeycombed-shaped mirrors. Each of the sunshield’s membrane layers are as thin as a human hair. As you read this, photons that have travelled billions of lightyears are streaming onto the JWST’s mirrors, extending the gaze of astronomers to just 100 million years after the Big Bang. They will analyse this ancient light at the edge of time, perhaps to link how black holes might have helped shape galaxies, a question that the Hubble Telescope posed but left unanswered. They tilt the JWST’s mirrors to peer closely at habitable planets, perhaps like Earth – rocky, watery, lively – that extraterrestrial humans might travel to in the future.
Although Kant erroneously postulated in the mid-18th century that ‘elevated classes of rational creatures’ inhabited Jupiter and Saturn, his prediction that extraterrestrials exist might not be wrong. By extending, clarifying and amplifying their ability to ‘see’, astronomers have stretched their sensibility to otherworldly objects. Before and after Kant’s writings, detections have shifted humans’ perception of the natures of the Universe and posed further conundrums. We might therefore compare the accumulation of knowledge not to the linear arrow of time moving teleologically but instead to scalar expansion of the Universe; here, like a balloon being filled, each point represents a centre. Each centre point might be lensed by a novel tool of perception, like a spectrometer or prism, to see light differently and illuminate our perception of the cosmos. Such lenses abet ever-changing theories about the stuffs and spacetimes on, and beyond, Earth."""
tokens = word_tokenize(text_data)
matrix = {}
for i in range(len(tokens)-1):
curr_word = tokens[i]
next_word = tokens[i+1]
if curr_word not in matrix:
matrix[curr_word] = {}
if next_word not in matrix[curr_word]:
matrix[curr_word][next_word] = 0
matrix[curr_word][next_word] += 1
generated_text = ""
curr_word = random.choice(tokens)
for i in range(20):
generated_text += curr_word + " "
if curr_word not in matrix:
break
next_word_probs = matrix[curr_word]
total_count = sum(next_word_probs.values())
next_word_cumprobs = [sum(next_word_probs[w] for w in next_word_probs.keys() if w <= word) / total_count for word in sorted(next_word_probs.keys())]
rand = random.random()
for j, p in enumerate(next_word_cumprobs):
if rand < p:
curr_word = sorted(next_word_probs.keys())[j]
break
print('Generated Output:',generated_text)