Exam Cheat Sheet
13 cardsSystem Modeling & Simulation · Assoc. Prof. Ayman Ghoneim (FCAI — Cairo University) · Midterm Exam · Mon 16 Nov · 12:00–13:00 Cairo (60 min · Written + Simulation Tables)
0/13 recalled
Category:
Chapter:
OR Black-Box Triad
مثلث الـ Black Box
Rule / Convention: Simulation: (m, x) → y | Optimization: (m, y) → x* | ML/Modeling: (x, y) → m
في المحاكاة معاك الموديل والمدخلات وبتحسب المخرجات (عكس الـ Optimization والـ ML).
12 Simulation Study Steps (4 Phases)
الـ 12 خطوة لدراسة المحاكاة
Rule / Convention: 1.Problem → 2.Objectives → 3.Concept → 4.Data → 5.Translate → 6.Verify → 7.Validate → 8.ExpDesign → 9.Runs → 10.MoreRuns? → 11.Docs → 12.Implement
مقسمة 4 مراحل: Discovery (1-2)، Building/Data (3-7)، Running (8-10)، Implementation (11-12).
Verification vs. Validation
الفرق بين Verification و Validation
Trap: Verification = 'Built the model right' (code matches design). Validation = 'Built the right model' (model matches reality).
فحص الكود والـ Bugs ده Verification؛ مقارنة النتايج بالواقع ده Validation.
Expectation & Variance Algebra
قوانين التوقع والتباين
Linear Expectation
E[aX+b]=aE[X]+b
Scaling & Shortcut
Var(aX+b)=a2Var(X),Var(X)=E[X2]−(E[X])2
Difference (Independent)
Var(X1−X2)=Var(X1)+Var(X2)
الجمع (+b) لا يغير الـ Variance؛ وطرح متغيرين مستقلين يجمع تباينهما!
Key Distributions (Mean & Variance)
أهم التوزيعات الاحتمالية
Poisson(λt)
E=Var=λt
Uniform([a,b])
E=2a+b,Var=12(b−a)2
Exponential(λ)
E=λ1,Var=λ21,F(x)=1−e−λx
تذكر: في بواسون المتوسط = التباين = λt؛ وفي الأسي المتوسط = 1/λ.
Monte Carlo Integral, SE & 95% CI
قوانين تكامل مونت كارلو وفترة الثقة
Integral Estimator
I^=nb−ai=1∑ng(xi)
Variance & Standard Error
Var[g]=n1i=1∑ng(xi)2−I^2,en=nVar[g]
95% CI & Sample Size
CI95%=I^±1.96en,n≥ε2Var
عشان تقلل الخطأ المعياري للنص لازم تزود التجارب 4 أضعاف (1/√n).
95% Confidence Interval Trap
فخ تفسير فترة الثقة 95%
Trap: Say: '95% of repeated intervals capture μ.' NOT: '95% probability μ lies inside this one interval.'
الـ μ ثابت؛ التكرار هو اللي بيضمن احتواء 95% من الفترات ليه.
Midterm [0,1) RNs vs. Lab 01–00 RDs
تحويل الأرقام العشوائية في الميدترم vs المعامل
Rule / Convention: Midterm [0,1) RNs: pick first class with RN < CDF (half-open [0, p₁)). Slides/Labs 01–00 RDs: 00 = 100, inclusive bounds.
في امتحانات د. أيمن الأرقام كسور [0,1) ونقارن بـ RN < CDF (زي سؤال الكاوتش RN < 0.4).
Queueing Table & Summary Metrics
معادلات جدول الطابور ومقاييس الأداء
Row Event Times
Start=max(Arr,PrevEnd),Wait=Start−Arr,Idle=max(0,Arr−PrevEnd)
Waiting Metrics
Wq=N∑Wait,Wwaiters=Nwaiters∑Wait
Server Utilization
Util=Tend∑Dur
في الشبكات المتتالية (العيادة/البنزينة): وصول المرحلة التانية = نهاية خدمة المرحلة الأولى.
(M, N) Inventory & Perishable Cash Profit
قوانين المخزون (M, N) وبائع الصحف/المخبز
Order Qty (Day N)
OrdQty=M−EndInv+Backorder
Perishable Cash Profit
Profit=min(D,Q)⋅Price−Q⋅Cost+max(0,Q−D)⋅Salvage
البضاعة الواصلة في الـ Backorders تسد العجز القديم قبل طلب اليوم الجديد.
Newsdealer Lost Opportunity Cost Trap
فخ طرح الـ Lost Profit في بائع الصحف
Trap: Actual Cash Profit (Lab 5 & Midterm 2025 Bakery) does NOT subtract Lost Profit from Revenue - Cost + Salvage!
سلايد 40 طرحت $13.60 opportunity cost ($174.90)، بينما الكاش الفعلي في المعمل والميدترم لا يطرحها ($188.50).
LCG & Full Period Conditions
مولد LCG وشروط الـ Full Period
LCG Recurrence
Zi+1=(aZi+c)modm,Ri=mZi
Mixed Full Period (m=2b)
gcd(c,m)=1∧a=1+4k
BBS Direct Access
Zi=Z02imodλ(m)modm
لو c=0 (Multiplicative) أقصى دورة m-1 لأن Z=0 يثبت للأبد.
Never 'Accept H₀' + Midterm Scope Stop
ممنوع تقول Accept H₀ + حدود الميدترم
Trap: Say: 'Fail to reject H₀' (courtroom insufficient evidence). OUT OF SCOPE: K-S calculations, Chi-Square, Autocorrelation, Input Modeling.
د. أيمن وقف في محاضرة 7 قبل حسابات الـ K-S مباشرة — ماتضيعش وقتك في الباقي ليلة الامتحان!