Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

11th grade-all tasks

2151 views
Kernel: SageMath (stable)

שמות:

%matplotlib -- inline

הפונקציה המעריכית ובסיס הלוגריתמים הטבעי e.

מה המשותף לגידול מושבת חיידקים, חישובי ריבית והתפרקות רדיואקטיבית? התשובה לשאלה זו היא הפונקציה המעריכית. הצורה הכללית של הפונקציה המעריכית היא: f(x)=abxf(x)=a^{b\cdot x} .
a ו- b הם פרמטרים. בסעיף זה תכירו את הפונקציה המעריכית ואת תכונותיה.

נתונה מושבת חיידקים בעלת משאבים לא מוגבלים. חיידק מתחלק בכל 20 דקות. אם מספר החיידקים בזמן מסוים הוא N0N_0 אזי כעבור 20 דקות מספרם יגדל ל-2N02N_0 וכעבור עוד 20 דקות מספרם יגדל ל-4N04N_0. השורה השנייה בטבלה מתארת את מספר החיידקים כתלות בזמן.
806040200t(min)
16N016N_08N08N_04N04N_02N02N_0N0N_0NN
N024N_02^4N023N_02^3N022N_02^2N021N_02^1N020N_02^0NN

השורה השלישית בטבלה מתארת את מספר החלקיקים כתלות במספר פרקי הזמן של 20 דקות שחלפו. אפשר לראות מהטבלה כי הביטוי הכללי למספר החיידקים כתלות בזמן הוא:

N(t)=N02t/20N(t)=N_0\cdot 2^{t/20}
בכל מקרה שבו מושבת חיידקים מתפתחת ללא מגבלה, ניתן למצוא את מספר החיידקים בזמן tt באמצעות הנוסחא: N(t)=N02t/TN(t)=N_0\cdot 2^{t/T}
בנוסחה זו:
N0N_0 הוא מספר החידקים בזמן t=0t=0 ו- TT משך הזמן הממוצע מהרגע שחידק נוצר ועד שהוא מתחלק. N(t)N(t) הוא מספר החידקים בזמן tt.

שאלה

התוכלו להעריך במשך כמה זמן צולם הסרטון שלמטה?
from IPython.display import HTML HTML('<iframe width="640" height="390" src="//www.youtube.com/embed/gEwzDydciWc" frameborder="0" allowfullscreen></iframe>')
כיתבו את תשובתכם כאן. פרטו את חישוביכם
...

דוגמה

נניח כי אדם לוקח הלוואה לא צמודה בבנק בריבית של 5% לשנה. אם הקרן היא 1000 ₪ אזי אחרי שנה האדם יצטרך להחזיר לבנק סכום שגודלו: 10001.05=1050 1000\cdot 1.05=1050 ₪ לאחר שנתיים סכום של: (10001.05)1.05=10001.052=1102.5(1000\cdot 1.05)\cdot 1.05=1000\cdot1.05^2=1102.5₪ ולאחר שלוש שנים סכום שגודלו: ((10001.05)1.05)1.05=10001.053=1157.625((1000\cdot1.05)\cdot1.05)\cdot1.05=1000\cdot1.05^3=1157.625 ₪

גם בתרחיש זה אפשר לתאר את גודל הסכום אותו האדם יצטרך להחזיר כעבור זמן באמצעות הנוסחה 10001.05t1000\cdot 1.05^t .

תרגילים

1. ייבאו את הסיפרייה- matplotlib.pyplot כ- plt.
import matplotlib.pyplot as plt
2. נניח כי צלחת פטרי מכילה 2 חיידקים. כל 20 שניות כל חיידק מתחלק.
a. צרו טבלה של מספר החיידקים כתלות בזמן מזמן אפס עד 5 דקות כל 20 שניות.
b. שרטטו גרף של מספר החיידקים כתלות בזמן . בעזרת הפקודות xlabel, ylabel ו-title השייכות לחבילה pyplot. תנו כותרות לגרף ולצירים.
import matplotlib.pyplot as plt import sympy as sp N0, T, t = sp.symbols("N0 T t") N=N0*2**(t/T) N=N.subs({N0:2,T:20}) x=range(0,320,20) y = [N.subs({t:i}) for i in x] plt.plot(x,y) plt.xlabel('Time (S)') plt.ylabel('N') plt.title('Number of Bacteria Per Second') plt.grid(True) plt.show()
Image in a Jupyter notebook
3.ייבאו את החבילה sympy כ- sp ושרטטו באמצעותה על מערכות צירים נפרדות את הגרפים של כל אחת מהפונקציות הבאות:
y(x)=1.2xy(x)=1.2^xf(x)=4.2xf(x)=4.2^xg(x)=7.3xg(x)=7.3^x
import matplotlib.pyplot as plt import sympy as sp def plotFun(x,y): plt.plot(x,y) plt.xlabel('x') plt.ylabel('y') plt.grid(True) plt.show() x=sp.symbols("x") y=1.2**x f=4.2**x g=7.3**x c=range(-20,21,1) y1 = [y.subs({x:i}) for i in c] y2 = [f.subs({x:i}) for i in c] y3 = [g.subs({x:i}) for i in c] plotFun(c,y1) plotFun(c,y2) plotFun(c,y3) y1
Image in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebook
[0.0260840533045888, 0.0313008639655066, 0.0375610367586079, 0.0450732441103295, 0.0540878929323954, 0.0649054715188745, 0.0778865658226494, 0.0934638789871793, 0.112156654784615, 0.134587985741538, 0.161505582889846, 0.193806699467815, 0.232568039361378, 0.279081647233653, 0.334897976680384, 0.401877572016461, 0.482253086419753, 0.578703703703704, 0.694444444444445, 0.833333333333333, 1, 1.20000000000000, 1.44000000000000, 1.72800000000000, 2.07360000000000, 2.48832000000000, 2.98598400000000, 3.58318080000000, 4.29981696000000, 5.15978035200000, 6.19173642240000, 7.43008370688000, 8.91610044825600, 10.6993205379072, 12.8391846454886, 15.4070215745864, 18.4884258895036, 22.1861110674044, 26.6233332808852, 31.9479999370623, 38.3375999244747]
4.מה המשותף לכל הפונקציות?
שיפוען גדל בצורה חדה
5. הריצו את קטע הקוד שלמטה. שנו את ערכי b ו-a c,בתחומים $-5

