brunch

You can make anything
by writing

C.S.Lewis

by 안영회 습작 Aug 26. 2022

튜플이란 무엇인가?

수학을 써보기 5

학창 시절 수포자였지만, 사회에서 만난 분들이 수포자는 아닌 것 같다고 용기를 주셔서 잊을만하면 한 번씩 수학 공부를 한다.


튜플이란 무엇인가?

이번에는 페친 김현승님이 튜플 이야기를 하셔서 짬을 내서 잠깐 공부해본다.


좋아하는 사전 찾기를 해본다.

In mathematics, a tuple is a finite ordered list (sequence) of elements. An n-tuple is a sequence (or ordered list) of n elements, where n is a non-negative integer. There is only one 0-tuple, referred to as the empty tuple. An n-tuple is defined inductively using the construction of an ordered pair.

일단 수학에서는 정렬된 유한 목록(finite ordered list)이다. 학창 시절 수포자지만, 그때 배운 스칼라가 생각난다.


컴공(혹은 컴퓨터 과학)에서 정의는 어떻게 다를까?

In computer science, tuples come in many forms. Most typed functional programming languages implement tuples directly as product types, tightly associated with algebraic data types, pattern matching, and destructuring assignment. Many programming languages offer an alternative to tuples, known as record types, featuring unordered elements accessed by label. A few programming languages combine ordered tuple product types and unordered record types into a single construct, as in C structs and Haskell records. Relational databases may formally identify their rows (records) as tuples.

함수형 언어에서는 Product Types(응)라는 모르는 형태로 구현된다고 한다. 공부할 것이 생겼다. 그리고, C 나 Golang에도 있는 struct 가 튜플의 예이고, RDBMS에서 레코드가 튜플이라고 한다.


그냥 좀 더 훑어보니

(더 이상 궁금한 것이 없어 끝내려니) 허전해서 더 훑어보니 Names for tuples of specific lengths라는 표가 등장한다. 자바 개발할 때 너무나도 자주 듣던 Sigleton이 등장한다. 유의어로 어디선가 들어본 monad도 병기되어 있다.


Singleton도 사전을 보니 수학적 정의가 있네. 원소가 오직 하나인 집합이구만.

In mathematics, a singleton, also known as a unit set, is a set with exactly one element. For example, the set {null } is a singleton containing the element null.

 

유의어인 Monad는 철학적 표현인 모양이다. 단위의 의미이군.

Monad (philosophy), a term meaning "unit"

내가 '단위'를 주제로 책도 읽고 생각놀이도 많이 했는데... 구글링으로 다시 위키피디아 정의를 또 찾았다.

In functional programming, a monad is a software design pattern with a structure that combines program fragments (functions) and wraps their return values in a type with additional computation. <중략>

함수형 언어의 디자인 패턴인데, 함수들을 조합한 뒤에 반환 값을 하나의 타입으로 감싼 것이라고 한다. 알쏭달쏭하다. (함수형 언어로 프로그래밍해본 일이 없으니...) 구글링 결과로 단자란 우리말 번역과 해독 불가능한 위키백과 설명도 나온다.

출처: 구글

그리고 친숙한 일상 용어와 악단(밴드) 표현법 등을 발견했다.

couple / twin / dual / twosome

triple / triad / threesome

quadruple / quad

octa / octet

decade


지난 수학을 써보기 연재

1. 수학을 일상으로

2. 다양한 함수의 정의와 표현

3. 함수형 인간 재개

4. 치역과 공역을 일상에서 찾아봤다

작가의 이전글 개체(시스템)의 재설계와 경계의 변경
작품 선택
키워드 선택 0 / 3 0
댓글여부
afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari