MAT2033 · 4. hafta · sets and functions

Fonksiyonlar: birebir, örten, ters, bileşke, floor ve ceiling

Bir fonksiyonun one-to-one ve onto olduğunu ispatlama şablonu, ters fonksiyon, bileşke ve floor/ceiling. Vizede 1-1/onto ispatı ve floor/ceiling hesabı neredeyse kesin.

functiondomaincodomainrangeimagepreimageone-to-one (injective)onto (surjective)bijectioninverse functioncompositionidentity functionfloor functionceiling functionincreasing function

Fonksiyon kavramını lise matematiğinden biliyorsun, ama ayrık matematikte fonksiyon bir formül değil, bir eşlemedir. Vizede neredeyse kesin bir soru: “Determine whether ff is one-to-one, onto, both or neither. Prove your answers. If it is a bijection, find its inverse.” Bu soru şablonla çözülür. Yanına genelde bir floor/ceiling hesabı ya da bileşke eklenir.

Altın kurallar:

  1. Fonksiyon = domain’deki her elemana tam bir çıktı. İki çıktı ya da hiç çıktı yoksa fonksiyon değil.
  2. 1-1 ispatı f(x)=f(y)f(x) = f(y) ile başlar, x=yx = y ile biter.
  3. Onto ispatı keyfi yy ile başlar, xx‘i çözersin, xx‘in domain’de olduğunu söylersin.
  4. “Değil” demek için tek somut örnek yeter.
  5. Domain ve codomain cevabı değiştirir. Aynı formül R\mathbb{R}‘de bijection, Z\mathbb{Z}‘de değil olabilir.

Tanım

AA ve BB boş olmayan kümeler olsun. Fonksiyon (function) f:A→Bf: A \to B, AA‘daki her aa‘ya BB‘den tam bir f(a)f(a) atar.

TerimAnlamıf:Z→Zf: \mathbb{Z} \to \mathbb{Z}, f(x)=x2f(x) = x^2 için
Domaingirdi kümesi AAZ\mathbb{Z}
Codomainizin verilen çıktı kümesi BBZ\mathbb{Z}
Rangegerçekten çıkan değerler f(A)f(A){0,1,4,9,… }\{0, 1, 4, 9, \dots\}
Image of aaf(a)f(a)f(−3)=9f(-3) = 9
Preimage of SSf−1(S)={a∣f(a)∈S}f^{-1}(S) = \{a \mid f(a) \in S\}f−1({4,9})={−3,−2,2,3}f^{-1}(\{4, 9\}) = \{-3, -2, 2, 3\}

Range her zaman codomain’in alt kümesi. Preimage tanımı ters fonksiyon gerektirmez; her fonksiyon için tanımlıdır.

Fonksiyon olmayan şeyler: f:R→Rf: \mathbb{R} \to \mathbb{R}, f(x)=1/xf(x) = 1/x (x=0x = 0 için çıktı yok), ya da f(x)=±xf(x) = \pm\sqrt{x} (iki çıktı). Sonlu bir eşleme verilirse her girdinin tam bir okla çıktığına bak.

One-to-one, onto, bijection

ÖzellikTanımSezgi
One-to-one (injective)f(a)=f(b)⇒a=bf(a) = f(b) \Rightarrow a = biki oyuncu aynı forma numarasını taşımaz
Onto (surjective)∀b∈B ∃a∈A, f(a)=b\forall b \in B\ \exists a \in A,\ f(a) = bher forma numarası birine verilmiş
Bijection1-1 ve ontooyuncu ve numara birebir eşleşir

1-1 tanımının contrapositive hali de kullanılır: a≠b⇒f(a)≠f(b)a \ne b \Rightarrow f(a) \ne f(b).

Sonlu kümelerde kısa yollar. ∣A∣>∣B∣\lvert A \rvert > \lvert B \rvert ise ff 1-1 olamaz (güvercin yuvası). ∣A∣<∣B∣\lvert A \rvert < \lvert B \rvert ise onto olamaz. ∣A∣=∣B∣\lvert A \rvert = \lvert B \rvert ise 1-1 ile onto aynı şeydir; birini göstermek yeter.

Şablon ve çözümlü örnekler