עבור איזה ערכים של a ו-b הפונקציה עולה? יורדת? קבועה?

%matplotlib -- inline import sympy as sp sp.var("x,a,b") def graph(f,a1=1,b1=1): sp.plot(f.subs([(a,a1),(b,b1)]),(x,-3,3)) f = a**(b*x) for i in range(-5,6,1): for j in range(0,11,1): graph(f,j,i) #the function is perment when when be equals to 0 and when a equals to 1, and it goes up when a is bigger than 1 and b is bigger than 0 or when a is smaller than 1 and b is smaller than 0, and it goes down when a is smaller than 1 and b is bigger than 0 or when a is bigger than one and b is smaller than 0
Image in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebook

6. נתונה הפונקציה 1.5x1.5^x. מצאו בעזרת כללי החזקה מספר d כך שייתקים 1.5x=d0.25x 1.5^x=d^{0.25x}.
אמתו את תשובתכם .
import sympy as sp d, x= sp.symbols("d x") eq = sp.Eq(1.5**x,d**(0.25*x)) dSol = sp.solve(eq,[d,x])[0][d] dSol #d=5.0625
(2.0**(-4.0*x)*3.0**(4.0*x))**(1/x)
7. מה הניגזרת של הפונקציה f(x)=abxf(x)=a^{b*x}?
#f'(x)=a**(b+!)
8. נתונה הפונקציה f(x)=axf(x)=a^x. מצאו מה צריך להיות ערכו של a כדי שניגזרת הפונקציה בכל נקודה תהיה שווה לפונקציה.
sp.var('x a',real=True) #a=1
(x, a)
9. נכנה בשם ee את המספר עבור מתקיים d(ex)dx=ex \frac{d(e^x)}{dx}=e^x.
א. מה ערכה של הפונקציה exe^x בנקודה x=0?
ב. מה שיפוע המשיק לגרף שלexe^x בנקודה x=0?
ג. הסבירו מדוע שיפוע המיתר העובר דרך נקודת החיתוך של הגרף בציר ה-y ודרך הנקודה (h,eh)(h,e^h) שווה ל- eh1h\frac{e^h-1}{h}.
ד. מדוע עבור hh קטן מאד, קרוב לאפס מתקיים eh1h1\frac{e^h-1}{h}\approx1
ה. הראו כי בקרוב מתקיים e(1+h)1he\approx(1+h)^{\frac{1}{h}}
#אין לה ערך מכיוון שהמכנה שווה ל0 #אין למשיק שיפוע
10. ככל ש- hh קטן יותר כך הביטוי (1+h)h (1+h)^h קרוב יותר לערכו של ee. נתון כי h=1xh=\frac{1}{x} הסבירו מדוע ערכו של הביטוי (1+1x)x(1+\frac{1}{x})^x מתקרב ל- ee עבור x גדול מאד.
#e equals to n times 1 divided by n!(n approuches to infinity), and in this equasasion the higher the x is, the closer n is to infinity, thus, the closer it is to e.
11. שרטטו גרף של הפונקציה y(x)=(1+1x)xy(x)=(1+\frac{1}{x})^x ומצאו בעזרתו ערך מקורב ל- ee. דייקו בלפחות שלוש ספרות אחרי הנקודה.
import matplotlib.pyplot as plt import sympy as sp def plotFun(x,y): plt.plot(x,y) plt.xlabel('x') plt.ylabel('y') plt.grid(True) plt.show() x=sp.symbols("x") y=(1+1/x)**x c=range(0,1000,1) y1 = [y.subs({x:i}) for i in c] plotFun(c,y1) e=(1+1/10000)**10000 e
Image in a Jupyter notebook
2.7181459268249255
12. כתבו פונקציה המקבלת פרמטר בשם delta. על הפונקציה להחזיר ערך מקורב ל- ee בשיעור delta. עשו זאת מבלי להשתמש בערך המדוייק של ee.
def approuch_e(delta): e=(1+delta)**(1/delta) return e