Theory
તમારું calculator જે crash થવાની ના પાડે છે
કોઈ પણ calculator માં 1 ÷ 0 type કરો: error આવશે. Real numbers માં √(−4) માંગો: ફરી error.
દરેક function પાસે એવા inputs હોય છે જે એ સીધા accept જ ના કરે. જે inputs એ accept કરી શકે એ set એટલે એનું domain, અને આ domain શોધવાનું આ unit નો સૌથી વધારે વાર પૂછાતો exam question છે. અને એ જે outputs ખરેખર આપે એ set એટલે range. આજે તમે આ બન્ને ઝડપથી શોધતાં શીખશો.
Theory
એક bus route
Function ને એક bus route ની જેમ વિચારો. Domain એટલે એ બધા stops જ્યાં passengers ચઢી શકે. Codomain એટલે route map પર છપાયેલા બધા stops. અને range એટલે એ stops જ્યાં bus આજે ખરેખર કોઈને ઉતારે છે. અમુક છપાયેલા stops પર bus કદાચ કોઈ દિવસ કોઈને ના પણ ઉતારે, અને એ જ તો છે range ⊊ codomain.
Theory
Domain શોધવું: forbidden values ને શોધી કાઢો
Real-valued formulas માટે, domain એટલે બધા real numbers, પણ એ values બાદ કરીને જે આ 3 નિયમમાંથી કોઈ એક તોડે:
- denominator 0 થઈ જાય
- square root (કે કોઈ પણ even root) નીચેની expression negative થઈ જાય
- logarithm નું argument positive ના હોય
Example: f(x) = 1/(x − 3) માં x = 3 પર પહેલો નિયમ તૂટે છે, એટલે domain એટલે 3 સિવાયના બધા reals.
Quiz
Real numbers પર f(x) = √(x − 2) નું domain શું છે?
- બધા real numbers
- એવા બધા x જ્યાં x ≥ 2
- એવા બધા x જ્યાં x > 2
- 2 સિવાયના બધા x
Show the answer
એવા બધા x જ્યાં x ≥ 2
Root નીચેની expression એ x − 2 ≥ 0 satisfy કરવી પડે, એટલે x ≥ 2. ધ્યાન રાખો કે x = 2 ચાલે છે: √0 = 0 exist કરે છે. Option C ખોટી રીતે 2 ને બહાર કાઢે છે (એ strictness તો logarithm અને denominator માટે હોય છે), અને option D એ root ના problem પર division નો નિયમ લગાડે છે.
Theory
Range શોધવું: ખરેખર બહાર શું આવે છે
Range પૂછે છે: કઈ y values ખરેખર produce થાય છે?
2 standard રસ્તા છે:
- Algebra: built-in limits ને ઓળખો. y = x² ક્યારેય negative ના થઈ શકે, એટલે એનું range છે y ≥ 0.
- Graph: range એટલે curve નો vertical spread, graph જેટલી height સુધી પહોંચે એ બધું.
Range ને હંમેશા set કે inequality તરીકે લખો, કોઈ ઢીલા વર્ણન તરીકે નહીં.
Think first
f(x) = x² + 5, domain બધા real numbers.
Tap કરતાં પહેલાં મનમાં જ range નક્કી કરો. આ machine સૌથી નાનું output કેટલું આપી શકે?
Show the answer
Range = બધા y ≥ 5.
x² એ ઓછામાં ઓછું 0 હોય, એટલે x² + 5 ઓછામાં ઓછું 5 હોય, અને 5 થી ઉપરની દરેક value કોઈક x થી પહોંચી શકાય છે. પેલો +5 આખા range ને ઉપર ઉંચકી લે છે: આ shift તમે કોઈ પણ "x² plus એક constant" વાળા exam question પર ફરી ગણ્યા વગર વાપરી શકો.
Theory
3 types: one-one, onto, bijective
Functions ને એ રીતે classify કરાય છે કે inputs અને outputs કેવી રીતે જોડાય છે:
- Injective (one-one): જુદા જુદા inputs હંમેશા જુદા outputs આપે. Formally, f(a₁) = f(a₂) હોય તો a₁ = a₂ થવું જ પડે.
- Surjective (onto): codomain નો દરેક element hit થાય; range = codomain.
- Bijective: બન્ને એકસાથે, perfect pairing, ના કોઈ double થાય ના કોઈ miss.
Example: ℤ પર f(x) = x + 1 એ bijective છે. પણ ℝ પર f(x) = x² એ બેમાંથી એકેય નથી: f(2) = f(−2) એ one-one ને મારી નાખે છે, અને negative targets ક્યારેય hit થતાં નથી.
Quiz
f: ℝ → ℝ, f(x) = x². આ surjective (onto) કેમ નથી?
- કારણ કે f(2) અને f(−2) સરખા છે
- કારણ કે codomain માંના negative numbers ક્યારેય outputs બનતા નથી
- કારણ કે એનું domain negative numbers ને બહાર કાઢે છે
- કારણ કે એ function જ નથી
Show the answer
કારણ કે codomain માંના negative numbers ક્યારેય outputs બનતા નથી
Onto પૂછે છે: શું codomain નો દરેક element પહોંચાય છે? કોઈ x એવો નથી જે x² = −1 આપે, એટલે જવાબ ના. Option A એક સાચી વાત છે, પણ એ ONE-ONE ને ખોટું પાડે છે, onto ને નહીં; આ 2 definitions ને અલગ રાખવાનું જ examiners ચકાસે છે. Domain માં negatives છે જ, અને f એ એકદમ valid function છે.
Watch out
3 ભૂલો જે marks ખાઈ જાય છે
Question માં codomain પૂછ્યું હોય ત્યાં range લખી નાખવું (function onto ના હોય ત્યાં સુધી બન્ને જુદા છે). Root ના domains માં boundary ને બહાર કાઢી નાખવું (x ≥ 2 માં 2 આવે છે; ફક્ત division અને log માં strict inequality આવે). અને f(2) = f(−2) વાળી દલીલ onto ને ખોટું પાડવા વાપરવી, જ્યારે એ તો one-one ને ખોટું પાડે છે. આ 3 જગ્યાએ થોડું ધીમા પડજો.
Theory
આ ફરી ક્યાં મળશે
Code માં input validation એ ખરેખર domain thinking જ છે: જે values formula ને crash કરે એને reject કરો. Hash functions નો અભ્યાસ એ રીતે થાય કે એ one-one થી કેટલા દૂર છે, અને bijection એ જ કારણ છે કે encryption ને બરાબર એક જ key થી undo કરી શકાય છે. આગળનો topic: tables અને graphs માંથી function formulas બનાવવા.
Summary
Key takeaways
- Domain = allowed inputs; division by zero, even roots નીચે negatives, અને non-positive log arguments ને બહાર કાઢો.
- Range = ખરેખર produce થતાં outputs; એને algebraic limits માંથી કે graph ના vertical spread માંથી વાંચો.
- Range ⊆ codomain, અને બરાબર ત્યારે જ equality આવે જ્યારે function onto હોય.
- One-one: કોઈ 2 inputs એક જ output share ના કરે. Onto: codomain નો કોઈ element miss ના થાય. Bijective: બન્ને.
- યાદ રાખવાની trick: domain એટલે guest list, range એટલે ખરેખર કોણ આવ્યું.