Örnek 1. f:R→Rf: \mathbb{R} \to \mathbb{R}, f(x)=4−3xf(x) = 4 - 3x.

One-to-one. Suppose f(x) = f(y). Then 4 − 3x = 4 − 3y, so −3x = −3y
and x = y. Hence f is one-to-one.
Onto. Let y ∈ R be arbitrary. Take x = (4 − y)/3. Then x ∈ R and
f(x) = 4 − 3·(4 − y)/3 = 4 − (4 − y) = y. Hence f is onto.
So f is a bijection, and f⁻¹(y) = (4 − y)/3.

xx‘i nereden buldun? Taslakta y=4−3xy = 4 - 3x‘i xx için çözdün. Sınavda taslağı değil, sonucu yaz ve "x∈Rx \in \mathbb{R}" demeyi unutma.

Örnek 2. g:Z→Zg: \mathbb{Z} \to \mathbb{Z}, g(n)=n2g(n) = n^2.

  • 1-1 değil: g(2)=g(−2)=4g(2) = g(-2) = 4, ama 2≠−22 \ne -2.
  • Onto değil: g(n)≥0g(n) \ge 0 olduğu için −1-1 hiç çıkmaz. (Ya da 2: tam kare değil.)

Örnek 3. h:Z→Zh: \mathbb{Z} \to \mathbb{Z}, h(n)=⌊n/2⌋h(n) = \lfloor n/2 \rfloor.

  • 1-1 değil: h(4)=h(5)=2h(4) = h(5) = 2.
  • Onto: m∈Zm \in \mathbb{Z} için n=2mn = 2m al, h(2m)=mh(2m) = m.

Örnek 4. f:Z→Zf: \mathbb{Z} \to \mathbb{Z}, f(n)=2n+3f(n) = 2n + 3 ile f:R→Rf: \mathbb{R} \to \mathbb{R}, f(x)=2x+3f(x) = 2x + 3. İkisi de 1-1. Reel versiyon onto (x=y−32x = \tfrac{y-3}{2}). Tam sayı versiyonu onto değil: 2n+32n + 3 hep tek, 00‘a giden tam sayı yok.

TUZAK · Onto ispatında xx‘in domain’de olduğunu atlamak. x=y−32x = \tfrac{y - 3}{2} buldun. Domain R\mathbb{R} ise sorun yok. Domain Z\mathbb{Z} ise bu xx çoğu yy için tam sayı değil ve ispat çöker. “Take x=⋯∈Ax = \dots \in A” cümlesi puanın yarısı.

Ters fonksiyon (inverse)

ff bijection ise f−1:B→Af^{-1}: B \to A, f−1(b)=a  ⟺  f(a)=bf^{-1}(b) = a \iff f(a) = b. Bijection değilse ters fonksiyon yoktur: 1-1 değilse bir bb‘nin iki geri dönüş yolu olur, onto değilse bazı bb‘lerin hiç yolu olmaz.

Bulma yöntemi: y=f(x)y = f(x) yaz, xx‘i yalnız bırak. Kontrol: f−1(f(x))=xf^{-1}(f(x)) = x.

Sonlu fonksiyonda okları ters çevir: f(1)=cf(1) = c, f(2)=af(2) = a, f(3)=bf(3) = b ise f−1(a)=2f^{-1}(a) = 2, f−1(b)=3f^{-1}(b) = 3, f−1(c)=1f^{-1}(c) = 1.

Bileşke (composition)

f:A→Bf: A \to B, g:B→Cg: B \to C için (g∘f)(x)=g(f(x))(g \circ f)(x) = g(f(x)). Sağdan sola okunur: önce ff, sonra gg.

Örnek. f(x)=x+2f(x) = x + 2, g(x)=3x2g(x) = 3x^2. (g∘f)(x)=3(x+2)2(g \circ f)(x) = 3(x + 2)^2, (f∘g)(x)=3x2+2(f \circ g)(x) = 3x^2 + 2. Genelde g∘f≠f∘gg \circ f \ne f \circ g.

Faydalı gerçekler:

  • ff ve gg 1-1 ise g∘fg \circ f de 1-1. İkisi onto ise g∘fg \circ f de onto.
  • g∘fg \circ f 1-1 ise ff 1-1 (soru 12). g∘fg \circ f onto ise gg onto.
  • f−1∘f=ιAf^{-1} \circ f = \iota_A (identity function), f∘f−1=ιBf \circ f^{-1} = \iota_B.

