변수·등식·방정식: 같은 자료를 다른 단위로 읽기Variables, equalities and equations: reading the same data in different units
작은 계산을 이해하고, 실제 관측을 읽고, 같은 원리를 증명하기까지.Understand a small calculation, read actual observations and prove the underlying principle.
실제 자료: Palmer 펭귄 344행 · 2007–2009년 관측 · 사본 다운로드 2026-10-20 · 실습 4종 · 풀이 포함 연습문제 16개Actual data: 344 Palmer penguin rows · observations 2007–2009 · snapshot 2026-10-20 · four labs · 16 exercises with solutions
기초Foundations
1. 숫자에 이름표를 붙이자1. Give a number its label
연구 노트에 3750이라고 적혀 있습니다. 이것만 보고 무엇을 알아낼 수 있을까요? 펭귄의 몸무게일 수도 있고, 상품 가격이나 시험 참가자의 번호일 수도 있습니다. 숫자만으로는 뜻을 정할 수 없습니다. 먼저 무엇을, 어떤 단위로, 어느 관측에서 측정했는지 알아야 합니다.
이 장에서는 남극에서 실제로 측정한 펭귄 자료를 읽습니다. 첫 번째 행의 body_mass_g는 3750입니다. 열 이름의 g는 그램이라는 단위입니다. 따라서 이 값은 3750마리나 3750킬로그램이 아니라 한 개체의 질량 3750g을 나타냅니다. 같은 개체의 질량을 kg으로 쓰면 3.75kg입니다. 펭귄이 갑자기 가벼워진 것이 아닙니다. 같은 양을 더 큰 단위로 적어서 수치가 작아진 것입니다.
이를 돈으로 비유할 수 있습니다. 10,000원과 1만원은 같은 금액입니다. ‘10,000’과 ‘1’만 비교하면 전자가 훨씬 커 보이지만 단위까지 읽으면 같습니다. 자료 분석에서도 이 구분이 계산보다 먼저입니다. 숫자를 정확히 계산해도 단위를 잘못 붙이면 결론은 틀릴 수 있습니다.
준비: 사칙연산, 분수의 뜻, 1kg=1000g. 계산기를 써도 됩니다. 행렬이 나오는 마지막 심화 절은 선형대수를 배운 뒤 돌아와도 됩니다.
A research note contains the number 3750. What does it describe? It might be a penguin's mass, a price, or an identification number. A number alone does not determine its meaning. We first need to know what was measured, in which unit, and for which observation.
This chapter uses real measurements collected from Antarctic penguins. In the first row, body_mass_g is 3750. The suffix g means grams. The value therefore represents one penguin's mass of 3750g, rather than 3750 birds or 3750 kilograms. In kilograms, the same mass is 3.75kg. The bird has not become lighter: using a larger unit makes the numerical value smaller.
Consider currency. 10,000 won and one unit of 10,000 won describe the same amount. Comparing only the numbers 10,000 and 1 would conceal this equality. In data analysis, reading units comes before calculation. Perfect arithmetic cannot rescue an interpretation based on the wrong unit.
Prerequisites: arithmetic, the meaning of a fraction and 1kg=1000g. A calculator is welcome. Return to the final matrix-based extension after studying linear algebra.
기초Foundations
2. 문자는 모르는 수를 가리키는 이름이다2. A symbol is a name for a number
사과 한 개 가격을 아직 모를 때 매번 ‘사과 한 개의 가격’이라고 쓰면 식이 길어집니다. 그 가격의 수치를 p라고 부르기로 합시다. p는 특별한 물건이 아니라 우리가 붙인 이름입니다. 여기서는 단위를 원/개로 정합니다. 같은 p를 어떤 줄에서는 개수, 다른 줄에서는 총액으로 쓰면 안 됩니다.
사과 3개를 사고 배송비 500원을 냈다면 총액의 수치는 3p+500입니다. 3은 개수이고, 3p는 사과 세 개의 금액입니다. 배송비와 더할 때 두 항 모두 원 단위여야 합니다. 예를 들어 p=1500을 넣으면 3×1500+500=5000입니다. 이 대입은 문자가 실제 계산에서 무슨 역할을 하는지 보여줍니다.
3p+500
식은 계산할 관계를 나타냅니다. 3p+500은 식이며, p가 정해져야 한 수로 계산됩니다. 등식은 두 표현이 같다고 말합니다. 3×1500+500=5000은 참인 등식입니다. 방정식은 미지수의 어떤 값이 등식을 참으로 만드는지 찾는 문제입니다. 3p+500=5000에서는 p=1500이 그 역할을 합니다.
함께 헷갈리기 쉬운 말이 변수와 미지수입니다. 여러 펭귄의 몸무게처럼 관측마다 값이 달라지는 수를 변수라고 부를 수 있습니다. 특정 방정식을 풀 때 아직 모르는 값은 미지수입니다. 같은 문자도 문맥에 따라 역할이 달라지므로, 처음 사용할 때 의미·단위·가능한 범위를 적어야 합니다.
잠깐 확인: p=1500은 ‘모든 사과 가격’에 관한 사실일까?
아닙니다. 이 예제는 방정식의 원리를 설명하려고 정한 가정 사례입니다. 시장 가격을 관측한 자료가 아닙니다. 실제 가격을 주장하려면 조사 시점·상품 규격·판매처·가격 자료가 필요합니다.
When the price of one apple is unknown, repeatedly writing “the price per apple” is cumbersome. Let p name its numerical value, measured in won per apple. The letter is a label we choose. It must not mean a quantity of apples in one line and a total payment in another.
Buying three apples with a delivery charge of 500 won gives a total numerical amount of 3p+500. Here 3 counts apples and 3p is the amount paid for the apples. Both terms must be expressed in won before addition. Substituting p=1500 gives 3×1500+500=5000. Substitution connects a symbol to an actual calculation.
3p+500
An expression describes a calculation. The expression 3p+500 becomes a number once p is specified. An equality says that two expressions have equal values: 3×1500+500=5000 is true. An equation asks which unknown values make an equality true. In 3p+500=5000, p=1500 does so.
A variable may take different values, as mass does across penguin observations. An unknown is a value we are trying to determine in a particular problem. The same letter can play different roles in different contexts. Define its meaning, unit and allowable range when introducing it.
Does p=1500 describe the price of all apples?
No. This is an explicitly assumed example for learning algebra, not observed market-price data. A claim about actual prices needs a date, product specification, seller and data source.
기초Foundations
3. 방정식은 양쪽이 같은 저울이다3. An equation is a balanced scale
3p+500=5000을 저울로 생각해 봅시다. 왼쪽에는 ‘사과 3개의 금액과 배송비 500원’이 있고, 오른쪽에는 ‘총액 5000원’이 있습니다. 양쪽이 같은데 왼쪽에서만 500을 빼면 저울이 기울어집니다. 양쪽에서 똑같이 500을 빼야 같은 상태를 유지합니다.
3p+5003p+500−5003pp=5000=5000−500=4500=1500
마지막 단계는 양쪽을 3으로 나눈 것입니다. 왼쪽에는 같은 가격 p가 세 번 들어 있으므로, 세 몫으로 똑같이 나누면 한 개의 가격이 나옵니다. ‘500을 반대쪽으로 넘기면 부호가 바뀐다’고 외워도 답을 낼 수는 있습니다. 그러나 그 이유는 양쪽에 같은 연산을 했기 때문입니다. 이유를 알아두면 복잡한 식에서도 무엇을 해도 되는지 판단할 수 있습니다.
이제 원래 식에 대입해 검산합니다. 3×1500+500=4500+500=5000이므로 맞습니다. 풀이 중간의 식만 확인하는 것보다, 처음 문제의 조건을 다시 만족하는지 확인하는 것이 중요합니다. 실제 분석 코드도 같은 방식으로 원래 단위와 조건에 대조해야 합니다.
양변에 같은 수를 더하거나 빼는 연산은 되돌릴 수 있습니다. 0이 아닌 수로 곱하거나 나누는 것도 되돌릴 수 있습니다. 0으로 나누는 것은 허용되지 않습니다. 예를 들어 0×p+500=5000은 해가 없고, 0×p+500=500은 모든 p가 해입니다. 숫자 하나가 빠졌다고 임의로 답을 채우면 안 됩니다.
더 일반적으로 ap+b=c에서 a≠0이면 먼저 b를 빼고 a로 나누어 해를 얻습니다. 이 식은 암기용 정답보다 왜 해가 하나로 정해지는지 설명하는 도구입니다.
ap+b=c,a=0⟹p=ac−b
Imagine 3p+500=5000 as a balanced scale. On the left are the cost of three apples and a 500-won delivery charge; on the right is the 5000-won total. Subtracting 500 from the left alone would upset the balance. Subtract the same 500 from both sides.
3p+5003p+500−5003pp=5000=5000−500=4500=1500
In the last step, divide both sides by 3. Three identical portions of price p make 4500, so one portion is 1500. A memorized rule about moving terms across the equals sign can hide the reason: we performed the same operation on both sides. Understanding the reason helps determine which transformations remain valid in more complex equations.
Verify the answer in the original equation: 3×1500+500=4500+500=5000. Checking the initial conditions matters more than merely inspecting an intermediate expression. Analytical code also needs verification against the original quantities and conditions.
Adding or subtracting the same number from each side is reversible. Multiplication or division by a nonzero number is reversible too. Division by zero is undefined. The equation 0×p+500=5000 has no solution, while 0×p+500=500 holds for every p. We cannot invent a unique answer just because a procedure expects one.
For ap+b=c with a≠0, subtract b and divide by a. The general expression explains why the solution is unique, rather than supplying a rule to memorize without conditions.
ap+b=c,a=0⟹p=ac−b
기초Foundations
4. 되돌릴 수 있는 계산이 해를 지킨다4. Reversible steps preserve the solutions
방정식을 푸는 목표는 식을 짧게 만드는 데서 끝나지 않습니다. 처음 식을 만족하던 값들을 그대로 남겨야 합니다. 예를 들어 x+3=5의 양쪽에서 3을 빼면 x=2가 됩니다. 반대로 3을 더하면 처음 식으로 돌아갑니다. 두 식은 허용된 x에 대해 같은 해를 가지므로 동치라고 합니다.
그런데 양쪽에 같은 일을 했다고 항상 동치인 것은 아닙니다. x=3의 양쪽을 제곱하면 x²=9입니다. 처음 해는 3 하나지만 새 식에는 −3도 들어옵니다. 제곱은 양수와 음수의 차이를 지워 버리므로, 역으로 돌아가려면 부호 조건을 확인해야 합니다.
x=3⟹x2=9,x2=9⟹x∈{−3,3}
나눗셈에서도 같은 주의가 필요합니다. x(x−2)=0을 x로 나누면 x−2=0이라서 2를 얻습니다. 하지만 x=0도 처음 식을 만족합니다. x로 나누는 순간 x≠0을 가정했으므로 그 해가 빠진 것입니다. 처음부터 x=0인 경우와 x≠0인 경우를 나누면 해를 잃지 않습니다. 두 번째 경우에만 나누어 x=2를 얻고, 두 경우를 합쳐 {0,2}라고 답합니다.
원래 식에 대입하면 잘못 추가된 후보를 걸러 낼 수 있습니다. 그러나 도중에 버린 해가 있다는 사실은 후보 대입만으로 알기 어렵습니다. 따라서 풀이 과정의 조건 확인과 마지막 대입 검산을 함께 해야 합니다. 이 예들의 수는 대수 원리를 설명하기 위해 정한 값이며 관측 자료는 아닙니다.
Solving an equation is more than shortening an expression. We must retain exactly the values that satisfied the original equation. Subtracting three from both sides of x+3=5 gives x=2. Adding three reverses the step. The equations have the same solutions in the allowed domain, so they are equivalent.
Doing the same thing to both sides does not always preserve equivalence. Squaring both sides of x=3 gives x²=9. The original has only the solution three, but the new equation also admits minus three. Squaring erases the distinction between opposite signs, so reversing the step requires checking the sign restrictions.
x=3⟹x2=9,x2=9⟹x∈{−3,3}
Division requires similar care. Dividing x(x−2)=0 by x yields x−2=0 and hence two. But zero also satisfies the original equation. Division silently assumed x≠0 and lost that solution. Separate x=0 from x≠0. Only in the second case may we divide and obtain two. Combining the cases gives {0,2}.
Substitution can reject an extra candidate introduced by a transformation. It cannot, by itself, reveal a solution discarded earlier. We therefore need both condition checks during the argument and substitution at the end. These numbers are assumed teaching examples, not observations.
기초Foundations
5. 함수는 입력과 출력을 연결하는 규칙이다5. A function connects an input to an output
모든 펭귄의 질량을 그램에서 킬로그램으로 바꿀 때, 개체마다 새로운 변환 규칙을 만들 필요는 없습니다. 입력 수치를 x, 출력 수치를 f(x)라고 쓰면 같은 규칙을 여러 관측에 적용할 수 있습니다. 여기서 x는 그램으로 표시한 수치이고, f(x)는 킬로그램으로 표시한 수치입니다.
f(x)=1000x,f(3750)=3.75
함수 f는 어떤 허용된 입력에 대해 하나의 출력을 정합니다. 이 장의 단위 변환은 음수가 아닌 질량 수치를 입력으로 받습니다. 순수한 수학식 x/1000은 음수도 계산할 수 있지만, 살아 있는 펭귄의 질량을 설명하는 모형에서는 그 범위를 허용하지 않습니다. 식을 계산할 수 있는 범위와 현실의 의미가 있는 범위를 구별해야 합니다.
변환은 되돌릴 수 있습니다. 3.75kg에 1000을 곱하면 3750g입니다. 단위 자체를 곱셈의 분수처럼 읽으면 왜 나누는지도 확인할 수 있습니다. g가 약분되고 kg가 남아야 합니다.
3750g×1000g1kg=3.75kg
이 변환은 모르는 자연 법칙을 자료로 추정한 결과가 아닙니다. 단위의 정의에 따른 정확한 관계입니다. 나중에 ‘날개 길이로 몸무게를 예측하는 함수’를 배울 때는 관측 오차·개체 차이·추정 오차가 생깁니다. 같은 함수 기호를 쓰더라도, 단위 변환의 항등식과 자료에서 추정한 예측식을 같은 것으로 생각하면 안 됩니다.
We do not need a new rule for each penguin when converting grams to kilograms. Let x denote the input numerical value and f(x) the output. Here x is the number expressed in grams, and f(x) is the number expressed in kilograms.
f(x)=1000x,f(3750)=3.75
A function assigns one output to each allowed input. For this physical application, the inputs are nonnegative mass values. The mathematical expression x/1000 can also be evaluated at negative numbers, but those numbers do not describe the mass of a living penguin. Separate the mathematical domain from the range that makes sense in an application.
The conversion is reversible: multiplying 3.75kg by 1000 gives 3750g. Treating the conversion factor as a fraction of units shows why division is appropriate. Grams cancel and kilograms remain.
3750g×1000g1kg=3.75kg
This relation is not a natural law estimated from observations. It follows exactly from the definition of the units. A future function predicting mass from flipper length will involve individual variation, measurement error and estimation error. Sharing function notation does not make a fitted prediction identical to a conversion identity.
기초Foundations
6. Case study: 실제 현장 관측을 읽기6. Case study: reading real field measurements
이 자료는 Palmer Station LTER와 Kristen Gorman 연구진이 공개한 펭귄 관측을, Horst·Hill·Gorman의 palmerpenguins 자료에서 가져온 사본입니다. 관측 기간은 2007–2009년이며 남극의 세 섬, 세 종, 344행이 포함되어 있습니다. 2026년에 새로 측정한 펭귄 자료가 아닙니다. 이번 실습은 2026-10-20에 내려받아 고정한 사본을 사용합니다.
표의 행 번호는 이 학습 사본에서 붙인 위치 표시입니다. 수집 기관의 원래 개체 식별자로 해석하지 마세요. 각 행은 한 개체의 관측이며, 종은 종류, 날개 길이는 mm, 질량은 g, 연도는 관측 연도를 뜻합니다. ‘2007’은 몸무게처럼 평균으로 비교할 대상이 아니라 시점을 나타내는 열입니다.
실제 학습 사본의 첫 다섯 행 · NA는 관측 없음
사본 행
종
날개 (mm)
질량 (g)
kg
1
Adelie
181
3750
3.75
2
Adelie
186
3800
3.8
3
Adelie
195
3250
3.25
4
Adelie
NA
NA
NA
5
Adelie
193
3450
3.45
첫 세 행의 질량은 3750g, 3800g, 3250g입니다. kg으로 바꾸면 3.75kg, 3.8kg, 3.25kg입니다. 세 질량을 합하면 10,800g이고, 같은 합을 kg으로 쓰면 10.8kg입니다. 먼저 변환해 더하든, 먼저 더한 뒤 변환하든 같습니다. 나눗셈이 덧셈의 각 항에 똑같이 적용되기 때문입니다.
세 관측을 똑같이 나누어 평균을 구하면 3600g, 즉 3.6kg입니다. 평균은 이 세 관측의 요약입니다. 남극의 모든 펭귄이나 모든 종의 ‘진짜 평균’을 이미 알아냈다는 뜻은 아닙니다. 어떤 개체가 관측에 포함되었는지는 단위 변환과 별도로 검토해야 합니다.
These are public field observations from Kristen Gorman and Palmer Station LTER, provided through Horst, Hill and Gorman's palmerpenguins data. They cover 2007–2009, three Antarctic islands, three species and 344 rows. They are not newly measured 2026 observations. This exercise uses a fixed copy downloaded on 2026-10-20.
The row number identifies a position in this teaching copy; it is not the original collector's individual identifier. Each row is an individual observation. Species is a category, flipper length is measured in mm, mass in g, and year records observation time. The value 2007 belongs to the time field; it is not interchangeable with a body measurement.
First five rows of the actual teaching copy; NA means missing
Copy row
Species
Flipper (mm)
Mass (g)
kg
1
Adelie
181
3750
3.75
2
Adelie
186
3800
3.8
3
Adelie
195
3250
3.25
4
Adelie
NA
NA
NA
5
Adelie
193
3450
3.45
The first three masses are 3750g, 3800g and 3250g. In kilograms they are 3.75kg, 3.8kg and 3.25kg. Their total is 10,800g, or 10.8kg. Converting before addition and converting after addition give the same result because the same division distributes over every term.
Dividing the total equally among the three observations gives a mean of 3600g, or 3.6kg. That mean summarizes these three observations. It does not reveal the true mean of every penguin or every species. Which individuals entered the dataset is a separate question from the validity of the conversion.
기초Foundations
7. 실제 요약값에서 한 관측을 역산하기7. Recover an observation from an actual summary
앞에서 읽은 실제 첫 세 질량은 3750g, 3800g, 3250g이고 평균은 3600g입니다. 이제 세 번째 행을 잠시 가리고 x라고 적어 봅시다. 이미 확인한 세 관측의 평균과 나머지 두 값을 함께 안다는 조건에서 x를 되찾는 문제입니다. 결측인 다른 펭귄을 추측하는 문제와 다릅니다.
33750+3800+x=3600⟺7550+x=10800⟺x=3250
첫 단계에서 양쪽에 3을 곱합니다. 왼쪽의 분모만 없애고 오른쪽을 3600으로 남겨 두면 동치가 아닙니다. 다음에는 양쪽에서 7550을 뺍니다. 원래 식에 넣어 (3750+3800+3250)/3=3600인지 확인합니다. 실제 CSV의 세 번째 관측과도 같은 3250g입니다.
단위를 kg으로 바꾸어 같은 과정을 해 보세요. (3.75+3.8+x)/3=3.6이면 x=3.25kg입니다. 앞의 x는 g 단위 수치, 이번 x는 kg 단위 수치이므로 같은 글자라도 단위 선언이 달라졌습니다. 3.25kg=3250g으로 물리적인 답은 같습니다.
평균을 모르면 어떨까요? 첫 두 값만 알고 세 번째 관측과 세 관측의 평균을 모두 모르면 식이 하나라고 해서 두 수가 자동으로 정해지지는 않습니다. 가정한 평균을 M이라 쓰면 x=3M−7550이라는 관계를 얻을 뿐입니다. M=3600이라는 추가 정보가 있어야 위의 답이 나옵니다.
현장 자료의 빈칸을 이 식으로 채워도 될까?
이번에는 같은 세 행의 평균을 CSV에서 먼저 계산했으므로 가렸던 값을 복원할 수 있습니다. 실제로 측정하지 않은 네 번째 행은 참값도 그 참값을 포함한 평균도 모릅니다. 관측된 평균을 전체 평균으로 가정하고 채우는 것은 별도의 추정 규칙입니다. 단순한 대수적 역산으로 관측 사실을 새로 얻은 것은 아닙니다.
The first three actual recorded masses are 3750g, 3800g and 3250g, with mean 3600g. Hide the third value temporarily and call it x. The question is to recover it given the already verified mean of these same three observations and the other two values. This differs from guessing the unmeasured mass of another bird.
33750+3800+x=3600⟺7550+x=10800⟺x=3250
First multiply both sides by three. Removing the denominator on the left while leaving 3600 unchanged on the right would not preserve the equation. Next subtract 7550 from both sides. Substitution gives (3750+3800+3250)/3=3600, agreeing with the actual third CSV value of 3250g.
Repeat in kilograms: (3.75+3.8+x)/3=3.6 yields x=3.25kg. The earlier x named a numerical value in grams; this x names a value in kilograms. The unit declaration changed, even though the symbol did not. The physical answers agree because 3.25kg=3250g.
What if the mean is unknown? Knowing only the first two values does not determine both the third value and the three-observation mean. Calling the assumed mean M gives the relation x=3M−7550. The additional information M=3600 is needed to obtain the answer above.
May we fill a real missing value this way?
Here we first calculated the mean from the same three complete CSV observations, so we can recover a deliberately hidden entry. For the genuinely unmeasured fourth bird, neither its true mass nor a mean including that mass is known. Filling it by treating an observed mean as the full mean is an additional estimation rule. Algebra alone has not created a new observation.
기초Foundations
8. 빈칸을 0으로 바꾸면 질문이 달라진다8. Replacing a blank with zero changes the question
첫 다섯 행의 질량을 읽어 보면 네 번째 행은 비어 있습니다. 이것은 ‘질량이 0g인 펭귄이 있었다’는 관측이 아닙니다. 이 사본에 질량 측정값이 없다는 뜻입니다. 프로그램에서 빈칸을 0으로 바꾸면 존재하지 않는 측정값을 새로 만든 셈이 됩니다.
관측된 네 값의 합은 3750+3800+3250+3450=14,250g입니다. 관측된 질량들의 평균이라는 질문에 답하려면 4로 나누어 3562.5g을 얻습니다. 빈칸을 0으로 바꾸고 5로 나누면 2850g이 나옵니다. 같은 조사 기록을 다루면서도 평균이 712.5g 낮아졌습니다. 이는 펭귄이 가벼워진 결과가 아니라 처리 규칙을 바꾼 결과입니다.
그렇다고 결측을 무조건 지우면 모든 문제가 해결되는 것도 아닙니다. 측정되지 않은 개체가 특별히 크거나 작았을 가능성을 이 네 값만으로 배제할 수 없습니다. 이 장에서는 관측된 값만의 요약이라고 범위를 적습니다. 결측이 생긴 이유와 더 넓은 모집단 추론은 통계학에서 따로 다룹니다.
전체 사본의 질량은 344행 중 342행에서 관측되어 있습니다. 질량과 날개 길이를 함께 그릴 때도 두 값이 모두 있는 342행을 사용합니다. 사용하지 못한 2행은 0g 점으로 그리지 않습니다. 실습 화면의 관측 수와 내려받는 코드에서 이 수를 직접 확인하세요.
생각해 보기: 시험 결시를 0점으로 입력하는 것과 같을까?
결시를 0점으로 처리하는 규칙이 미리 정해져 있는 시험이라면, 그 변수는 ‘채점 규칙이 정한 성적’입니다. 하지만 미측정 질량을 0으로 바꾸는 것은 관측 사실을 바꾸는 일입니다. 숫자 0을 넣기 전에 변수가 무엇을 의미하는지와 처리 규칙을 분리해야 합니다.
The fourth of the first five rows has no recorded mass. This does not mean that a penguin with mass 0g was observed. It means that the measurement is absent in this copy. Replacing the blank with zero manufactures a measurement.
The four observed masses sum to 3750+3800+3250+3450=14,250g. To summarize the observed masses, divide by four and obtain 3562.5g. Filling the blank with zero and dividing by five yields 2850g, a decrease of 712.5g. The birds did not become lighter: the processing rule changed the answer.
Deleting missing entries is not automatically sufficient either. These four values cannot rule out the possibility that the unmeasured bird was unusually large or small. Here we explicitly report a summary of observed measurements. The missingness mechanism and inference about a broader population belong to later statistical study.
In the complete copy, mass is observed in 342 of 344 rows. The scatterplot of mass and flipper length also uses 342 rows with both measurements. The two excluded rows are not plotted as zero-mass birds. Verify these counts in the laboratory and downloadable code.
Is this like giving an absent student a score of zero?
If an examination explicitly defines absence as zero under its grading rule, the recorded variable is a rule-based score. Replacing an unmeasured physical mass with zero changes a claim about observation. Define the variable and the processing rule before inserting a numerical zero.
기초Foundations
9. Case study: 단위가 바뀌어도 관측은 같다9. Case study: changing the unit preserves the observations
가로축에 날개 길이, 세로축에 질량을 그려 봅시다. 한 점은 한 펭귄입니다. 첫 행은 가로 181mm, 세로 3750g의 위치에 놓입니다. 세로축을 kg으로 바꾸면 같은 점은 181mm, 3.75kg으로 표시됩니다. 종·섬·연도나 개체의 순서가 바뀌지는 않습니다.
화면에서 세로축의 범위도 같은 비율로 바꾸면 점들의 배치는 같습니다. 세로 눈금에 붙은 수와 단위가 달라집니다. 반대로 눈금 범위를 고정한 채 수치만 1000으로 나누면 점들이 아래에 몰려 보일 수 있습니다. 같은 현상을 그래프로 비교하려면 수치 변환과 축의 정의를 함께 확인해야 합니다.
아래에서는 먼저 예상한 뒤 단위를 바꾸세요. 선택한 관측은 검은 테두리로 표시되며, 다른 종은 색과 모양으로 구분합니다. 자료 표도 함께 열어 좌표를 검산할 수 있습니다. 산점도의 질량 축은 관측 범위를 읽기 위해 0보다 큰 값에서 시작합니다.
관측된 점들이 함께 증가하는 모양이라고 해서 날개를 늘리는 개입이 몸무게를 늘린다고 결론 내릴 수는 없습니다. 종·성별·생물학적 특성 등이 함께 관련될 수 있습니다. 이 장에서 확인한 것은 단위 변환과 좌표의 관계입니다. 관계의 관찰, 예측, 원인 효과는 서로 다른 질문이며 뒤 과목에서 각각 조건을 배웁니다.
Place flipper length on the horizontal axis and mass on the vertical axis. Each point represents one penguin. The first row lies at 181mm and 3750g. Switching the vertical unit to kilograms labels the same point as 181mm and 3.75kg. Its species, island, year and position in the dataset do not change.
If the axis range is converted by the same factor, the geometric arrangement of points stays the same: numerical tick labels and units change. Dividing values by 1000 while holding the old numerical axis limits fixed could instead squash the points near the bottom. Comparing graphs requires checking both the transformation and the axis definition.
Predict the effect before changing the unit. The selected observation has a black outline, while species use distinct colors and shapes. Open the data table to verify coordinates. The mass axis starts above zero to display the observed range; this is explicitly a scatterplot rather than a bar chart.
A joint upward pattern would not show that stretching a flipper causes a bird to gain mass. Species, sex and other biological features may be associated with both. This chapter establishes the relation between units and coordinates. Observational association, prediction and causal effect are different questions with different conditions, studied later in the series.
심화Advanced
10. 심화: 단위가 이웃을 바꿀 수도 있다10. Advanced: a unit change can alter a nearest neighbour
선수 지식: 벡터·제곱거리·행렬 곱. 아직 배우지 않았다면 이 절의 처음 두 문단과 실험의 관찰까지만 읽고, 증명은 수리기초의 선형대수 파트를 마친 뒤 돌아오세요.
펭귄의 날개 길이와 질량을 한꺼번에 사용해 ‘가장 비슷한 관측’을 찾는다고 합시다. 숫자끼리 그냥 뺀 뒤 제곱하여 더하는 규칙을 정할 수 있습니다. 그런데 mm의 제곱과 g의 제곱은 물리적으로 같은 단위가 아닙니다. 이 합은 자연이 정해 준 거리가 아니라 분석자가 선택한 수치상의 거리 규칙입니다.
길이 차이를 Δℓ, 그램 질량 차이를 Δm이라고 하면 아래 두 규칙은 일반적으로 같은 순위를 주지 않습니다. kg으로 바꿀 때 질량 차이 항만 백만분의 일로 작아지기 때문입니다. 표의 실제 관측을 사용한 기하 실험에서 이웃을 확인하세요. 이는 분류기의 시험 성능 측정이 아닙니다.
draw2=(Δℓ)2+(Δm)2,dkg2=(Δℓ)2+(1000Δm)2
정리: 좌표를 바꾸어도 같은 거리를 유지하는 조건
가역 행렬 D로 좌표를 z=Dx로 바꾸고, 원래 제곱거리를 ΔxᵀWΔx로 정의합시다. W는 대칭 양의 준정부호 행렬입니다. 새 좌표에서 아래의 W′를 사용하면 모든 두 점의 제곱거리가 정확히 보존됩니다.
W′=D−⊤WD−1,(Δz)⊤W′(Δz)=(Δx)⊤W(Δx)
증명. 두 점의 차이도 Δz=DΔx입니다. 이를 새 거리 식에 넣고 행렬 곱을 순서대로 계산하면 DᵀD⁻ᵀ와 D⁻¹D가 각각 단위행렬이 되어 사라집니다. 남는 항은 원래 거리입니다. 여기서 D가 가역이라는 조건이 없으면 역행렬을 사용할 수 없습니다.
(DΔx)⊤D−⊤WD−1(DΔx)=(Δx)⊤W(Δx)
이 결과는 ‘어떤 단위든 그대로 거리 계산에 넣어도 된다’는 뜻이 아닙니다. 좌표를 바꿀 때 거리의 가중치도 함께 변환해야 같은 기준이 유지된다는 뜻입니다. 실제 머신러닝에서 표준화의 평균·표준편차를 훈련 자료로만 구하는 것은 또 다른 문제인 정보 누수를 막기 위한 조건입니다. 단위를 일관되게 다루는 것과 시험 정보를 숨기는 것은 각각 따로 충족해야 합니다.
여기서 W가 양의 정부호라면 제곱근은 거리입니다. 양의 준정부호만 가정하면 서로 다른 두 점의 값도 0일 수 있으므로 준거리입니다. 예를 들어 W=diag(1,0)이면 (0,0)과 (0,1)은 이 규칙에서 거리가 0입니다. 좌표 변환의 보존식은 두 경우 모두 성립합니다.
Prerequisites: vectors, squared distances and matrix multiplication. If these are new, read the first two paragraphs and observe the experiment, then return to the proof after the linear-algebra part of Mathematical Foundations.
Suppose we use both flipper length and mass to find the most similar observation. We could subtract numerical coordinates, square each difference and add. But squared mm and squared g are not the same physical unit. Their sum is an analyst-chosen numerical metric, not a distance dictated by nature.
Let Δℓ denote a flipper-length difference and Δm a mass difference in grams. The two rules below need not rank neighbours in the same order. Converting grams to kilograms reduces only the mass-squared term by a factor of a million. Explore this geometric effect using actual observations below; the experiment does not measure classifier test performance.
draw2=(Δℓ)2+(Δm)2,dkg2=(Δℓ)2+(1000Δm)2
Proposition: preserving a distance after changing coordinates
Let z=Dx for an invertible matrix D. Define the original squared distance by ΔxᵀWΔx, where W is symmetric positive semidefinite. Choosing W′ as below preserves the squared distance of every pair of points.
W′=D−⊤WD−1,(Δz)⊤W′(Δz)=(Δx)⊤W(Δx)
Proof. The coordinate difference transforms as Δz=DΔx. Substitute it into the new metric. Matrix multiplication cancels DᵀD⁻ᵀ and D⁻¹D to identity matrices, leaving the original quadratic form. Without invertibility, these inverse matrices would not be available.
(DΔx)⊤D−⊤WD−1(DΔx)=(Δx)⊤W(Δx)
The result does not say that raw numerical distances ignore units. It says that metric weights must transform along with coordinates to preserve the same notion of distance. In predictive machine learning, estimating scaling means and standard deviations only from training data addresses another issue: information leakage. Unit consistency and separation of test information are distinct requirements.
If W is positive definite, the square root is a metric. With positive semidefiniteness alone it is a pseudometric: distinct points can have zero distance. For example, W=diag(1,0) assigns zero distance to (0,0) and (0,1). The coordinate-invariance identity holds in either case.
기초Foundations
11. 코드로 다시 계산하고 글로 해석하기11. Reproduce the calculation and interpret it
이 화면의 그림만 믿지 말고 내려받은 CSV를 직접 읽어 보세요. 아래 Python 코드는 외부 통계 패키지 없이 실행됩니다. CSV와 코드를 같은 폴더에 놓고 python chapter01.py를 실행하면 전체 행 수, 질량 관측 수, 단위 변환, 첫 다섯 행의 두 가지 평균을 확인하고 결과 표 CSV를 저장합니다. R 코드도 같은 값과 분석 행을 사용합니다.
프로그램의 계산 순서는 자료를 읽기 → 빈칸을 결측으로 보존하기 → 관측 수 확인하기 → g를 kg으로 변환하기 → 원래 단위로 되돌려 검산하기 → 결과 저장하기입니다. ‘아무 오류 없이 실행됐다’는 것과 ‘원래 질문에 맞는 계산을 했다’는 것은 다릅니다. 코드의 관측 수와 손계산을 함께 대조하세요.
짧은 분석 보고서 과제: 다음 네 문장을 자기 말로 완성하세요. ① 무엇을 언제 관측한 자료인가? ② 왜 344가 아니라 342행을 그렸는가? ③ g와 kg으로 바꾸었을 때 무엇이 바뀌고 무엇이 그대로인가? ④ 이 그림에서 원인 효과나 모든 펭귄의 평균을 주장할 수 없는 이유는 무엇인가?
좋은 보고서는 숫자만 나열하지 않습니다. 예를 들어 ‘이 사본에서 질량이 있는 342행을 kg으로 변환했다. 단위의 정의에 따른 변환이므로 원래 g값으로 되돌릴 수 있다. 이 관측이 모든 펭귄을 무작위로 대표하는지와 날개 길이의 인과 효과는 이번 계산으로 확인하지 않았다’라고 범위를 함께 씁니다.
Do not rely only on the on-screen chart. Read the downloaded CSV yourself. The Python companion uses only the standard library. Put it beside the CSV and run python chapter01.py. It checks row counts, observed masses, conversions and the two means for the first five rows, then writes a result CSV. The R companion uses the same observations and definitions.
The sequence is: read data; preserve blanks as missing; verify counts; convert g to kg; reverse the conversion as a check; save results. Running without an exception does not show that a program answered the intended question. Compare its counts and values with the hand calculations.
Short analytical report: complete four statements in your own words. ① What was observed, and when? ② Why does the chart contain 342 rather than 344 rows? ③ What changes, and what stays fixed, when g becomes kg? ④ Why does the chart alone not establish a causal effect or the population mean of all penguins?
A sound report does more than list numbers. For example: “I converted the 342 observed masses in this copy to kilograms. The conversion follows from the unit definition and can be reversed to recover grams. This calculation did not establish random representation of every penguin or a causal effect of flipper length.” State the analytical scope alongside the results.
먼저 풀이를 접어 둔 채 풀어 보세요. 오답이면 단위·사용한 관측·허용한 범위를 다시 적고 해설과 대조합니다.Attempt each problem before opening the solution. On a wrong answer, restate units, observations and allowed domains before checking the explanation.
1. 의미 읽기Read the meaning
자료의 row_id=10과 body_mass_g=3750에서 각각 숫자가 뜻하는 것은 무엇인가? 두 숫자의 평균을 구하면 무엇이 문제인가?
What do row_id=10 and body_mass_g=3750 mean? Why would their average be meaningless?
풀이와 확인할 이유Solution and explanation
행 위치 표시와 질량 수치다. 서로 다른 의미와 단위의 값을 한 변수처럼 더했다.
They denote a row position and a mass measurement. Averaging them treats different meanings and units as one variable.
2. 단위 변환Convert units
실제 첫 행 3750g을 kg으로 쓰고, 반대로 되돌려 확인하라.
Convert the first observed 3750g to kg and reverse the calculation.
풀이와 확인할 이유Solution and explanation
3750÷1000=3.75kg, 3.75×1000=3750g. 변환 전후는 같은 질량이다.
3750/1000=3.75kg and 3.75×1000=3750g: the same mass in different units.
3. 반대 방향Reverse direction
실제 두 번째 행은 3.8kg이다. g으로 바꿀 때 1000으로 나누면 왜 틀리는가?
The second observation is 3.8kg. Why is dividing by 1000 wrong when converting to g?
풀이와 확인할 이유Solution and explanation
큰 단위 kg에서 작은 단위 g으로 쓰면 수치가 1000배가 된다. 3800g이며 0.0038g이 아니다.
Expressing kg in the smaller unit g multiplies the numerical value by 1000, giving 3800g, not 0.0038g.
4. 방정식과 검산Solve and verify
가정한 가격식 4p+600=6600을 풀고 검산하라.
Solve the assumed pricing equation 4p+600=6600 and verify.
Subtract 600 to obtain 4p=6000; divide by 4 to obtain p=1500. Substitution gives 6000+600=6600.
5. 해가 없는 경우No solution
0p+500=700과 0p+500=500의 해를 비교하라.
Compare solutions of 0p+500=700 and 0p+500=500.
풀이와 확인할 이유Solution and explanation
첫 식은 500=700을 요구해 해가 없다. 둘째는 허용된 모든 p가 해다. 두 경우 모두 0으로 나누어 해결할 수 없다.
The first demands 500=700 and has no solution. The second holds for every allowed p. Neither case can be resolved by dividing by zero.
6. 현실의 범위Check the domain
가정한 가격식 2p+1000=600의 대수적 해와 가격 해석을 구분하라.
Separate the algebraic solution of 2p+1000=600 from its price interpretation.
풀이와 확인할 이유Solution and explanation
해는 p=−200이다. 음의 단가를 허용하지 않는 가정에서는 가능한 구매 사례가 아니다. 계산값을 0으로 바꾸면 원래 식을 만족하지 않는다.
The algebraic solution is p=−200. It is infeasible under a nonnegative-price assumption. Replacing it by zero would not satisfy the original equation.
7. 결측 처리Handle missingness
첫 다섯 행의 관측된 질량 평균과 빈칸을 0으로 채운 평균을 각각 구하라.
Compute the observed-only and zero-filled means for the first five rows.
풀이와 확인할 이유Solution and explanation
합 14,250g. 관측된 4개 평균 3562.5g. 0을 넣은 5개 평균 2850g. 차이 712.5g은 처리 규칙이 만든 것이다.
The sum is 14,250g. The four observed values average 3562.5g; zero-filling and dividing by five gives 2850g. The processing rule creates the 712.5g difference.
8. 평균의 변환Transform a mean
관측 질량 x₁,…,xₙ을 모두 1000으로 나누면 평균도 1000으로 나누어진다는 것을 분배법칙으로 보이라.
Use distributivity to show that dividing every observed mass by 1000 divides the mean by 1000.
풀이와 확인할 이유Solution and explanation
(x₁/1000+…+xₙ/1000)/n=(x₁+…+xₙ)/(1000n)=원래 평균/1000. 양쪽에서 같은 n개의 관측을 사용해야 한다.
Σ(xᵢ/1000)/n=(Σxᵢ)/(1000n)=the original mean/1000. Both sides must use the same n observations.
9. 자료를 직접 확인하기Inspect the actual data
CSV에서 전체 행 수, 질량 관측 수, 질량과 날개 길이가 모두 있는 행 수를 구하라.
Count all rows, observed masses, and rows with both mass and flipper length in the CSV.
풀이와 확인할 이유Solution and explanation
각각 344, 342, 342행이다. 빈칸을 0으로 바꾸지 않고 두 열의 관측 여부를 검사한다.
The counts are 344, 342 and 342. Check whether both fields are observed without replacing blanks with zero.
10. 그래프의 해석Interpret the chart
kg 단위 그래프에서 y좌표가 작아졌으니 펭귄이 더 가벼워졌다는 문장을 고쳐라.
Correct the claim that smaller y-values in kg mean the birds became lighter.
풀이와 확인할 이유Solution and explanation
같은 질량을 더 큰 단위로 표시해 수치가 작아졌다. 관측과 실제 질량은 그대로이며 축의 단위·범위도 함께 읽어야 한다.
The numerical values are smaller because the same mass is expressed in a larger unit. The observations and physical masses stay fixed; read units and axis ranges together.
11. 심화: 거리의 반례Advanced: a metric counterexample
질의점 (0,0), 후보 A=(0,100), B=(3,0)이 있다. 두 번째 좌표를 100으로 나누기 전후의 최근접 후보를 계산하라. 이는 가정한 수치 예시다.
For query (0,0), candidates A=(0,100), B=(3,0), compute the nearest candidate before and after dividing the second coordinate by 100. These are assumed numbers.
풀이와 확인할 이유Solution and explanation
원래 제곱거리는 A=10000, B=9로 B가 가깝다. 변환 후에는 A=1, B=9로 A가 가깝다. 한 좌표의 단위만 바꾸고 동일한 수치 거리 규칙을 쓰면 순위가 바뀔 수 있다.
Originally squared distances are 10000 to A and 9 to B, so B is nearer. After transformation they are 1 and 9, so A is nearer. Changing one coordinate unit while retaining the same raw metric can change the ranking.
12. 심화: 보존 조건Advanced: preserve the metric
W=I이고 D=diag(1,1/1000)일 때 같은 거리를 보존하는 W′를 구하라.
For W=I and D=diag(1,1/1000), find W′ that preserves the original distance.
풀이와 확인할 이유Solution and explanation
D⁻¹=diag(1,1000), 따라서 W′=diag(1,1000000)이다. 변환된 질량 좌표의 제곱에 백만의 가중치를 주어 원래의 수치 거리로 되돌린다. 그 원래 거리가 과학적으로 적절한지는 별도 판단이다.
D⁻¹=diag(1,1000), so W′=diag(1,1000000). Weighting the transformed mass coordinate squared by a million recovers the original numerical metric. Whether that original metric is scientifically appropriate remains a separate question.
13. 나누면서 버린 해A solution lost by division
x(x−2)=0을 x로 나눈 뒤 x=2라고만 답했습니다. 빠진 해를 찾고, 원래 식에 대입한 뒤 나누기가 허용되는 조건을 설명하세요.
Someone divides x(x−2)=0 by x and reports only x=2. Find the lost solution, check it in the original equation, and state when division was allowed.
풀이와 확인할 이유Solution and explanation
x=0이면 0×(−2)=0이므로 해입니다. x≠0인 경우에만 x로 나누어 x−2=0, 즉 x=2를 얻습니다. 2×0=0도 확인합니다. 두 경우를 합쳐 해는 {0,2}입니다. 0을 원래 식에 넣는 것과 0으로 나누는 것은 다른 일입니다.
At x=0 the original left side is 0×(−2)=0. Only in the x≠0 case may we divide and obtain x=2, which also gives 2×0=0. Combining cases yields {0,2}. Substituting zero into the original expression differs from dividing by zero.
14. 제곱으로 추가된 후보A candidate added by squaring
x−1=2를 제곱해 (x−1)²=4로 바꿨습니다. 새 식의 두 후보를 구하고 원래 방정식의 해와 비교하세요.
Squaring x−1=2 gives (x−1)²=4. Find the two candidates of the new equation and compare them with the original solution.
풀이와 확인할 이유Solution and explanation
새 식은 x−1=2 또는 x−1=−2여서 x=3 또는 −1입니다. 처음 식에 3을 넣으면 2=2, −1을 넣으면 −2=2가 되어 후자는 탈락합니다. 제곱한 식은 필요한 조건이지만 원래 식과 동치는 아닙니다. 해집합 {3}이 {−1,3}으로 넓어진 것입니다.
The squared equation gives x−1=2 or −2, hence x=3 or −1. Substitution into the original gives 2=2 for three and −2=2 for minus one, rejecting the latter. The squared equation is a necessary condition, not an equivalent equation: {3} expanded to {−1,3}.
15. 실제 세 관측의 역산Recover the actual third observation
실제 첫 두 질량은 3750g, 3800g이고 같은 첫 세 행의 평균은 3600g입니다. 세 번째 질량을 구하고 kg 단위 식으로도 확인하세요.
The first two actual masses are 3750g and 3800g, and the mean of these same first three rows is 3600g. Recover the third mass and check in kilograms.
풀이와 확인할 이유Solution and explanation
(3750+3800+x)/3=3600의 양변에 3을 곱하면 7550+x=10800입니다. 7550을 빼서 x=3250g입니다. kg으로는 (3.75+3.8+z)/3=3.6, 따라서 z=10.8−7.55=3.25kg입니다. 서로 같은 질량이며 CSV 세 번째 값과 일치합니다.
Multiply both sides of (3750+3800+x)/3=3600 by three to obtain 7550+x=10800. Subtracting 7550 gives 3250g. In kilograms, (3.75+3.8+z)/3=3.6 gives z=10.8−7.55=3.25kg, the same mass and the actual third CSV value.
16. 관측되지 않은 값을 남겨 두기Leave an unmeasured value unknown
첫 다섯 행의 관측 질량 네 개의 합은 14250g입니다. 빠진 질량을 m이라 할 때 다섯 개 질량의 평균 M을 식으로 나타내세요. m=2500과 4000은 관측이 아닌 가정입니다. 각각의 M을 구하고 참값을 결정할 수 있는지 설명하세요.
Four recorded masses among the first five rows sum to 14250g. Express the five-mass mean M in terms of the missing mass m. The alternatives m=2500 and 4000 are assumptions, not observations. Compute both means and explain whether the true value is determined.
풀이와 확인할 이유Solution and explanation
M=(14250+m)/5입니다. 가정 m=2500이면 M=16750/5=3350g, m=4000이면 M=18250/5=3650g입니다. 관측된 네 값만으로 두 가정 중 어느 것이 참인지 정할 수 없습니다. 관측값 평균 14250/4=3562.5g은 다른 질문의 답이며, m의 실제 측정치로 바꾸어 쓸 수 없습니다.
M=(14250+m)/5. Under the assumed m=2500, M=16750/5=3350g; under m=4000, M=18250/5=3650g. The four observations do not choose between these assumptions. Their observed-only mean 14250/4=3562.5g answers a different question and is not an actual measurement of m.
관측 자료는 CC0로 공개된 사본입니다. 원 자료·가공 사본·검산값은 서로 구분하며, 행 번호는 학습 사본에서 부여했습니다. The observations are a copy of public CC0 data. Original source files, processed teaching copies and verification results are distinguished; row numbers are assigned in the teaching copy.