Floor ve ceiling

FonksiyonTanımEşdeğer eşitsizlik
⌊x⌋\lfloor x \rfloor (floor)xx‘ten küçük-eşit en büyük tam sayı⌊x⌋=n  ⟺  n≤x<n+1\lfloor x \rfloor = n \iff n \le x < n + 1
⌈x⌉\lceil x \rceil (ceiling)xx‘ten büyük-eşit en küçük tam sayı⌈x⌉=n  ⟺  n−1<x≤n\lceil x \rceil = n \iff n - 1 < x \le n
⌊2.4⌋ = 2     ⌈2.4⌉ = 3
⌊−2.4⌋ = −3   ⌈−2.4⌉ = −2     (negatiflerde "kesip atmak" YANLIŞ)
⌊3⌋ = ⌈3⌉ = 3

Özellikler (nn tam sayı): ⌊x+n⌋=⌊x⌋+n\lfloor x + n \rfloor = \lfloor x \rfloor + n, ⌈x+n⌉=⌈x⌉+n\lceil x + n \rceil = \lceil x \rceil + n, ⌈−x⌉=−⌊x⌋\lceil -x \rceil = -\lfloor x \rfloor, x−1<⌊x⌋≤x≤⌈x⌉<x+1x - 1 < \lfloor x \rfloor \le x \le \lceil x \rceil < x + 1. Dikkat: ⌊x+y⌋\lfloor x + y \rfloor genelde ⌊x⌋+⌊y⌋\lfloor x \rfloor + \lfloor y \rfloor değildir (x=y=0.5x = y = 0.5: 11 ile 00).

Çözümlü ispat: ⌊2x⌋=⌊x⌋+⌊x+12⌋\lfloor 2x \rfloor = \lfloor x \rfloor + \lfloor x + \tfrac12 \rfloor

x=n+εx = n + \varepsilon yaz, n=⌊x⌋n = \lfloor x \rfloor, 0≤ε<10 \le \varepsilon < 1. İki durum:

Case 1: 0 ≤ ε < 1/2.
  2x = 2n + 2ε with 0 ≤ 2ε < 1, so ⌊2x⌋ = 2n.
  x + 1/2 = n + (ε + 1/2) with 1/2 ≤ ε + 1/2 < 1, so ⌊x + 1/2⌋ = n.
  Right side: n + n = 2n. Equal.
Case 2: 1/2 ≤ ε < 1.
  2x = 2n + 1 + (2ε − 1) with 0 ≤ 2ε − 1 < 1, so ⌊2x⌋ = 2n + 1.
  x + 1/2 = (n + 1) + (ε − 1/2) with 0 ≤ ε − 1/2 < 1/2, so ⌊x + 1/2⌋ = n + 1.
  Right side: n + (n + 1) = 2n + 1. Equal.  ∎

Floor/ceiling ispatlarının genel hilesi: xx‘i “tam kısım + kesir” diye yaz ve kesrin aralığına göre durumlara böl.

Sık yapılan hatalar

Yanlış düşünceDoğrusu
Range = codomainRange codomain’in alt kümesi; eşitse onto
1-1 ispatı için birkaç değer denemekf(x)=f(y)⇒x=yf(x) = f(y) \Rightarrow x = y genel cebir
Onto ispatında x∈Ax \in A dememekDomain Z\mathbb{Z} ise bulduğun xx tam sayı olmayabilir
2x+32x + 3 her yerde bijectionZ→Z\mathbb{Z} \to \mathbb{Z}‘de onto değil
(g∘f)(x)=f(g(x))(g \circ f)(x) = f(g(x))g(f(x))g(f(x)); önce ff
f−1(y)=1/f(y)f^{-1}(y) = 1/f(y)Ters fonksiyon çarpımsal ters değil
⌊−2.3⌋=−2\lfloor -2.3 \rfloor = -2−3-3; floor hep aşağı
⌊x+y⌋=⌊x⌋+⌊y⌋\lfloor x + y \rfloor = \lfloor x \rfloor + \lfloor y \rfloorSadece biri tam sayıysa garanti
Bijection olmayan fonksiyonun tersini yazmakTers sadece bijection için var

Kendini test et

Sınavdaki gibi İngilizce sorular. Önce kâğıt kalemle çöz, sonra cevabı aç.

Soru 1kolay

Evaluate ⌊−3.7⌋\lfloor -3.7 \rfloor, ⌈−3.7⌉\lceil -3.7 \rceil, ⌊5.2⌋\lfloor 5.2 \rfloor, ⌈5⌉\lceil 5 \rceil and ⌊−12+⌈32⌉⌋\lfloor -\tfrac12 + \lceil \tfrac32 \rceil \rfloor.

Cevabı göster
−4, −3, 5, 5, 1

Sayı doğrusunda düşün: floor sola (aşağı), ceiling sağa (yukarı) gider. −3.7-3.7'nin solundaki tam sayı −4-4, sağındaki −3-3. Tam sayının floor'u da ceiling'i de kendisi: ⌈5⌉=5\lceil 5 \rceil = 5. Son ifade içten dışa: ⌈1.5⌉=2\lceil 1.5 \rceil = 2, −0.5+2=1.5-0.5 + 2 = 1.5, ⌊1.5⌋=1\lfloor 1.5 \rfloor = 1.

Soru 2kolay

Let f:{1,2,3,4}→{a,b,c}f: \{1, 2, 3, 4\} \to \{a, b, c\} with f(1)=bf(1) = b, f(2)=af(2) = a, f(3)=bf(3) = b, f(4)=cf(4) = c. Find the range of ff. Is ff one-to-one? Onto?

Cevabı göster
Range {a, b, c}; onto but not one-to-one

Çıkan değerler a,b,ca, b, c: range codomain'e eşit, yani onto. Ama f(1)=f(3)=bf(1) = f(3) = b, iki farklı girdi aynı çıktı: one-to-one değil. 4 elemanlı bir kümeden 3 elemanlıya giden hiçbir fonksiyon zaten 1-1 olamaz.

Soru 3orta

Let f:Z→Zf: \mathbb{Z} \to \mathbb{Z}, f(n)=3n−1f(n) = 3n - 1. Is ff one-to-one? Onto? Prove your answers.

Cevabı göster
One-to-one, not onto (0 has no preimage)

1-1: Suppose f(m)=f(n)f(m) = f(n). Then 3m−1=3n−13m - 1 = 3n - 1, so 3m=3n3m = 3n, m=nm = n.
Onto değil: y=0y = 0 için 3n−1=0⇒n=13∉Z3n - 1 = 0 \Rightarrow n = \tfrac13 \notin \mathbb{Z}. Hiçbir tam sayı 0'a gitmiyor. Domain R\mathbb{R} olsaydı onto olurdu; domain'e dikkat.

Soru 4orta

Let f:R→Rf: \mathbb{R} \to \mathbb{R}, f(x)=x2−4xf(x) = x^2 - 4x. Is ff one-to-one? Onto? Justify.

Cevabı göster
Neither: f(0) = f(4) = 0, and f(x) ≥ −4 so −5 is not attained

1-1 değil: f(0)=0f(0) = 0, f(4)=16−16=0f(4) = 16 - 16 = 0, ama 0≠40 \ne 4. Onto değil: x2−4x=(x−2)2−4≥−4x^2 - 4x = (x - 2)^2 - 4 \ge -4. Mesela −5-5 hiç çıkmaz. "Değil" iddiası için tek somut örnek yeter.

Soru 5orta

Show that f:R→Rf: \mathbb{R} \to \mathbb{R}, f(x)=7−2xf(x) = 7 - 2x is a bijection and find f−1f^{-1}.

Cevabı göster
f⁻¹(y) = (7 − y)/2

1-1: 7−2x=7−2y⇒−2x=−2y⇒x=y7 - 2x = 7 - 2y \Rightarrow -2x = -2y \Rightarrow x = y.
Onto: Let y∈Ry \in \mathbb{R}. Take x=7−y2∈Rx = \tfrac{7 - y}{2} \in \mathbb{R}. Then f(x)=7−(7−y)=yf(x) = 7 - (7 - y) = y.
Bijection olduğu için ters var ve onto adımında zaten bulduk: f−1(y)=7−y2f^{-1}(y) = \tfrac{7 - y}{2}. Kontrol: f−1(f(3))=f−1(1)=3f^{-1}(f(3)) = f^{-1}(1) = 3.

Soru 6orta

Let f(x)=2x+1f(x) = 2x + 1 and g(x)=x2−3g(x) = x^2 - 3 on R\mathbb{R}. Find (f∘g)(x)(f \circ g)(x), (g∘f)(x)(g \circ f)(x), (f∘g)(2)(f \circ g)(2) and (g∘f)(2)(g \circ f)(2).

Cevabı göster
(f∘g)(x) = 2x² − 5, (g∘f)(x) = 4x² + 4x − 2, (f∘g)(2) = 3, (g∘f)(2) = 22

f∘gf \circ g: önce gg, sonra ff. f(g(x))=2(x2−3)+1=2x2−5f(g(x)) = 2(x^2 - 3) + 1 = 2x^2 - 5. g(f(x))=(2x+1)2−3=4x2+4x−2g(f(x)) = (2x + 1)^2 - 3 = 4x^2 + 4x - 2. x=2x = 2: f(g(2))=f(1)=3f(g(2)) = f(1) = 3, g(f(2))=g(5)=22g(f(2)) = g(5) = 22. Farklı: bileşke değişmeli değil.

Soru 7zor

Let f:R−{1}→R−{2}f: \mathbb{R} - \{1\} \to \mathbb{R} - \{2\}, f(x)=2x+1x−1f(x) = \dfrac{2x + 1}{x - 1}. Prove that ff is a bijection and find f−1f^{-1}.

Cevabı göster
f⁻¹(y) = (y + 1)/(y − 2)

1-1: 2x+1x−1=2y+1y−1\tfrac{2x+1}{x-1} = \tfrac{2y+1}{y-1} ise içler dışlar çarpımı: (2x+1)(y−1)=(2y+1)(x−1)(2x+1)(y-1) = (2y+1)(x-1), yani 2xy−2x+y−1=2xy−2y+x−12xy - 2x + y - 1 = 2xy - 2y + x - 1. Sadeleşince −3x=−3y-3x = -3y, x=yx = y.
Onto: y≠2y \ne 2 verilsin. y=2x+1x−1y = \tfrac{2x+1}{x-1}'i çöz: yx−y=2x+1⇒x(y−2)=y+1⇒x=y+1y−2yx - y = 2x + 1 \Rightarrow x(y - 2) = y + 1 \Rightarrow x = \tfrac{y+1}{y-2}. y≠2y \ne 2 olduğu için tanımlı. Ayrıca x≠1x \ne 1 (yoksa y+1=y−2y + 1 = y - 2 olurdu). Yani xx domain'de ve f(x)=yf(x) = y.f−1(y)=y+1y−2f^{-1}(y) = \tfrac{y+1}{y-2}. Codomain'den 2'nin neden çıkarıldığını görüyorsun: y=2y = 2 için çözüm yok.

Soru 8orta

Let f:Z→Zf: \mathbb{Z} \to \mathbb{Z}, f(n)=⌈n/2⌉f(n) = \lceil n/2 \rceil. Is ff one-to-one? Onto?

Cevabı göster
Onto but not one-to-one

1-1 değil: f(1)=⌈0.5⌉=1f(1) = \lceil 0.5 \rceil = 1 ve f(2)=1f(2) = 1. Onto: herhangi bir m∈Zm \in \mathbb{Z} için n=2mn = 2m al, f(2m)=⌈m⌉=mf(2m) = \lceil m \rceil = m.

Soru 9kolay

Data is stored in bytes of 8 bits. How many bytes are needed for 1000 bits? For 1001 bits?

Cevabı göster
125 and 126

Eksik byte da tam byte kaplar, o yüzden yukarı yuvarla: ⌈1000/8⌉=⌈125⌉=125\lceil 1000/8 \rceil = \lceil 125 \rceil = 125, ⌈1001/8⌉=⌈125.125⌉=126\lceil 1001/8 \rceil = \lceil 125.125 \rceil = 126. "Kaç tane lazım" soruları ceiling, "kaç tane tam sığar" soruları floor.

Soru 10zor

Prove that ⌈x+n⌉=⌈x⌉+n\lceil x + n \rceil = \lceil x \rceil + n for every real xx and every integer nn.

Cevabı göster
Let m = ⌈x⌉, so m − 1 < x ≤ m; then m + n − 1 < x + n ≤ m + n, so ⌈x + n⌉ = m + n.

Ceiling tanımı: ⌈y⌉=m\lceil y \rceil = m ancak m−1<y≤mm - 1 < y \le m ve mm tam sayı ise. m=⌈x⌉m = \lceil x \rceil olsun: m−1<x≤mm - 1 < x \le m. Her tarafa nn ekle: (m+n)−1<x+n≤m+n(m + n) - 1 < x + n \le m + n. m+nm + n tam sayı olduğu için tanım gereği ⌈x+n⌉=m+n=⌈x⌉+n\lceil x + n \rceil = m + n = \lceil x \rceil + n. ∎ Floor/ceiling ispatlarında hep bu eşitsizlik tanımını kullan.

Soru 11orta

How many functions are there from {1,2,3}\{1, 2, 3\} to {a,b}\{a, b\}? How many of them are one-to-one? How many are onto?

Cevabı göster
8 functions, 0 one-to-one, 6 onto

Her girdi için 2 seçenek: 23=82^3 = 8. 1-1 olması için 3 farklı çıktı lazım ama codomain'de 2 eleman var: 0. Onto olmayanlar sadece hepsini aa'ya ya da hepsini bb'ye götüren 2 sabit fonksiyon: 8−2=68 - 2 = 6.

Soru 12zor

Let f:A→Bf: A \to B and g:B→Cg: B \to C. Prove that if g∘fg \circ f is one-to-one, then ff is one-to-one.

Cevabı göster
f(x) = f(y) ⇒ g(f(x)) = g(f(y)) ⇒ x = y

Suppose f(x)=f(y)f(x) = f(y) for x,y∈Ax, y \in A. Apply gg to both sides: g(f(x))=g(f(y))g(f(x)) = g(f(y)), i.e. (g∘f)(x)=(g∘f)(y)(g \circ f)(x) = (g \circ f)(y). Since g∘fg \circ f is one-to-one, x=yx = y. Hence ff is one-to-one. ∎ Dikkat: gg'nin 1-1 olması gerekmez; bu iddia sadece ff hakkında.

Doğrulama: Sonlu fonksiyonlar bütün eşlemeler üretilerek sayıldı; Z üzerindeki 1-1/onto iddiaları -300..300 penceresinde, ters fonksiyonlar ve bileşkeler örnek noktalarda, floor/ceiling özdeşlikleri 50.000 rastgele değerde node ile kontrol edildi (verify/MAT2033/04.mjs).

Deftere not kartı

f: A→B: A'daki HER elemana TAM BİR çıktı. A domain, B codomain, çıkanlar range. 1-1 ispatı: "Suppose f(x)=f(y). Then ... so x=y." 1-1 DEĞİL: f(a)=f(b), a≠b somut örnek (x² için f(1)=f(−1)) Onto ispatı: "Let y∈B. Take x=(y=f(x)'i x için çöz). x∈A and f(x)=y." Onto DEĞİL: çıkmayan y bul (3n−1=0 → n=1/3 ∉ Z) Domain fark eder: 2x+3 R→R bijection, Z→Z onto değil Bijection ⇔ ters var. f⁻¹: y=f(x)'ten x'i çek. Kontrol f⁻¹(f(x))=x (g∘f)(x) = g(f(x)), ÖNCE f. Genelde g∘f ≠ f∘g g∘f 1-1 ⇒ f 1-1 g∘f onto ⇒ g onto Sonlu, |A|=|B|: 1-1 ⇔ onto. |A|>|B| ise 1-1 olamaz. ⌊x⌋=n ⇔ n ≤ x < n+1 ⌈x⌉=n ⇔ n−1 < x ≤ n ⌊−2.3⌋=−3 ⌈−2.3⌉=−2 ⌊x+n⌋=⌊x⌋+n ⌈−x⌉=−⌊x⌋ "kaç tane lazım" ceiling, "kaç tane tam sığar" floor