FSc Part 1 Computer Science Chapter 5 Complete Guide Book — Data Analytics

FSc Part 1 Computer Science Chapter 5 — Data Analytics
Home > PunjabTest.com > FSc Part 1 > Computer Science — all chapters > Chapter 5: Data Analytics

اس chapter میں topics (Topics in this chapter)

  1. Introduction — Data Analytics کیا ہے?
  2. 5.1 — Basic Statistical Concepts
  3. 5.1.1 — Mean (Ausat)
  4. 5.1.1 — Median (Darmiyani Qeemat)
  5. 5.1.1 — Mode (Sab Se Aam Qeemat)
  6. 5.1.2 — Measures of Dispersion & Variance
  7. 5.1.2.2 — Standard Deviation
  8. 5.1.3 — Introduction to Probability
  9. Class Activity — Homework Hours کا مکمل حل
  10. 5.2 — Data Collection and Preparation
  11. 5.2.1.1 — Surveys
  12. 5.2.1.2 — Observations
  13. 5.2.1.3 — Experiments
  14. 5.2.2 & 5.2.3.1 — Data Preparation and Data Cleaning
  15. 5.2.3.2 — Data Transformation
  16. 5.2.3.3 — Handling Missing Data
  17. 5.3 & 5.3.1 — Building Statistical Models: Introduction
  18. 5.3.1.1 — Model Development: Five Steps
  19. 5.3.1.2 — Linear Regression
  20. 5.3.1.3 — Logistic Regression
  21. 5.3.1.4 — Clustering Techniques (K-Means)
  22. 5.3.2 — Evaluating and Interpreting Models
  23. 5.3.2.3 — Ethical Considerations
  24. 5.4 & 5.4.1.1 — Introduction to Data Visualization & Bar Charts
  25. 5.4.1.2 — Line Graphs
  26. 5.4.1.3 — Histograms
  27. 5.4.1.4 — Scatterplots
  28. 5.4.1.5 — Boxplots
  29. 5.5 & 5.5.1 — Tools for Data Visualization: Excel and Google Sheets
  30. 5.5.2 — Creating and Interpreting Visualizations (Step-by-Step)
  31. 📝 Official Exercise Questions — with Answers
  32. 📌 Chapter Summary & Guidance
تعارف — ڈیٹا اینالیٹکس کیا ہے؟
🏷 Tags: data analytics, decision making, patterns, trends
ENGLISH

Picture a shopkeeper who writes down every sale in a notebook. After a month that notebook is full of numbers, but on its own it tells him nothing. Data analytics is the work of reading those numbers carefully until they start talking — which item sells fastest, which day is quiet, and what he should order next week. The book puts it in one clean line: data analytics is the process of examining data to find useful information, patterns and trends to support decision-making.

Notice the order in that definition, because it is the whole chapter in miniature. First comes data, the raw record of what happened. Then comes examining, which means sorting, counting and comparing instead of just staring at the list. What you find is a pattern — something that repeats — or a trend, something that keeps moving in one direction. And the point of all of it is a decision: a real choice made better than a guess would have been.

Take the shopkeeper again. If Friday sales are always double Monday sales, that is a pattern. If sales of cold drinks climb every week as summer arrives, that is a trend. Stocking more on Friday, and ordering extra drinks before the hot weeks, are decisions — and both came from the notebook, not from luck. Every later section of this chapter is just a sharper tool for doing this same job: statistics to summarise, cleaning to fix the notebook, models to predict, and charts to see.

اردو

ایک دکاندار کو ذہن میں لائیں جو ہر فروخت اپنی کاپی میں لکھتا ہے۔ ایک مہینے بعد کاپی نمبروں سے بھر جاتی ہے، لیکن اکیلی وہ اسے کچھ نہیں بتاتی۔ ڈیٹا اینالیٹکس اسی کاپی کو غور سے پڑھنے کا کام ہے یہاں تک کہ نمبر بولنے لگیں — کون سی چیز سب سے تیزی سے بکتی ہے، کون سا دن سست ہوتا ہے، اور اگلے ہفتے کیا منگوانا چاہیے۔ کتاب کی تعریف ایک صاف جملے میں ہے: ڈیٹا اینالیٹکس ڈیٹا کو جانچنے کا عمل ہے تاکہ مفید معلومات، پیٹرن اور رجحانات ملیں اور فیصلہ سازی میں مدد ہو۔

اس تعریف کی ترتیب پر غور کریں، کیونکہ یہی پورا باب ہے۔ پہلے ڈیٹا آتا ہے، یعنی جو ہوا اس کا کچا ریکارڈ۔ پھر جانچ آتی ہے، یعنی فہرست کو صرف دیکھنا نہیں بلکہ ترتیب دینا، گننا اور موازنہ کرنا۔ جو ملتا ہے وہ پیٹرن ہوتا ہے — کوئی چیز جو دہرائی جائے — یا رجحان، یعنی کوئی چیز جو مسلسل ایک سمت میں بڑھے یا گھٹے۔ اور اس سب کا مقصد ایک فیصلہ ہے: اندازے سے بہتر کوئی حقیقی انتخاب۔

دکاندار کی مثال دوبارہ لیں۔ اگر جمعے کی فروخت ہمیشہ پیر سے دگنی ہو تو یہ پیٹرن ہے۔ اگر گرمیاں آتے ہی ٹھنڈے مشروبات کی فروخت ہر ہفتے بڑھے تو یہ رجحان ہے۔ جمعے کو زیادہ مال رکھنا اور گرم ہفتوں سے پہلے زیادہ مشروبات منگوانا فیصلے ہیں — اور دونوں کاپی سے آئے، قسمت سے نہیں۔ اس باب کا ہر اگلا حصہ اسی کام کا ایک تیز اوزار ہے: خلاصے کے لیے شماریات، کاپی ٹھیک کرنے کے لیے صفائی، پیش گوئی کے لیے ماڈل، اور دیکھنے کے لیے چارٹ۔

Raw datasales notebookPatternsFriday = doubleDecisionorder more Friday
Data سمجھو: کچا record پہلے آتا ہے, پھر اس میں pattern ڈھونڈا جاتا ہے, اور آخر میں اس pattern پر فیصلہ ہوتا ہے — یہی analytics کا راستہ ہے.
5.1 — Basic Statistical Concepts۵.۱ — بنیادی شماریاتی تصورات
🏷 Tags: statistics, summarise, dataset, conclusions
ENGLISH

Statistics is the branch of mathematics that helps us understand and analyse data, and its first gift is simple: it turns a long list into a short summary. Imagine a teacher with the marks of 200 students. Reading all 200 numbers one by one tells you very little, and remembering them is impossible. But one average, one middle value and one most-common mark together give you the shape of the whole class in seconds. That is what the book means when it says large sets of information can be summarised in a simple way, making it easier to draw conclusions.

Think of it like describing a crowd. You would not name every person; you would say roughly how tall people are, whether most are young or old, and whether everyone is similar or very mixed. Statistics does exactly that for numbers. The next sections give you the two families of summary tools. Measures of central tendency — mean, median and mode — point to the centre, the typical value. Measures of dispersion — variance and standard deviation — say how spread out the numbers are around that centre.

Both families are needed together, and this chapter will show you why with real numbers. Two classes can share the same average and still be completely different — one tightly packed, the other scattered all over. A centre without a spread is only half a description, and a spread without a centre has nothing to spread around. Keep that pairing in mind from here on.

اردو

شماریات ریاضی کی وہ شاخ ہے جو ڈیٹا کو سمجھنے اور اس کا تجزیہ کرنے میں مدد دیتی ہے، اور اس کا پہلا تحفہ بہت سادہ ہے: یہ لمبی فہرست کو مختصر خلاصے میں بدل دیتی ہے۔ ایک استاد کو ذہن میں لائیں جس کے پاس ۲۰۰ طلبہ کے نمبر ہیں۔ ۲۰۰ نمبر ایک ایک کر کے پڑھنے سے بہت کم معلوم ہوگا، اور انہیں یاد رکھنا ناممکن ہے۔ لیکن ایک اوسط، ایک درمیانی قیمت اور ایک سب سے عام نمبر مل کر چند سیکنڈ میں پوری کلاس کی شکل بتا دیتے ہیں۔ کتاب کا یہی مطلب ہے کہ معلومات کے بڑے مجموعے کو سادہ انداز میں سمیٹا جا سکتا ہے تاکہ نتیجہ نکالنا آسان ہو۔

اسے ایک ہجوم کی وضاحت کی طرح سمجھیں۔ آپ ہر شخص کا نام نہیں لیں گے؛ آپ بتائیں گے کہ لوگ تقریباً کتنے لمبے ہیں، زیادہ تر جوان ہیں یا بوڑھے، اور سب ایک جیسے ہیں یا بہت مختلف۔ شماریات نمبروں کے ساتھ یہی کرتی ہے۔ اگلے حصے خلاصے کے دو خاندان دیتے ہیں۔ مرکزی رجحان کی پیمائشیں — اوسط، وسطانیہ اور کثیر الوقوع قدر — مرکز کی طرف اشارہ کرتی ہیں، یعنی عام قیمت۔ انتشار کی پیمائشیں — تغیر اور معیاری انحراف — بتاتی ہیں کہ نمبر اس مرکز کے گرد کتنے پھیلے ہوئے ہیں۔

دونوں خاندان ایک ساتھ چاہیے، اور یہ باب حقیقی نمبروں سے دکھائے گا کہ کیوں۔ دو کلاسوں کی اوسط ایک جیسی ہو سکتی ہے اور پھر بھی وہ بالکل مختلف ہو سکتی ہیں — ایک گٹھی ہوئی، دوسری ہر طرف بکھری ہوئی۔ پھیلاؤ کے بغیر مرکز صرف آدھی وضاحت ہے، اور مرکز کے بغیر پھیلاؤ کا کوئی مطلب نہیں۔ یہ جوڑا آگے ذہن میں رکھیں۔

200 marks, one by one — too long to read50, 62, 71, 58, 90, 47, 83, 66, … (200 numbers)Centremean · median · modeSpreadvariance · std. dev.Together they describe the whole class
Statistics سمجھو: لمبی list کو دو مختصر سوالوں میں بدل دو — مرکز کہاں ہے, اور پھیلاؤ کتنا ہے.
5.1.1 — Mean (Ausat)۵.۱.۱ — اوسط (Mean)
🏷 Tags: mean, average, sum, divide
ENGLISH

The mean is the average of all the numbers in a dataset, and the book's recipe for it could not be shorter: add everything up, then divide by how many values there are. That is all there is to it — no sorting, no picking, just one total shared equally. If five friends scored 50, 60, 70, 80 and 90 in a test, their mean is worked out like this, step by step. First add: 50 + 60 = 110, then 110 + 70 = 180, then 180 + 80 = 260, then 260 + 90 = 350. Then divide by the number of students, 5: 350 ÷ 5 = 70. So the mean score is 70.

It helps to picture what that 70 means. Imagine all five scores poured into one pot and then shared out equally among the five students — everyone would get 70. That is why the mean is called the average: it is the fair-share value. Notice also that 70 sits exactly in the middle of this particular list, but that is a coincidence of these evenly spaced numbers, not a rule. The mean does not look for the middle number; it only looks at the total.

⚠️ کتاب کی غلطی, درست شدہ: on printed page 67 the formula line prints the numerator as 50 + 40 + 70 + 80 + 90. That 40 is a misprint — the text just above lists the scores as 50, 60, 70, 80 and 90, and only with 60 does the sum reach 350 and the answer 70. With 40 the sum would be 330 and the mean 66, not 70. Use 60, as corrected above.

One weakness is worth knowing early, because it explains why we need the median next. A single very large or very small value drags the mean with it. If one student in that group had scored 10 instead of 90, the total would fall to 270 and the mean to 54 — even though four of the five scores never changed. The mean listens to every value, including the odd one out.

اردو

اوسط کسی ڈیٹا سیٹ کے تمام نمبروں کا اوسط ہوتی ہے، اور کتاب کا طریقہ بہت مختصر ہے: سب کو جمع کریں، پھر قیمتوں کی تعداد پر تقسیم کریں۔ بس یہی ہے — نہ ترتیب دینا، نہ چننا، صرف ایک مجموعہ برابر بانٹنا۔ اگر پانچ دوستوں نے ٹیسٹ میں ۵۰، ۶۰، ۷۰، ۸۰ اور ۹۰ نمبر لیے تو اوسط اس طرح مرحلہ وار نکالی جاتی ہے۔ پہلے جمع کریں: ۵۰ + ۶۰ = ۱۱۰، پھر ۱۱۰ + ۷۰ = ۱۸۰، پھر ۱۸۰ + ۸۰ = ۲۶۰، پھر ۲۶۰ + ۹۰ = ۳۵۰۔ پھر طلبہ کی تعداد ۵ پر تقسیم کریں: ۳۵۰ ÷ ۵ = ۷۰۔ پس اوسط نمبر ۷۰ ہے۔

یہ سمجھنا مددگار ہے کہ ۷۰ کا مطلب کیا ہے۔ تصور کریں کہ پانچوں نمبر ایک برتن میں ڈال کر پانچوں طلبہ میں برابر بانٹ دیے جائیں — ہر ایک کو ۷۰ ملے گا۔ اسی لیے اوسط کو برابر بانٹنے والی قیمت کہتے ہیں۔ یہ بھی دیکھیں کہ ۷۰ اس خاص فہرست کے عین درمیان میں ہے، لیکن یہ ان برابر فاصلوں والے نمبروں کا اتفاق ہے، کوئی اصول نہیں۔ اوسط درمیانی نمبر نہیں ڈھونڈتی؛ وہ صرف مجموعے کو دیکھتی ہے۔

⚠️ کتاب کی غلطی، درست شدہ: چھپی ہوئی صفحہ ۶۷ پر فارمولے کی سطر میں صورت ۵۰ + ۴۰ + ۷۰ + ۸۰ + ۹۰ لکھی ہے۔ یہ ۴۰ چھپائی کی غلطی ہے — اوپر متن میں نمبر ۵۰، ۶۰، ۷۰، ۸۰ اور ۹۰ درج ہیں، اور صرف ۶۰ سے مجموعہ ۳۵۰ اور جواب ۷۰ بنتا ہے۔ ۴۰ سے مجموعہ ۳۳۰ اور اوسط ۶۶ ہوتی، ۷۰ نہیں۔ اوپر درست ۶۰ استعمال کیا گیا ہے۔

ایک کمزوری جلدی جان لینا اچھا ہے، کیونکہ اسی سے اگلے حصے میں وسطانیہ کی ضرورت سمجھ آتی ہے۔ ایک بہت بڑی یا بہت چھوٹی قیمت اوسط کو اپنے ساتھ کھینچ لیتی ہے۔ اگر اس گروہ میں ایک طالب علم نے ۹۰ کی بجائے ۱۰ نمبر لیے ہوتے تو مجموعہ ۲۷۰ اور اوسط ۵۴ ہو جاتی — حالانکہ پانچ میں سے چار نمبر بدلے ہی نہیں تھے۔ اوسط ہر قیمت کی سنتی ہے، عجیب قیمت کی بھی۔

Mean = 70 — the fair-share line5060708090(50+60+70+80+90) ÷ 5 = 350 ÷ 5 = 70
Mean سمجھو: سب جمع کرو, گن لو کتنے ہیں, تقسیم کر دو — جو نکلے وہ برابر بانٹنے والی قیمت ہے.
5.1.1 — Median (Darmiyani Qeemat)۵.۱.۱ — وسطانیہ (Median)
🏷 Tags: median, middle value, ordered, even number
ENGLISH

The median is the middle value of a dataset when the numbers are arranged in order — and that word order does all the work. You cannot find a middle until the numbers are lined up from smallest to largest. Take the same test scores, 50, 60, 70, 80 and 90. They are already in ascending order, so count to the middle: 50 is first, 60 second, 70 third, 80 fourth, 90 fifth. With five values the third one is the middle, so the median score is 70. The book adds the point that the median helps us understand the middle point of the data — it is the value with half the class below it and half above it.

Now the case that trips students up: an even number of values has no single middle number. Suppose the scores were 50, 60, 70 and 80. Lined up, the two middle scores are 60 and 70 — there is nothing sitting exactly between them in the list. The rule is to take the average of those two middle numbers: (60 + 70) ÷ 2 = 130 ÷ 2 = 65. So the median is 65, even though no student actually scored 65. A median does not have to be a value anyone got; it only has to sit in the middle.

Why keep both mean and median? Because the median ignores extremes in a way the mean cannot. Go back to the example where one score collapses to 10: the list becomes 10, 50, 60, 70, 80. The mean fell to 54, but the median is still 60 — the middle value barely moved. When a dataset has one wild value, the median often describes the typical student more honestly than the mean does. That is the practical reason textbooks teach them side by side.

اردو

وسطانیہ کسی ڈیٹا سیٹ کی درمیانی قیمت ہوتی ہے جب نمبر ترتیب میں لگے ہوں — اور یہ لفظ ترتیب سارا کام کرتا ہے۔ درمیان اس وقت تک نہیں مل سکتا جب تک نمبر چھوٹے سے بڑے کی ترتیب میں نہ لگے ہوں۔ وہی ٹیسٹ نمبر لیں: ۵۰، ۶۰، ۷۰، ۸۰ اور ۹۰۔ یہ پہلے سے صعودی ترتیب میں ہیں، اس لیے درمیان تک گنیں: ۵۰ پہلا، ۶۰ دوسرا، ۷۰ تیسرا، ۸۰ چوتھا، ۹۰ پانچواں۔ پانچ قیمتوں میں تیسری درمیانی ہے، پس وسطانیہ ۷۰ ہے۔ کتاب یہ نکتہ بھی دیتی ہے کہ وسطانیہ ڈیٹا کے درمیانی نقطے کو سمجھنے میں مدد دیتا ہے — یہ وہ قیمت ہے جس کے نیچے آدھی کلاس اور اوپر آدھی کلاس ہو۔

اب وہ صورت جو طلبہ کو پریشان کرتی ہے: جفت تعداد کی قیمتوں میں کوئی اکیلی درمیانی قیمت نہیں ہوتی۔ فرض کریں نمبر ۵۰، ۶۰، ۷۰ اور ۸۰ ہوں۔ ترتیب میں درمیانی دو نمبر ۶۰ اور ۷۰ ہیں — فہرست میں ان کے عین درمیان کچھ نہیں ہے۔ اصول یہ ہے کہ ان دو درمیانی نمبروں کا اوسط لیں: (۶۰ + ۷۰) ÷ ۲ = ۱۳۰ ÷ ۲ = ۶۵۔ پس وسطانیہ ۶۵ ہے، حالانکہ کسی طالب علم نے واقعی ۶۵ نمبر نہیں لیے۔ وسطانیہ کا کسی کی حاصل کردہ قیمت ہونا ضروری نہیں؛ اسے صرف درمیان میں ہونا چاہیے۔

اوسط اور وسطانیہ دونوں کیوں رکھے جائیں؟ کیونکہ وسطانیہ انتہائی قیمتوں کو اس طرح نظر انداز کرتا ہے جیسے اوسط نہیں کر سکتا۔ اس مثال پر واپس جائیں جہاں ایک نمبر گر کر ۱۰ ہو گیا: فہرست ۱۰، ۵۰، ۶۰، ۷۰، ۸۰ بن جاتی ہے۔ اوسط گر کر ۵۴ ہو گئی، لیکن وسطانیہ اب بھی ۶۰ ہے — درمیانی قیمت بمشکل ہلی۔ جب ڈیٹا میں ایک بے قابو قیمت ہو تو وسطانیہ اکثر عام طالب علم کی زیادہ ایماندار تصویر دیتا ہے۔ یہی عملی وجہ ہے کہ کتابیں انہیں ساتھ ساتھ پڑھاتی ہیں۔

First sort, then find the middle506070 ★8090Odd count (5): middle value is the medianEven count (50, 60, 70, 80): (60+70) ÷ 2 = 65
Median samjho: pehle chhote se bara tartib do, phir bilkul darmiyan wali qeemat uthao — jorri ho to darmiyani do ka ausat lo.
5.1.1 — Mode (Sab Se Aam Qeemat)۵.۱.۱ — کثیر الوقوع قدر (Mode)
🏷 Tags: mode, most frequent, bimodal, frequency
ENGLISH

The mode is the number that appears most often in a dataset. No adding, no sorting needed for the idea itself — you simply count how many times each value turns up, and the winner is the mode. The book's example makes it concrete: if five students scored 50, 60, 70, 70 and 90, then 70 appears twice while every other score appears only once. Therefore the mode is 70. It answers a different question from the mean and median: not "what is typical on average?" but "what actually happens most?"

There is one twist the book is careful to include: there can be more than one mode. If the scores were 50, 60, 70, 70, 60 and 90, then both 60 and 70 appear twice, and neither beats the other. So there are two modes, 60 and 70. A dataset like this is sometimes called bimodal, but the name matters less than the habit — always count carefully before declaring a single winner, because a tie is a real answer, not a mistake.

It is also possible to have no mode at all. If every value appears exactly once — like the original 50, 60, 70, 80, 90 — then nothing is "most frequent" and the mode simply does not exist. Students often force an answer here; do not. And notice where the mode shines: it is the only one of the three that works for words as well as numbers. The most common favourite colour, the most popular bus route, the most frequent complaint in a survey — all of those are modes, and no mean or median could ever be calculated for them.

اردو

کثیر الوقوع قدر وہ نمبر ہوتا ہے جو ڈیٹا سیٹ میں سب سے زیادہ بار آئے۔ اس خیال کے لیے نہ جمع کرنا ضروری ہے، نہ ترتیب دینا — آپ صرف گنتے ہیں کہ ہر قیمت کتنی بار آئی، اور جیتنے والی قیمت کثیر الوقوع قدر ہے۔ کتاب کی مثال اسے ٹھوس بناتی ہے: اگر پانچ طلبہ نے ۵۰، ۶۰، ۷۰، ۷۰ اور ۹۰ نمبر لیے تو ۷۰ دو بار آتا ہے جبکہ ہر دوسرا نمبر صرف ایک بار۔ پس کثیر الوقوع قدر ۷۰ ہے۔ یہ اوسط اور وسطانیہ سے مختلف سوال کا جواب دیتی ہے: "اوسطاً عام کیا ہے؟" نہیں بلکہ "حقیقت میں سب سے زیادہ کیا ہوتا ہے؟"

ایک موڑ ہے جسے کتاب احتیاط سے شامل کرتی ہے: ایک سے زیادہ کثیر الوقوع قدریں ہو سکتی ہیں۔ اگر نمبر ۵۰، ۶۰، ۷۰، ۷۰، ۶۰ اور ۹۰ ہوں تو ۶۰ اور ۷۰ دونوں دو دو بار آتے ہیں، اور کوئی دوسرے کو نہیں ہراتا۔ پس دو کثیر الوقوع قدریں ہیں، ۶۰ اور ۷۰۔ ایسے ڈیٹا کو کبھی دوہری کثیر الوقوع قدر والا کہتے ہیں، لیکن نام سے زیادہ عادت اہم ہے — اکیلا فاتح اعلان کرنے سے پہلے ہمیشہ احتیاط سے گنیں، کیونکہ برابری ایک حقیقی جواب ہے، غلطی نہیں۔

یہ بھی ممکن ہے کہ کوئی کثیر الوقوع قدر ہو ہی نہیں۔ اگر ہر قیمت صرف ایک بار آئے — جیسے اصل ۵۰، ۶۰، ۷۰، ۸۰، ۹۰ — تو کچھ بھی "سب سے زیادہ" نہیں ہے اور کثیر الوقوع قدر موجود ہی نہیں۔ طلبہ اکثر یہاں زبردستی جواب نکالتے ہیں؛ ایسا نہ کریں۔ اور یہ دیکھیں کہ کثیر الوقوع قدر کہاں چمکتی ہے: یہ تینوں میں سے واحد ہے جو الفاظ کے لیے بھی کام کرتی ہے، نہ صرف نمبروں کے لیے۔ سب سے پسندیدہ رنگ، سب سے مقبول بس کا راستہ، سروے میں سب سے عام شکایت — یہ سب کثیر الوقوع قدریں ہیں، اور ان کے لیے اوسط یا وسطانیہ کبھی نہیں نکالا جا سکتا۔

Count how many times each score appears50 ×160 ×170707090 ×1Wait — the book example is 50, 60, 70, 70, 90: 70 appears twiceMode = 70 (twice beats once)50, 60, 70, 70, 60, 90 → two modes: 60 and 70
Mode سمجھو: گن لو کون سی قیمت سب سے زیادہ bar آئی — وہی mode ہے, چاہے وہ ایک ہو, دو ہوں, یا کوئی نہ ہو.
5.1.2 — Measures of Dispersion & Variance۵.۱.۲ — انتشار کی پیمائشیں اور تغیر (Variance)
🏷 Tags: dispersion, variance, spread, mean deviation squared
ENGLISH

Measures of dispersion tell us how spread out or scattered the data is. The book's opening line for this section is worth memorising, because it frames everything that follows: these measures help us understand whether the data points are close to the average (mean) or spread far from it. Two classes can have almost the same mean and feel nothing alike — one where everyone scored near the average, another where marks swing from very low to very high. Central tendency alone would call them identical. Dispersion is what tells them apart.

The first dispersion measure is variance. It shows how much the numbers in a dataset differ from the mean. A higher variance means the numbers are more spread out; a lower variance means they sit closer to the mean. The formula looks frightening at first glance, so take it piece by piece: Variance (σ²) = (1 ÷ N) × Σ(xi − μ)². Here xi is each individual value, μ (mu) is the mean, and N is the total number of values. In plain words: for every value, find how far it is from the mean, square that distance so that negative gaps cannot cancel positive ones, add all those squares up, and divide by how many values there are.

Now the book's worked comparison, done slowly. Class A scored 50, 52, 55, 57, 60. Step 1.1 — mean: (50 + 52 + 55 + 57 + 60) ÷ 5 = 274 ÷ 5 = 54.8. Step 1.2 — each squared deviation: 50 − 54.8 = −4.8, squared 23.04; 52 − 54.8 = −2.8, squared 7.84; 55 − 54.8 = 0.2, squared 0.04; 57 − 54.8 = 2.2, squared 4.84; 60 − 54.8 = 5.2, squared 27.04. Step 1.3 — variance: (23.04 + 7.84 + 0.04 + 4.84 + 27.04) ÷ 5 = 62.8 ÷ 5 = 12.56.

Class B scored 30, 45, 55, 75, 90. Its mean is (30 + 45 + 55 + 75 + 90) ÷ 5 = 295 ÷ 5 = 59. Squared deviations: (30 − 59)² = 841; (45 − 59)² = 196; (55 − 59)² = 16; (75 − 59)² = 256; (90 − 59)² = 961. Variance = (841 + 196 + 16 + 256 + 961) ÷ 5 = 2270 ÷ 5 = 454. The book's conclusion follows at once: Class B's variance is far higher, so its scores are much more spread out than Class A's. Notice also that the two means, 54.8 and 59, are close — yet the classes are nothing alike. That is dispersion doing its job.

اردو

انتشار کی پیمائشیں بتاتی ہیں کہ ڈیٹا کتنا پھیلا ہوا یا بکھرا ہوا ہے۔ اس حصے کی کتاب کی ابتدائی سطر یاد رکھنے کے قابل ہے، کیونکہ یہ آگے سب کچھ واضح کرتی ہے: یہ پیمائشیں سمجھنے میں مدد دیتی ہیں کہ ڈیٹا کے نکات اوسط (mean) کے قریب ہیں یا اس سے دور پھیلے ہیں۔ دو کلاسوں کی اوسط تقریباً ایک جیسی ہو سکتی ہے اور پھر بھی ان کا احساس کچھ اور ہو — ایک جہاں سب نے اوسط کے قریب نمبر لیے، دوسری جہاں نمبر بہت کم سے بہت زیادہ تک جھولتے ہوں۔ صرف مرکزی رجحان انہیں ایک جیسا کہے گا۔ انتشار ہی انہیں الگ کرتا ہے۔

انتشار کی پہلی پیمائش تغیر (variance) ہے۔ یہ دکھاتی ہے کہ ڈیٹا سیٹ کے نمبر اوسط سے کتنے مختلف ہیں۔ زیادہ تغیر کا مطلب ہے نمبر زیادہ پھیلے ہوئے ہیں؛ کم تغیر کا مطلب ہے وہ اوسط کے قریب بیٹھے ہیں۔ فارمولا پہلی نظر میں ڈراؤنا لگتا ہے، اس لیے اسے ٹکڑے ٹکڑے لیں: تغیر (σ²) = (۱ ÷ N) × Σ(xi − μ)²۔ یہاں xi ہر انفرادی قیمت ہے، μ (میو) اوسط ہے، اور N قیمتوں کی کل تعداد ہے۔ سادہ الفاظ میں: ہر قیمت کے لیے معلوم کریں کہ وہ اوسط سے کتنی دور ہے، اس فاصلے کا مربع لیں تاکہ منفی فرق مثبت کو ختم نہ کر سکیں، ان سب مربعوں کو جمع کریں، اور قیمتوں کی تعداد پر تقسیم کریں۔

اب کتاب کا عملی موازنہ، آہستہ آہستہ۔ کلاس A کے نمبر ۵۰، ۵۲، ۵۵، ۵۷، ۶۰ ہیں۔ مرحلہ ۱.۱ — اوسط: (۵۰ + ۵۲ + ۵۵ + ۵۷ + ۶۰) ÷ ۵ = ۲۷۴ ÷ ۵ = ۵۴.۸۔ مرحلہ ۱.۲ — ہر مربع انحراف: ۵۰ − ۵۴.۸ = −۴.۸، مربع ۲۳.۰۴؛ ۵۲ − ۵۴.۸ = −۲.۸، مربع ۷.۸۴؛ ۵۵ − ۵۴.۸ = ۰.۲، مربع ۰.۰۴؛ ۵۷ − ۵۴.۸ = ۲.۲، مربع ۴.۸۴؛ ۶۰ − ۵۴.۸ = ۵.۲، مربع ۲۷.۰۴۔ مرحلہ ۱.۳ — تغیر: (۲۳.۰۴ + ۷.۸۴ + ۰.۰۴ + ۴.۸۴ + ۲۷.۰۴) ÷ ۵ = ۶۲.۸ ÷ ۵ = ۱۲.۵۶۔

کلاس B کے نمبر ۳۰، ۴۵، ۵۵، ۷۵، ۹۰ ہیں۔ اس کی اوسط (۳۰ + ۴۵ + ۵۵ + ۷۵ + ۹۰) ÷ ۵ = ۲۹۵ ÷ ۵ = ۵۹ ہے۔ مربع انحراف: (۳۰ − ۵۹)² = ۸۴۱؛ (۴۵ − ۵۹)² = ۱۹۶؛ (۵۵ − ۵۹)² = ۱۶؛ (۷۵ − ۵۹)² = ۲۵۶؛ (۹۰ − ۵۹)² = ۹۶۱۔ تغیر = (۸۴۱ + ۱۹۶ + ۱۶ + ۲۵۶ + ۹۶۱) ÷ ۵ = ۲۲۷۰ ÷ ۵ = ۴۵۴۔ کتاب کا نتیجہ فوراً نکلتا ہے: کلاس B کا تغیر کہیں زیادہ ہے، اس لیے اس کے نمبر کلاس A سے بہت زیادہ پھیلے ہوئے ہیں۔ یہ بھی دیکھیں کہ دونوں اوسطیں، ۵۴.۸ اور ۵۹، قریب ہیں — پھر بھی کلاسیں ایک جیسی نہیں ہیں۔ یہی انتشار کا کام ہے۔

Same idea, two very different spreadsClass A — variance 12.56 (tight)mean 54.8Class B — variance 454 (scattered)mean 59Variance = average of (each value − mean)²Squaring stops a −4.8 gap cancelling a +5.2 gap
Variance سمجھو: ہر قیمت کا اوسط سے فاصلہ لو, اس کا مربع لو, سب جمع کر کے گن لو — بڑا جواب مطلب زیادہ پھیلاؤ.
5.1.2.2 — Standard Deviation۵.۱.۲.۲ — معیاری انحراف (Standard Deviation)
🏷 Tags: standard deviation, square root, same unit, spread
ENGLISH

Standard deviation is similar to variance, but the book gives it a clear advantage: it provides a more practical and interpretable value because it is in the same unit as the original data. That single sentence is the whole reason this measure exists. Variance squares the distances, so its unit is "marks squared" — a unit nobody ever scored in. Taking the square root undoes that squaring and brings the answer back into plain marks, so you can read it straight against the scores themselves. The formula is simply: Standard Deviation (σ) = √Variance, which the book writes out in full as σ = √[(1 ÷ N) × Σ(xi − μ)²].

Apply it to the two classes you already know. Class A: Standard Deviation = √12.56 ≈ 3.55. Class B: Standard Deviation = √454 ≈ 21.31. Now the numbers speak in marks. In Class A a typical score sits only about three and a half marks from the mean — the class is closely packed around it. In Class B a typical score sits about twenty-one marks away — the class is widely scattered. The book's own reading matches this exactly: Class A's scores are closely packed around the mean, whereas Class B's are more widely scattered, and standard deviation lets us grasp how much variation exists in a dataset at a glance.

⚠️ کتاب کی غلطی, درست شدہ: on printed page 70 the book writes Class B's calculation as √(456) = 21.26. Both numbers are wrong: the variance worked out on the previous page is 454, not 456, and √454 is about 21.31 (√456 would be about 21.35, and 21.26 is the square root of neither). Use variance 454 and standard deviation ≈ 21.31, as corrected above. Class A's √12.56 ≈ 3.55 is correct.

A useful habit for exams: always report variance and standard deviation as a pair, and always say the unit. "Variance 12.56, standard deviation 3.55 marks" tells a reader everything; "12.56" on its own tells them almost nothing. And remember the direction — bigger standard deviation always means more spread, never better or worse performance. A scattered class is not a bad class; it is just a mixed one, and that mixing is exactly what this number measures.

اردو

معیاری انحراف تغیر جیسا ہے، لیکن کتاب اسے ایک واضح فائدہ دیتی ہے: یہ زیادہ عملی اور قابل فہم قیمت دیتا ہے کیونکہ یہ اصل ڈیٹا کی ہی اکائی میں ہوتا ہے۔ یہ واحد جملہ اس پیمائش کے وجود کی پوری وجہ ہے۔ تغیر فاصلوں کا مربع لیتا ہے، اس لیے اس کی اکائی "نمبروں کا مربع" بن جاتی ہے — ایسی اکائی جس میں کسی نے کبھی نمبر نہیں لیے۔ جذر لینا اس مربع کو ختم کر کے جواب کو سادہ نمبروں میں واپس لاتا ہے، تاکہ آپ اسے براہ راست نمبروں کے مقابلے میں پڑھ سکیں۔ فارمولا سادہ ہے: معیاری انحراف (σ) = √تغیر، جسے کتاب مکمل طور پر یوں لکھتی ہے: σ = √[(۱ ÷ N) × Σ(xi − μ)²]۔

اسے ان دو کلاسوں پر لگائیں جو آپ پہلے سے جانتے ہیں۔ کلاس A: معیاری انحراف = √۱۲.۵۶ ≈ ۳.۵۵۔ کلاس B: معیاری انحراف = √۴۵۴ ≈ ۲۱.۳۱۔ اب نمبر نمبروں میں بولتے ہیں۔ کلاس A میں ایک عام نمبر اوسط سے صرف تقریباً ساڑھے تین نمبر دور ہوتا ہے — کلاس اس کے گرد گٹھی ہوئی ہے۔ کلاس B میں ایک عام نمبر تقریباً اکیس نمبر دور ہوتا ہے — کلاس وسیع پیمانے پر بکھری ہوئی ہے۔ کتاب کی اپنی وضاحت اس سے بالکل ملتی ہے: کلاس A کے نمبر اوسط کے گرد قریب سے جڑے ہیں، جبکہ کلاس B کے زیادہ وسیع پیمانے پر بکھرے ہیں، اور معیاری انحراف ایک نظر میں بتاتا ہے کہ ڈیٹا سیٹ میں کتنی تبدیلی ہے۔

⚠️ کتاب کی غلطی، درست شدہ: چھپی ہوئی صفحہ ۷۰ پر کتاب کلاس B کا حساب √(۴۵۶) = ۲۱.۲۶ لکھتی ہے۔ دونوں نمبر غلط ہیں: پچھلے صفحے پر نکالا گیا تغیر ۴۵۴ ہے، ۴۵۶ نہیں، اور √۴۵۴ تقریباً ۲۱.۳۱ ہے (√۴۵۶ تقریباً ۲۱.۳۵ ہوگا، اور ۲۱.۲۶ ان میں سے کسی کا جذر نہیں)۔ اوپر درست ۴۵۴ اور تقریباً ۲۱.۳۱ استعمال کریں۔ کلاس A کا √۱۲.۵۶ ≈ ۳.۵۵ درست ہے۔

امتحانات کے لیے ایک مفید عادت: تغیر اور معیاری انحراف ہمیشہ جوڑے میں بتائیں، اور ہمیشہ اکائی کہیں۔ "تغیر ۱۲.۵۶، معیاری انحراف ۳.۵۵ نمبر" قاری کو سب کچھ بتا دیتا ہے؛ اکیلا "۱۲.۵۶" تقریباً کچھ نہیں بتاتا۔ اور سمت یاد رکھیں — بڑا معیاری انحراف ہمیشہ زیادہ پھیلاؤ کا مطلب ہے، کبھی بہتر یا بدتر کارکردگی کا نہیں۔ بکھری ہوئی کلاس بری کلاس نہیں ہے؛ وہ صرف ملی جلی کلاس ہے، اور یہ ملاوٹ ہی وہ چیز ہے جسے یہ نمبر ناپتا ہے۔

Standard deviation puts the spread back into marksClass A: √12.56 ≈ 3.55typical gap ≈ 3½ marksClass B: √454 ≈ 21.31typical gap ≈ 21 marksShort bar = packed class · Long bar = scattered class
Standard deviation سمجھو: variance کا جذر لو تاکہ جواب واپس اصلی unit میں آ جائے — پھر اسے سیدھا نمبروں سے ملاؤ.
5.1.3 — Introduction to Probability۵.۱.۳ — احتمال کا تعارف (Probability)
🏷 Tags: probability, favourable outcomes, total outcomes, prediction
ENGLISH

Probability is the study of how likely an event is to happen, and its job is to help us make predictions based on known information. That is a different kind of answer from everything so far: mean, median and mode describe what did happen, while probability looks forward to what might happen next. The book opens with the simplest possible case, flipping a coin. There are two possible outcomes, heads or tails, and since both are equally likely, the probability of getting heads is 50% (or 1/2), and the probability of getting tails is also 50%.

The formula behind that coin is worth learning word for word: Probability = (Number of favourable outcomes) ÷ (Total number of outcomes). For the coin, "favourable" does not mean "good" — it only means "the outcome we are asking about." Asking for heads gives 1 favourable outcome out of 2 total outcomes, so 1 ÷ 2 = 1/2. If you asked for "heads or tails," both outcomes would be favourable and the probability would be 2 ÷ 2 = 1, which is just a fancy way of saying "certain."

Coin flips are only the doorway. The book points out that probability is used in many areas, such as predicting the weather, making business decisions, or even predicting outcomes in sports like cricket. A weather forecast that says "70% chance of rain" is using exactly the same idea as the coin — favourable outcomes over total outcomes, counted over many past days like today. A cricket captain weighing whether to bat first is doing the same in his head, with past matches as his data.

The book also hands you a sample dataset for illustration — 3, 5, 8, 8, 10, 12, 15, 15, 16, 18 — and invites you to collect real data from your classmates if you wish. No calculation is worked out for this list in the book, so here is a short derived illustration using the chapter's own tools, labelled as such: the list is already sorted, its mean is (3 + 5 + 8 + 8 + 10 + 12 + 15 + 15 + 16 + 18) ÷ 10 = 110 ÷ 10 = 11; its median is the average of the two middle values, (10 + 12) ÷ 2 = 11; and it has two modes, 8 and 15, each appearing twice. One list, three summaries — and if you now asked "what is the probability of picking a value above 11 from this list?" the answer would be 5 favourable values (12, 15, 15, 16, 18) out of 10, which is 5 ÷ 10 = 1/2. Counting carefully is half of probability.

اردو

احتمال اس بات کا مطالعہ ہے کہ کوئی واقعہ کتنا ممکن ہے، اور اس کا کام معلوم معلومات کی بنیاد پر پیش گوئیاں کرنے میں مدد دینا ہے۔ یہ اب تک کی ہر چیز سے مختلف قسم کا جواب ہے: اوسط، وسطانیہ اور کثیر الوقوع قدر بتاتے ہیں کہ کیا ہوا، جبکہ احتمال آگے دیکھتا ہے کہ آگے کیا ہو سکتا ہے۔ کتاب سب سے سادہ صورت سے شروع کرتی ہے، سکے کا اچھالنا۔ دو ممکنہ نتائج ہیں، سر یا دم، اور چونکہ دونوں برابر ممکن ہیں، سر آنے کا احتمال ۵۰٪ (یا ۱/۲) ہے، اور دم آنے کا احتمال بھی ۵۰٪ ہے۔

اس سکے کے پیچھے فارمولا لفظ بہ لفظ سیکھنے کے قابل ہے: احتمال = (موافق نتائج کی تعداد) ÷ (کل نتائج کی تعداد)۔ یہاں "موافق" کا مطلب "اچھا" نہیں ہے — اس کا صرف مطلب ہے "وہ نتیجہ جس کے بارے میں ہم پوچھ رہے ہیں۔" سر پوچھنے پر ۲ کل نتائج میں سے ۱ موافق نتیجہ ہے، اس لیے ۱ ÷ ۲ = ۱/۲۔ اگر آپ "سر یا دم" پوچھیں تو دونوں نتائج موافق ہوں گے اور احتمال ۲ ÷ ۲ = ۱ ہوگا، جو صرف "یقینی" کہنے کا ایک رسمی طریقہ ہے۔

سکے کا اچھالنا صرف دروازہ ہے۔ کتاب بتاتی ہے کہ احتمال کئی شعبوں میں استعمال ہوتا ہے، جیسے موسم کی پیش گوئی، کاروباری فیصلے، یا کرکٹ جیسے کھیلوں میں نتائج کی پیش گوئی۔ موسم کی پیش گوئی جو "بارش کا ۷۰٪ امکان" کہے وہ سکے والا ہی خیال استعمال کر رہی ہے — موافق نتائج بٹا کل نتائج، آج جیسے کئی گزشتہ دنوں پر گنے ہوئے۔ کرکٹ کا کپتان جو سوچتا ہے کہ پہلے بیٹنگ کرے یا نہیں، اپنے ذہن میں وہی کر رہا ہے، گزشتہ میچوں کو اپنا ڈیٹا بنا کر۔

کتاب مثال کے لیے ایک نمونہ ڈیٹا سیٹ بھی دیتی ہے — ۳، ۵، ۸، ۸، ۱۰، ۱۲، ۱۵، ۱۵، ۱۶، ۱۸ — اور آپ کو دعوت دیتی ہے کہ چاہیں تو اپنے ہم جماعتوں سے حقیقی ڈیٹا جمع کریں۔ اس فہرست کا کوئی حساب کتاب میں نہیں نکالا گیا، اس لیے یہاں باب کے اپنے اوزاروں سے ایک مختصر اخذ شدہ مثال ہے، جسے ایسا ہی لکھا گیا ہے: فہرست پہلے سے ترتیب میں ہے، اس کی اوسط (۳ + ۵ + ۸ + ۸ + ۱۰ + ۱۲ + ۱۵ + ۱۵ + ۱۶ + ۱۸) ÷ ۱۰ = ۱۱۰ ÷ ۱۰ = ۱۱ ہے؛ اس کا وسطانیہ دو درمیانی قیمتوں کا اوسط ہے، (۱۰ + ۱۲) ÷ ۲ = ۱۱؛ اور اس کی دو کثیر الوقوع قدریں ہیں، ۸ اور ۱۵، ہر ایک دو بار آتی ہے۔ ایک فہرست، تین خلاصے — اور اگر آپ اب پوچھیں کہ "اس فہرست سے ۱۱ سے بڑی قیمت چننے کا احتمال کیا ہے؟" تو جواب ۱۰ میں سے ۵ موافق (۱۲، ۱۵، ۱۵، ۱۶، ۱۸) ہے، یعنی ۵ ÷ ۱۰ = ۱/۲۔ احتیاط سے گننا احتمال کا آدھا کام ہے۔

HeadsTailsOne coin, two equally likely outcomesP(heads) = 1 ÷ 2 = 1/2 = 50%P = favourable outcomes ÷ total outcomes
Probability سمجھو: جو pooch رہے ہو اسے گن لو, کل ممکن natijon سے تقسیم کر دو — جواب ہی امکان ہے.
کلاس سرگرمی — ہوم ورک کے گھنٹوں کا مکمل حل
🏷 Tags: class activity, survey, mean median mode variance
ENGLISH

Before moving on, the book sets a class activity, and it is worth solving properly instead of skipping. The instructions are: survey your classmates about the number of hours they spend on homework in a week, gather data from 10 classmates using reasonable values (the book suggests between 0 and 20 hours), calculate the measures of central tendency (mean, median, mode) and the measures of dispersion (variance and standard deviation), and finally write a brief reflection of three to four sentences on what the calculations reveal about your classmates' study habits. A "Do You Know?" box beside it adds that statistics is used in everyday activities such as predicting weather patterns or analysing sports performance.

⚠️ Note: the book gives no actual dataset for this activity — your own class's answers are the data. The worked solution below therefore uses a clearly labelled sample dataset of ten reasonable values, so you can copy the method with your real numbers: 4, 6, 5, 8, 6, 10, 7, 6, 12, 9 hours. First sort them: 4, 5, 6, 6, 6, 7, 8, 9, 10, 12. Mean: (4 + 5 + 6 + 6 + 6 + 7 + 8 + 9 + 10 + 12) ÷ 10 = 73 ÷ 10 = 7.3 hours. Median: with ten values the two middle values are the 5th and 6th, 6 and 7, so (6 + 7) ÷ 2 = 6.5 hours. Mode: 6 appears three times, more than any other value, so the mode is 6 hours.

Dispersion, step by step. Mean μ = 7.3. Squared deviations: (4 − 7.3)² = 10.89; (5 − 7.3)² = 5.29; each 6 gives (6 − 7.3)² = 1.69, and there are three of them, 3 × 1.69 = 5.07; (7 − 7.3)² = 0.09; (8 − 7.3)² = 0.49; (9 − 7.3)² = 2.89; (10 − 7.3)² = 7.29; (12 − 7.3)² = 22.09. Add them: 10.89 + 5.29 + 5.07 + 0.09 + 0.49 + 2.89 + 7.29 + 22.09 = 54.1. Variance = 54.1 ÷ 10 = 5.41. Standard deviation = √5.41 ≈ 2.33 hours. So a typical classmate is about two and a third hours away from the average of 7.3.

Reflection (sample, 3–4 sentences): Most classmates spend around six to seven hours a week on homework, since the mean is 7.3, the median 6.5 and the mode 6 all point to the same neighbourhood. The standard deviation of about 2.33 hours shows real variety, though — a few students study far more, up to 12 hours, while one manages only 4. The class does not have a single study habit; it has a busy middle and two quieter edges. If the teacher wants more even preparation, the students at the low end, not the average, are the ones to support. Now replace the sample with your own ten answers and write your reflection from your own numbers — that is the activity as the book intends it.

اردو

آگے بڑھنے سے پہلے کتاب ایک کلاس سرگرمی دیتی ہے، اور اسے چھوڑنے کی بجائے ٹھیک سے حل کرنا فائدہ مند ہے۔ ہدایات یہ ہیں: اپنے ہم جماعتوں سے سروے کریں کہ وہ ایک ہفتے میں ہوم ورک پر کتنے گھنٹے گزارتے ہیں، ۱۰ ہم جماعتوں سے ڈیٹا جمع کریں اور معقول قیمتیں استعمال کریں (کتاب ۰ سے ۲۰ گھنٹوں کے درمیان تجویز کرتی ہے)، مرکزی رجحان کی پیمائشیں (اوسط، وسطانیہ، کثیر الوقوع قدر) اور انتشار کی پیمائشیں (تغیر اور معیاری انحراف) نکالیں، اور آخر میں تین سے چار جملوں میں مختصر غور لکھیں کہ یہ حساب آپ کے ہم جماعتوں کی پڑھائی کی عادتوں کے بارے میں کیا بتاتے ہیں۔ ساتھ ایک "کیا آپ جانتے ہیں؟" خانہ بتاتا ہے کہ شماریات روزمرہ کی سرگرمیوں میں استعمال ہوتی ہے جیسے موسم کے پیٹرن کی پیش گوئی یا کھیلوں کی کارکردگی کا تجزیہ۔

⚠️ نوٹ: کتاب اس سرگرمی کے لیے کوئی حقیقی ڈیٹا سیٹ نہیں دیتی — آپ کی اپنی کلاس کے جواب ہی ڈیٹا ہیں۔ اس لیے نیچے دیا گیا حل دس معقول قیمتوں کے واضح طور پر نمونہ ڈیٹا سیٹ سے ہے، تاکہ آپ یہی طریقہ اپنے حقیقی نمبروں پر لگا سکیں: ۴، ۶، ۵، ۸، ۶، ۱۰، ۷، ۶، ۱۲، ۹ گھنٹے۔ پہلے ترتیب دیں: ۴، ۵، ۶، ۶، ۶، ۷، ۸، ۹، ۱۰، ۱۲۔ اوسط: (۴ + ۵ + ۶ + ۶ + ۶ + ۷ + ۸ + ۹ + ۱۰ + ۱۲) ÷ ۱۰ = ۷۳ ÷ ۱۰ = ۷.۳ گھنٹے۔ وسطانیہ: دس قیمتوں میں دو درمیانی قیمتیں پانچویں اور چھٹی ہیں، ۶ اور ۷، اس لیے (۶ + ۷) ÷ ۲ = ۶.۵ گھنٹے۔ کثیر الوقوع قدر: ۶ تین بار آتا ہے، کسی بھی دوسری قیمت سے زیادہ، اس لیے کثیر الوقوع قدر ۶ گھنٹے ہے۔

انتشار، مرحلہ وار۔ اوسط μ = ۷.۳۔ مربع انحراف: (۴ − ۷.۳)² = ۱۰.۸۹؛ (۵ − ۷.۳)² = ۵.۲۹؛ ہر ۶ سے (۶ − ۷.۳)² = ۱.۶۹، اور تین ہیں، ۳ × ۱.۶۹ = ۵.۰۷؛ (۷ − ۷.۳)² = ۰.۰۹؛ (۸ − ۷.۳)² = ۰.۴۹؛ (۹ − ۷.۳)² = ۲.۸۹؛ (۱۰ − ۷.۳)² = ۷.۲۹؛ (۱۲ − ۷.۳)² = ۲۲.۰۹۔ جمع کریں: ۱۰.۸۹ + ۵.۲۹ + ۵.۰۷ + ۰.۰۹ + ۰.۴۹ + ۲.۸۹ + ۷.۲۹ + ۲۲.۰۹ = ۵۴.۱۔ تغیر = ۵۴.۱ ÷ ۱۰ = ۵.۴۱۔ معیاری انحراف = √۵.۴۱ ≈ ۲.۳۳ گھنٹے۔ پس ایک عام ہم جماعت اوسط ۷.۳ سے تقریباً دو اور ایک تہائی گھنٹے دور ہے۔

غور (نمونہ، ۳–۴ جملے): زیادہ تر ہم جماعت ہفتے میں تقریباً چھ سے سات گھنٹے ہوم ورک پر گزارتے ہیں، کیونکہ اوسط ۷.۳، وسطانیہ ۶.۵ اور کثیر الوقوع قدر ۶ سب ایک ہی علاقے کی طرف اشارہ کرتے ہیں۔ تقریباً ۲.۳۳ گھنٹوں کا معیاری انحراف اگرچہ حقیقی تنوع دکھاتا ہے — چند طلبہ کہیں زیادہ پڑھتے ہیں، ۱۲ گھنٹوں تک، جبکہ ایک صرف ۴ گھنٹے نکالتا ہے۔ کلاس کی پڑھائی کی کوئی ایک عادت نہیں ہے؛ اس کا ایک مصروف درمیان اور دو پرسکون کنارے ہیں۔ اگر استاد زیادہ یکساں تیاری چاہتے ہیں تو کم سرے والے طلبہ، نہ کہ اوسط، مدد کے مستحق ہیں۔ اب نمونے کی جگہ اپنے دس جواب رکھیں اور اپنا غور اپنے نمبروں سے لکھیں — کتاب کا یہی مقصد ہے۔

Sample: 4, 5, 6, 6, 6, 7, 8, 9, 10, 12 hours (sorted)Mean 7.3 · Median 6.5 · Mode 6 · SD ≈ 2.33 hoursTallest bar is not the mode here — count repeats, not height: 6 repeats 3 times
Class activity سمجھو: اپنی class کے 10 اصلی جواب لو, وہی پانچ حساب لگاؤ, پھر 3–4 جملوں میں لکھو کے class کی عادت کیا کہتی ہے.
5.2 — Data Collection and Preparation۵.۲ — ڈیٹا اکٹھا کرنا اور تیار کرنا
🏷 Tags: data collection, data preparation, quality, relevance
ENGLISH

Good analysis starts before any calculation, and this section says why in one blunt sentence: in order to carry out any research or analysis, data collection and preparation are crucial steps, because the quality and relevance of the data directly impact the results and insights drawn from the study. In other words, a beautiful model built on careless data will give you a confident wrong answer. Garbage in, confident garbage out — only the book says it more politely.

Think of it as cooking. The recipe is your analysis, the ingredients are your data, and no amount of skilled cooking rescues rotten ingredients. If you survey the wrong people, watch the wrong thing, or feed the model a spreadsheet full of blanks and spelling mistakes, the final chart will look professional and still mislead you. That is why the book spends a whole section here, before any modelling, on how data is gathered and then made fit to use.

The section divides into two jobs. Collection is gathering relevant information for a particular purpose — and the right method depends on the research objective and the type of data required. Preparation is what happens after gathering: cleaning, organising and converting the data into a format suitable for analysis. The next few sections walk through both jobs in the book's order: surveys, observations and experiments first, then preparation, cleaning, transformation and missing data.

اردو

اچھا تجزیہ کسی بھی حساب سے پہلے شروع ہوتا ہے، اور یہ حصہ ایک دو ٹوک جملے میں بتاتا ہے کہ کیوں: کوئی بھی تحقیق یا تجزیہ کرنے کے لیے ڈیٹا اکٹھا کرنا اور تیار کرنا نہایت اہم مراحل ہیں، کیونکہ ڈیٹا کا معیار اور مطابقت براہ راست مطالعے سے نکلنے والے نتائج اور بصیرتوں پر اثر ڈالتے ہیں۔ دوسرے الفاظ میں، لاپرواہی سے جمع کردہ ڈیٹا پر بنایا گیا خوبصورت ماڈل آپ کو پراعتماد غلط جواب دے گا۔ خراب اندراج، پراعتماد خراب نتیجہ — صرف کتاب اسے زیادہ شائستگی سے کہتی ہے۔

اسے کھانا پکانے کی طرح سمجھیں۔ ترکیب آپ کا تجزیہ ہے، اجزا آپ کا ڈیٹا ہیں، اور مہارت سے پکانا بھی خراب اجزا کو نہیں بچا سکتا۔ اگر آپ غلط لوگوں کا سروے کریں، غلط چیز دیکھیں، یا ماڈل کو خالی خانوں اور ہجے کی غلطیوں سے بھری اسپریڈ شیٹ دیں تو آخری چارٹ پیشہ ورانہ لگے گا اور پھر بھی گمراہ کرے گا۔ اسی لیے کتاب ماڈلنگ سے پہلے ایک پورا حصہ اس پر صرف کرتی ہے کہ ڈیٹا کیسے جمع کیا جائے اور پھر استعمال کے قابل کیسے بنایا جائے۔

یہ حصہ دو کاموں میں بٹتا ہے۔ اکٹھا کرنا کسی خاص مقصد کے لیے متعلقہ معلومات جمع کرنا ہے — اور درست طریقہ تحقیق کے مقصد اور درکار ڈیٹا کی قسم پر منحصر ہے۔ تیار کرنا جمع کرنے کے بعد ہوتا ہے: ڈیٹا کو صاف کرنا، منظم کرنا اور تجزیے کے لیے موزوں شکل میں بدلنا۔ اگلے چند حصے کتاب کی ترتیب میں دونوں کاموں سے گزریں گے: پہلے سروے، مشاہدے اور تجربات، پھر تیاری، صفائی، تبدیلی اور گمشدہ ڈیٹا۔

1. Collectsurvey · watch · test2. Prepareclean · organise3. Analyseonly then trust itSkip step 2 and even a perfect model will mislead you
Collection سمجھو: پہلے صحیح طریقے سے جمع کرو, پھر صاف اور ترتیب دے کر تیار کرو — تب جا کر تجزیہ پر بھروسہ کرو.
5.2.1.1 — Surveys۵.۲.۱.۱ — سروے
🏷 Tags: surveys, questionnaire, sample group, online forms
ENGLISH

Surveys are a commonly used method for collecting large amounts of data in a structured way. The key words there are large and structured: instead of chatting freely with three people, you ask a predefined set of questions to a sample group — the same questions, in the same order, for everyone. That sameness is what makes the answers countable afterwards. Surveys can be conducted using various means such as online forms, telephone calls, or face-to-face interviews, and the medium changes the cost and the reach but not the idea.

The book's example is a small local grocery store in Islamabad that wants to know customer preferences regarding which products they would like to see more frequently. The store creates a short survey of five questions and distributes it to 50 customers over the weekend. Read the questions slowly, because they are a good model: (1) Which product categories do you buy most often? (e.g. fruits, vegetables, dairy) (2) Are there any products you would like to see more often? (3) How often do you shop at this grocery store? (e.g. daily, weekly, monthly) (4) What influences your purchasing decisions the most? (e.g. price, quality, availability) (5) Any additional comments or suggestions?

Notice what makes those five questions work. The first sorts customers into categories you can count. The third measures frequency, so "daily" shoppers can be separated from "monthly" ones. The fourth asks for a reason, not just a fact, which is what a shopkeeper actually needs to act on. And the last question is open on purpose — it catches the answer nobody thought to ask about. After collecting, the responses are analysed to stock products that align with customer demand, helping improve business operations. A survey that ends in a drawer has failed; this one ends in a stocking decision, which is the whole point.

اردو

سروے بڑی مقدار میں ڈیٹا منظم طریقے سے اکٹھا کرنے کا ایک عام طریقہ ہے۔ یہاں اہم الفاظ بڑی مقدار اور منظم ہیں: تین لوگوں سے آزادانہ گپ شپ کی بجائے آپ پہلے سے طے شدہ سوالات کا ایک مجموعہ نمونہ گروہ سے پوچھتے ہیں — وہی سوالات، وہی ترتیب، سب کے لیے۔ یہ یکسانیت ہی بعد میں جوابات کو قابل شمار بناتی ہے۔ سروے مختلف ذرائع سے کیے جا سکتے ہیں جیسے آن لائن فارم، ٹیلی فون کالز، یا آمنے سامنے انٹرویو، اور ذریعہ لاگت اور رسائی بدلتا ہے لیکن خیال نہیں۔

کتاب کی مثال اسلام آباد کی ایک چھوٹی مقامی کریانہ دکان ہے جو جاننا چاہتی ہے کہ گاہک کن مصنوعات کو زیادہ بار دیکھنا چاہیں گے۔ دکان پانچ سوالات کا مختصر سروے بناتی ہے اور ہفتے کے آخر میں ۵۰ گاہکوں میں تقسیم کرتی ہے۔ سوالات آہستہ پڑھیں، کیونکہ وہ ایک اچھا نمونہ ہیں: (۱) آپ سب سے زیادہ کون سی مصنوعات کی اقسام خریدتے ہیں؟ (مثلاً پھل، سبزیاں، ڈیری) (۲) کیا کوئی ایسی مصنوعات ہیں جو آپ زیادہ بار دیکھنا چاہیں گے؟ (۳) آپ اس کریانہ دکان پر کتنی بار خریداری کرتے ہیں؟ (مثلاً روزانہ، ہفتہ وار، ماہانہ) (۴) آپ کے خریداری کے فیصلوں پر سب سے زیادہ کیا اثر ڈالتا ہے؟ (مثلاً قیمت، معیار، دستیابی) (۵) کوئی اضافی تبصرے یا تجاویز؟

دیکھیں کہ ان پانچ سوالات کو کیا کارآمد بناتا ہے۔ پہلا گاہکوں کو ایسی اقسام میں بانٹتا ہے جنہیں آپ گن سکتے ہیں۔ تیسرا تعدد ناپتا ہے، تاکہ "روزانہ" خریداروں کو "ماہانہ" والوں سے الگ کیا جا سکے۔ چوتھا صرف حقیقت نہیں بلکہ وجہ پوچھتا ہے، جو دکاندار کو عمل کے لیے واقعی چاہیے۔ اور آخری سوال جان بوجھ کر کھلا ہے — یہ وہ جواب پکڑتا ہے جس کے بارے میں کسی نے پوچھنے کا سوچا ہی نہیں تھا۔ جمع کرنے کے بعد جوابات کا تجزیہ کر کے گاہکوں کی مانگ سے ہم آہنگ مصنوعات رکھی جاتی ہیں، جس سے کاروباری کارروائی بہتر ہوتی ہے۔ جو سروے دراز میں ختم ہو وہ ناکام ہے؛ یہ والا ذخیرہ کرنے کے فیصلے پر ختم ہوتا ہے، اور یہی اصل مقصد ہے۔

Customer Preference Survey1. What do you buy most often?2. What would you like more of?3. How often do you shop here?4. What influences you most?Same 5 questions × 50 customers = countable answers
Survey سمجھو: سب سے وہی سوال پوچھو, جواب گننے کے قابل بن جائیں گے — پھر ان جوابوں پر دکان کا فیصلہ کرو.
5.2.1.2 — Observations۵.۲.۱.۲ — مشاہدات (Observations)
🏷 Tags: observation, natural environment, behaviour, without interference
ENGLISH

Observation involves collecting data by watching or monitoring subjects in their natural environment. The phrase to hold onto is without interference. A survey asks people what they do; observation watches what they actually do, in the place where they normally do it, without stepping in and changing the scene. The book says this method is useful when researchers want to gather data on behaviours or phenomena without interference — and that is exactly when asking would spoil the answer, because people behave differently once they know they are being studied, or simply misremember.

The book's example is a restaurant that is interested in knowing which tables are most frequently chosen by customers during lunchtime. A staff member observes the seating choices over a period of one week. Based on these observations, the restaurant arranges its seating to optimise customer comfort and traffic flow, which helps in improving customer satisfaction and service efficiency. Walk through why this had to be observation, not a survey. Asking "which table do you prefer?" gets opinions and polite answers; watching for a week gets the truth — the corner table that fills first, the draughty table everyone avoids, the large table that small parties keep occupying.

Two cautions belong with this method, even though the book states them briefly. First, observation takes time — a week of lunchtimes, not a five-minute questionnaire. Second, the observer must be careful not to disturb the scene: a waiter hovering with a clipboard changes where people sit. Done quietly, though, observation is the most honest method in the chapter, because the subjects are not performing for anyone. They are just having lunch.

اردو

مشاہدہ مضامین کو ان کے قدرتی ماحول میں دیکھ کر یا ان کی نگرانی کر کے ڈیٹا اکٹھا کرنے کا نام ہے۔ جس جملے کو پکڑ کر رکھنا ہے وہ ہے مداخلت کے بغیر۔ سروے لوگوں سے پوچھتا ہے کہ وہ کیا کرتے ہیں؛ مشاہدہ دیکھتا ہے کہ وہ حقیقت میں کیا کرتے ہیں، اسی جگہ جہاں وہ عام طور پر کرتے ہیں، بغیر منظر میں داخل ہو کر اسے بدلے۔ کتاب کہتی ہے کہ یہ طریقہ اس وقت مفید ہے جب محققین بغیر مداخلت کے رویوں یا مظاہر پر ڈیٹا جمع کرنا چاہیں — اور یہ بالکل وہ موقع ہے جب پوچھنا جواب خراب کر دے گا، کیونکہ لوگ یہ جان کر کہ ان کا مطالعہ ہو رہا ہے مختلف سلوک کرتے ہیں، یا بس غلط یاد کرتے ہیں۔

کتاب کی مثال ایک ریستوران ہے جو جاننا چاہتا ہے کہ دوپہر کے کھانے کے وقت گاہک کون سی میزیں سب سے زیادہ چنتے ہیں۔ عملے کا ایک رکن ایک ہفتے تک بیٹھنے کے انتخاب کا مشاہدہ کرتا ہے۔ ان مشاہدوں کی بنیاد پر ریستوران اپنی نشستوں کی ترتیب کو بہتر بناتا ہے تاکہ گاہکوں کا آرام اور آمد و رفت بہتر ہو، جس سے گاہکوں کی اطمینان اور خدمت کی کارکردگی بہتر ہوتی ہے۔ سوچیں کہ یہ مشاہدہ ہی کیوں ہونا تھا، سروے کیوں نہیں۔ "آپ کون سی میز پسند کرتے ہیں؟" پوچھنے سے آراء اور شائستہ جواب ملتے ہیں؛ ایک ہفتہ دیکھنے سے سچ ملتا ہے — کونے والی میز جو پہلے بھرتی ہے، ہوا دار میز جس سے سب بچتے ہیں، بڑی میز جس پر چھوٹے گروہ قابض رہتے ہیں۔

اس طریقے کے ساتھ دو احتیاطیں بھی ہیں، اگرچہ کتاب انہیں مختصر بیان کرتی ہے۔ پہلی، مشاہدے میں وقت لگتا ہے — پانچ منٹ کا سوالنامہ نہیں، دوپہر کے کھانوں کا ایک ہفتہ۔ دوسری، مشاہدہ کرنے والے کو منظر میں خلل نہیں ڈالنا چاہیے: کلپ بورڈ لیے کھڑا ویٹر لوگوں کے بیٹھنے کی جگہ بدل دیتا ہے۔ لیکن خاموشی سے کیا جائے تو مشاہدہ اس باب کا سب سے ایماندار طریقہ ہے، کیونکہ مضامین کسی کے لیے اداکاری نہیں کر رہے ہوتے۔ وہ بس دوپہر کا کھانا کھا رہے ہوتے ہیں۔

Watch quietly for a week — do not ask, do not disturbTable A ★★Table B ★Table C —Filled first every day: Table A. Avoided: Table C by the door.Result: rearrange seating for comfort and flow👁
Observation سمجھو: پوچھو مت, چپ chap دیکھو کے log اصل میں کیا کرتے ہیں — وہی سچا data ہے.
5.2.1.3 — Experiments۵.۲.۱.۳ — تجربات (Experiments)
🏷 Tags: experiments, variables, control, comparison groups
ENGLISH

Experiments involve manipulating one or more variables to determine their effect on another variable. That word manipulating is what separates an experiment from observation: here you do not just watch, you deliberately change one thing and keep everything else as steady as you can, so that any difference in the result can be blamed on the change you made. The book notes this method is particularly useful in scientific and engineering fields where controlled environments are necessary for accurate measurement — a laboratory, or a classroom run like one.

The book's example is a school teacher who wants to test whether providing students with printed notes helps improve their performance in exams. The teacher conducts an experiment with two groups of students, one receiving printed notes and the other relying solely on lectures. After one month, both groups took the same test, and the teacher compared the results to see if printed notes had a positive impact on academic performance. Break that design into its parts and it teaches itself. The changed variable is printed notes versus lectures only. The measured variable is the test score. The control is everything held equal: the same month, the same test, presumably the same teaching apart from the notes.

That "same test" detail is the whole secret of a fair experiment. If the notes group had taken an easier test, a higher score would prove nothing. If the groups had studied for different lengths of time, the time, not the notes, might explain the result. When you read any experiment — in this book or in the news — ask first: what was changed, what was measured, and what was kept the same? If those three answers are clear, the conclusion has a chance. If they are not, it does not, however impressive the numbers look.

اردو

تجربات میں ایک یا زیادہ متغیرات کو تبدیل کر کے دوسرے متغیر پر ان کے اثر کا تعین کیا جاتا ہے۔ یہ لفظ تبدیل کرنا ہی تجربے کو مشاہدے سے الگ کرتا ہے: یہاں آپ صرف دیکھتے نہیں، آپ جان بوجھ کر ایک چیز بدلتے ہیں اور باقی سب کچھ جتنا ممکن ہو مستحکم رکھتے ہیں، تاکہ نتیجے میں کوئی بھی فرق اس تبدیلی کے کھاتے میں ڈالا جا سکے جو آپ نے کی۔ کتاب نوٹ کرتی ہے کہ یہ طریقہ خاص طور پر سائنسی اور انجینئرنگ شعبوں میں مفید ہے جہاں درست پیمائش کے لیے قابو شدہ ماحول ضروری ہے — ایک لیبارٹری، یا ایک کلاس روم جو لیبارٹری کی طرح چلایا جائے۔

کتاب کی مثال ایک اسکول ٹیچر ہے جو جانچنا چاہتی ہے کہ کیا طلبہ کو چھپی ہوئی نوٹس دینے سے امتحانات میں ان کی کارکردگی بہتر ہوتی ہے۔ ٹیچر دو گروہوں کے ساتھ تجربہ کرتی ہے، ایک کو چھپی ہوئی نوٹس ملتی ہیں اور دوسرا صرف لیکچرز پر انحصار کرتا ہے۔ ایک مہینے بعد دونوں گروہوں نے وہی ٹیسٹ دیا، اور ٹیچر نے نتائج کا موازنہ کیا کہ آیا چھپی ہوئی نوٹس کا تعلیمی کارکردگی پر مثبت اثر ہوا۔ اس ڈیزائن کو اس کے حصوں میں توڑیں تو وہ خود سکھاتا ہے۔ بدلا گیا متغیر چھپی ہوئی نوٹس بمقابلہ صرف لیکچرز ہے۔ ناپا گیا متغیر ٹیسٹ کا نمبر ہے۔ قابو وہ سب کچھ ہے جو برابر رکھا گیا: وہی مہینہ، وہی ٹیسٹ، غالباً نوٹس کے علاوہ وہی تدریس۔

"وہی ٹیسٹ" والی تفصیل ایک منصفانہ تجربے کا پورا راز ہے۔ اگر نوٹس والے گروہ نے آسان ٹیسٹ دیا ہوتا تو زیادہ نمبر کچھ ثابت نہ کرتا۔ اگر گروہوں نے مختلف مدت تک پڑھا ہوتا تو وقت، نہ کہ نوٹس، نتیجے کی وضاحت کر سکتا تھا۔ جب بھی آپ کوئی تجربہ پڑھیں — اس کتاب میں یا خبروں میں — پہلے پوچھیں: کیا بدلا گیا، کیا ناپا گیا، اور کیا ایک جیسا رکھا گیا؟ اگر ان تینوں کے جواب واضح ہوں تو نتیجے کا امکان ہے۔ اگر نہ ہوں تو نہیں، چاہے نمبر کتنے ہی متاثر کن لگیں۔

Group 1: printed notessame month, same teacherGroup 2: lectures onlysame month, same teacherSame test → compare scores
Experiment samjho: aik cheez badlo, baqi sab barabar rakho, phir natija naapo — tabhi pata chale ga ke farq kis cheez se para.
5.2.2 & 5.2.3.1 — Data Preparation and Data Cleaning۵.۲.۲ اور ۵.۲.۳.۱ — ڈیٹا کی تیاری اور صفائی
🏷 Tags: data preparation, data cleaning, errors, duplicates, missing values
ENGLISH

Once data has been collected, it is important to prepare it for analysis. The book lists what preparation includes in one breath: cleaning the data to remove errors or inconsistencies, organising it in a meaningful way, and converting it into a format suitable for analysis. It also warns that in cases where data is missing or incorrect, researchers may need to employ techniques such as interpolation or statistical adjustments to ensure the accuracy and reliability of the results. In plain terms, raw data is rarely ready; preparation is the workshop where it is made ready, and the book is blunt that proper preparation ensures the analysis leads to reliable and valid results.

Inside preparation sits data cleaning: correcting or removing any problems in the data. These problems can include incorrect entries, missing values, or duplicate results, and the book's warning is direct — if these errors are not fixed, the results of the analysis will be misleading. The example is a school collecting data on student scores, where some students may have entered their names incorrectly, or a few scores may be missing from the records. Cleaning would involve correcting any wrong names and including the missing grades to complete the dataset.

Tables 5.1 and 5.2 illustrate the process. Table 5.1, "Original Data (with Errors)," lists Ali 84, Alie 90, and Sara with a blank score, all in Class 10 Section A. Table 5.2, "Cleaned Data (After Data Cleaning)," lists Ali 84, Alie 90, and Sara 87 — and notice the column heading quietly changes from "Scores" to "Grade." ⚠️ Two things to notice, flagged honestly: first, Sara's 87 does not come from Table 5.1 at all — it is the class-average value that section 5.2.3.3 later explains as an imputation, so Table 5.2 is really showing the cleaned and completed data, not cleaning alone. Second, Ali and Alie are kept as two separate rows even though the text mentions incorrect names; the book does not merge them into one student, so this page keeps the book's table exactly as printed and does not invent a merger. The text also says the tables show common issues such as incorrect names, missing scores and duplicate entries — the missing score is clearly Sara's blank, while no obvious duplicate row appears in Table 5.1 itself.

اردو

ڈیٹا اکٹھا ہو جانے کے بعد اسے تجزیے کے لیے تیار کرنا اہم ہے۔ کتاب ایک سانس میں بتاتی ہے کہ تیاری میں کیا شامل ہے: ڈیٹا کو صاف کرنا تاکہ غلطیاں یا تضادات دور ہوں، اسے بامعنی انداز میں منظم کرنا، اور اسے تجزیے کے لیے موزوں شکل میں بدلنا۔ وہ یہ بھی خبردار کرتی ہے کہ جہاں ڈیٹا گمشدہ یا غلط ہو، محققین کو نتائج کی درستگی اور قابل اعتمادی یقینی بنانے کے لیے انٹرپولیشن یا شماریاتی ایڈجسٹمنٹ جیسی تکنیکیں استعمال کرنی پڑ سکتی ہیں۔ سادہ الفاظ میں، کچا ڈیٹا شاذ ہی تیار ہوتا ہے؛ تیاری وہ ورکشاپ ہے جہاں اسے تیار کیا جاتا ہے، اور کتاب دو ٹوک کہتی ہے کہ مناسب تیاری یقینی بناتی ہے کہ تجزیہ قابل اعتماد اور درست نتائج دے۔

تیاری کے اندر ڈیٹا صفائی ہے: ڈیٹا میں کوئی بھی مسئلہ درست کرنا یا دور کرنا۔ ان مسائل میں غلط اندراجات، گمشدہ قیمتیں، یا نقل شدہ نتائج شامل ہو سکتے ہیں، اور کتاب کی تنبیہ سیدھی ہے — اگر یہ غلطیاں ٹھیک نہ کی جائیں تو تجزیے کے نتائج گمراہ کن ہوں گے۔ مثال ایک اسکول ہے جو طلبہ کے نمبروں کا ڈیٹا جمع کر رہا ہے، جہاں کچھ طلبہ نے اپنے نام غلط لکھے ہوں، یا چند نمبر ریکارڈ سے گم ہوں۔ صفائی میں غلط نام درست کرنا اور ڈیٹا سیٹ مکمل کرنے کے لیے گمشدہ گریڈ شامل کرنا ہوگا۔

ٹیبل ۵.۱ اور ۵.۲ اس عمل کو واضح کرتے ہیں۔ ٹیبل ۵.۱، "اصل ڈیٹا (غلطیوں کے ساتھ)"، علی ۸۴، عالیہ ۹۰، اور سارہ خالی نمبر کے ساتھ درج کرتا ہے، سب کلاس ۱۰ سیکشن A میں۔ ٹیبل ۵.۲، "صاف شدہ ڈیٹا (ڈیٹا صفائی کے بعد)"، علی ۸۴، عالیہ ۹۰، اور سارہ ۸۷ درج کرتا ہے — اور دیکھیں کہ کالم کا عنوان خاموشی سے "Scores" سے "Grade" میں بدل جاتا ہے۔ ⚠️ دو چیزیں ایمانداری سے نوٹ کریں: پہلی، سارہ کا ۸۷ ٹیبل ۵.۱ سے بالکل نہیں آتا — یہ کلاس کی اوسط قیمت ہے جسے حصہ ۵.۲.۳.۳ بعد میں امپیوٹیشن کے طور پر سمجھاتا ہے، اس لیے ٹیبل ۵.۲ واقعی صاف شدہ اور مکمل شدہ ڈیٹا دکھا رہا ہے، صرف صفائی نہیں۔ دوسری، علی اور عالیہ کو دو الگ قطاروں کے طور پر رکھا گیا ہے اگرچہ متن میں غلط ناموں کا ذکر ہے؛ کتاب انہیں ایک طالب علم میں ضم نہیں کرتی، اس لیے یہ صفحہ کتاب کی ٹیبل کو بالکل جیسا چھپا ہے ویسا ہی رکھتا ہے اور ضم ایجاد نہیں کرتا۔ متن یہ بھی کہتا ہے کہ ٹیبل غلط ناموں، گمشدہ نمبروں اور نقل شدہ اندراجات جیسے عام مسائل دکھاتے ہیں — گمشدہ نمبر واضح طور پر سارہ کا خالی خانہ ہے، جبکہ ٹیبل ۵.۱ میں کوئی واضح نقل شدہ قطار نظر نہیں آتی۔

Table 5.1 → Table 5.2: what actually changes?BEFORE (with errors)Ali 84 · Alie 90 · Sara —Sara: score missing ✗AFTER (cleaned)Ali 84 · Alie 90 · Sara 8787 = class average (see 5.2.3.3)Cleaning fixes errors — but a filled gap must be explained, not hidden
Cleaning سمجھو: غلطیاں ٹھیک کرو, خالی جگہ کا حساب دو — اور جو قیمت اندازے سے بھری ہو اسے chhupao مت.
5.2.3.2 — Data Transformation۵.۲.۳.۲ — ڈیٹا کی تبدیلی (Transformation)
🏷 Tags: data transformation, format, aggregate, summarise, class-level
ENGLISH

Once the data is clean, it often needs to be transformed into a format that is easier to work with. The book's definition is practical rather than grand: transformation may include converting data into different formats, creating new columns, or organising data in a different way, and these changes help make the data more suitable for analysis or modelling. In other words, cleaning asks "is this data correct?" while transformation asks "is this data in the shape I need?" A correct list in the wrong shape still slows every later step down.

The book's example stays with the student grade records. After cleaning, it may be necessary to transform this data for better analysis — for instance, instead of displaying grades for each individual student, the data might be aggregated or summarised to show class-level statistics such as average scores or grade distribution. Picture the difference. The cleaned table has one row per student, which is perfect for finding Sara's grade but useless for answering "how did Class 10-A do overall?" The transformed version has one row per class — Class 10-A: average 87, highest 90, lowest 84 — and that one row answers the class question instantly.

Other transformations follow the same idea and are worth recognising even though the book only names the categories. Converting a date written as "12/3/26" into a proper date column is a format change. Adding a new column that turns marks into pass/fail is creating a new column. Sorting students by section, or grouping daily sales into monthly totals, is organising data differently. In every case the information is not invented or deleted; it is reshaped so the question you actually want to ask becomes easy to answer. That reshaping, done after cleaning and before modelling, is transformation.

اردو

ڈیٹا صاف ہو جانے کے بعد اسے اکثر ایسی شکل میں بدلنے کی ضرورت ہوتی ہے جس کے ساتھ کام کرنا آسان ہو۔ کتاب کی تعریف شاندار نہیں بلکہ عملی ہے: تبدیلی میں ڈیٹا کو مختلف شکلوں میں بدلنا، نئے کالم بنانا، یا ڈیٹا کو مختلف انداز میں منظم کرنا شامل ہو سکتا ہے، اور یہ تبدیلیاں ڈیٹا کو تجزیے یا ماڈلنگ کے لیے زیادہ موزوں بنانے میں مدد دیتی ہیں۔ دوسرے الفاظ میں، صفائی پوچھتی ہے "کیا یہ ڈیٹا درست ہے؟" جبکہ تبدیلی پوچھتی ہے "کیا یہ ڈیٹا اس شکل میں ہے جو مجھے چاہیے؟" غلط شکل میں درست فہرست بھی بعد کے ہر مرحلے کو سست کر دیتی ہے۔

کتاب کی مثال طلبہ کے گریڈ ریکارڈ کے ساتھ رہتی ہے۔ صفائی کے بعد بہتر تجزیے کے لیے اس ڈیٹا کو تبدیل کرنا ضروری ہو سکتا ہے — مثال کے طور پر، ہر انفرادی طالب علم کے گریڈ دکھانے کی بجائے ڈیٹا کو جمع یا خلاصہ کر کے کلاس کی سطح کے اعداد دکھائے جا سکتے ہیں جیسے اوسط نمبر یا گریڈ کی تقسیم۔ فرق کو ذہن میں لائیں۔ صاف شدہ ٹیبل میں فی طالب علم ایک قطار ہے، جو سارہ کا گریڈ ڈھونڈنے کے لیے بہترین ہے لیکن "کلاس ۱۰-A نے مجموعی طور پر کیسا کیا؟" کا جواب دینے کے لیے بیکار ہے۔ تبدیل شدہ ورژن میں فی کلاس ایک قطار ہے — کلاس ۱۰-A: اوسط ۸۷، سب سے زیادہ ۹۰، سب سے کم ۸۴ — اور وہ ایک قطار کلاس کے سوال کا فوراً جواب دیتی ہے۔

دوسری تبدیلیاں اسی خیال کی پیروی کرتی ہیں اور پہچاننے کے قابل ہیں اگرچہ کتاب صرف اقسام کے نام دیتی ہے۔ "۱۲/۳/۲۶" لکھی تاریخ کو مناسب تاریخ کے کالم میں بدلنا شکل کی تبدیلی ہے۔ نمبروں کو پاس/فیل میں بدلنے والا نیا کالم بنانا نیا کالم بنانا ہے۔ طلبہ کو سیکشن کے حساب سے ترتیب دینا، یا روزانہ فروخت کو ماہانہ مجموعوں میں گروپ کرنا، ڈیٹا کو مختلف انداز میں منظم کرنا ہے۔ ہر صورت میں معلومات ایجاد یا حذف نہیں کی جاتیں؛ اسے اس طرح ڈھالا جاتا ہے کہ جو سوال آپ واقعی پوچھنا چاہتے ہیں وہ آسانی سے جواب دینے کے قابل ہو جائے۔ یہ ڈھالنا، صفائی کے بعد اور ماڈلنگ سے پہلے، تبدیلی ہے۔

Same information, reshaped for a new questionOne row per studentAli 84 · Alie 90 · Sara 87Good for: find SaraOne row per class10-A: avg 87, max 90Good for: how did the class do?Nothing invented, nothing deleted — only the shape changed
Transformation سمجھو: معلومات وہی, شکل نئی — سوال کے حساب سے table کو ڈھل لو تاکہ جواب فوراً ملے.
5.2.3.3 — Handling Missing Data۵.۲.۳.۳ — گمشدہ ڈیٹا سے نمٹنا
🏷 Tags: missing data, imputation, flagging, removal
ENGLISH

Sometimes, data is incomplete or has missing values, and the book is honest that there is no single correct response — there are different techniques, and the choice depends on the type of data and the amount of missing information. That last clause matters: a method that is sensible for one missing mark out of a hundred is reckless for half a missing column. The example returns to Sara, whose grade is missing, which creates a challenge in assessing her performance. Three strategies are given, and they are worth comparing side by side rather than memorising as a list.

1. Imputation: estimate the missing value using existing data. The school can calculate the average score of all students in Sara's class; if the average score is 87, the school may assign this value to Sara's record temporarily. This keeps the dataset complete and lets every calculation run, but it is an assumption dressed as a number — Sara did not score 87, the class did on average. That is why the book says "temporarily," and why Table 5.2's 87 should always carry this explanation with it. 2. Flagging: keep track of the missing score by adding a note in the dataset, indicating that Sara's score is not available. This makes analysts aware of the incomplete data, ensures transparency, and allows the analysis to proceed without filling in the gap. Flagging is the honest option: the gap stays visible. 3. Removal: if the number of missing entries is small, the school might exclude Sara's record from specific analyses. This is acceptable if it does not significantly impact the overall understanding of student performance, but it risks losing valuable information about Sara — and if many records are removed, the "class" you describe is no longer the real class.

So which should you choose? Use the book's own test. If very few values are missing and the analysis can survive without them, removal is clean. If completeness matters and a sensible estimate exists, imputation is practical — but label it as estimated, every time. If honesty about the gap matters more than a tidy table, flag it. A good analyst can defend the choice in one sentence; a careless one just fills the blank and hopes nobody asks.

اردو

کبھی کبھی ڈیٹا نامکمل ہوتا ہے یا اس میں گمشدہ قیمتیں ہوتی ہیں، اور کتاب ایمانداری سے کہتی ہے کہ کوئی واحد درست جواب نہیں ہے — مختلف تکنیکیں ہیں، اور انتخاب ڈیٹا کی قسم اور گمشدہ معلومات کی مقدار پر منحصر ہے۔ یہ آخری شرط اہم ہے: جو طریقہ سو میں سے ایک گمشدہ نمبر کے لیے سمجھدار ہے وہ آدھے گمشدہ کالم کے لیے لاپرواہی ہے۔ مثال سارہ کی طرف لوٹتی ہے، جس کا گریڈ گمشدہ ہے، جو اس کی کارکردگی جانچنے میں چیلنج پیدا کرتا ہے۔ تین حکمت عملیاں دی گئی ہیں، اور انہیں فہرست کی طرح رٹنے کی بجائے آمنے سامنے موازنہ کر کے سمجھنا فائدہ مند ہے۔

۱. امپیوٹیشن: موجودہ ڈیٹا سے گمشدہ قیمت کا اندازہ لگانا۔ اسکول سارہ کی کلاس کے تمام طلبہ کا اوسط نمبر نکال سکتا ہے؛ اگر اوسط نمبر ۸۷ ہے تو اسکول عارضی طور پر یہ قیمت سارہ کے ریکارڈ میں لگا سکتا ہے۔ اس سے ڈیٹا سیٹ مکمل رہتا ہے اور ہر حساب چلتا ہے، لیکن یہ ایک مفروضہ ہے جو نمبر کی صورت میں ہے — سارہ نے ۸۷ نہیں لیے، کلاس نے اوسطاً لیے۔ اسی لیے کتاب "عارضی طور پر" کہتی ہے، اور اسی لیے ٹیبل ۵.۲ کے ۸۷ کے ساتھ ہمیشہ یہ وضاحت ہونی چاہیے۔ ۲. فلیگنگ: ڈیٹا سیٹ میں نوٹ لگا کر گمشدہ نمبر کا ریکارڈ رکھنا، جو بتائے کہ سارہ کا نمبر دستیاب نہیں ہے۔ اس سے تجزیہ کار نامکمل ڈیٹا سے آگاہ رہتے ہیں، شفافیت یقینی ہوتی ہے، اور تجزیہ خلا بھرے بغیر آگے بڑھ سکتا ہے۔ فلیگنگ ایماندار آپشن ہے: خلا نظر آتا رہتا ہے۔ ۳. حذف کرنا: اگر گمشدہ اندراجات بہت کم ہوں تو اسکول مخصوص تجزیوں سے سارہ کا ریکارڈ خارج کر سکتا ہے۔ یہ قابل قبول ہے اگر اس سے طلبہ کی کارکردگی کی مجموعی سمجھ پر نمایاں اثر نہ پڑے، لیکن اس سے سارہ کے بارے میں قیمتی معلومات ضائع ہونے کا خطرہ ہے — اور اگر کئی ریکارڈ حذف کر دیے جائیں تو جس "کلاس" کی آپ وضاحت کرتے ہیں وہ حقیقی کلاس نہیں رہتی۔

پس آپ کس کا انتخاب کریں؟ کتاب کا اپنا معیار استعمال کریں۔ اگر بہت کم قیمتیں گمشدہ ہوں اور تجزیہ ان کے بغیر چل سکے تو حذف کرنا صاف ہے۔ اگر مکمل ہونا اہم ہو اور معقول اندازہ موجود ہو تو امپیوٹیشن عملی ہے — لیکن ہر بار اسے اندازہ لکھیں۔ اگر خلا کے بارے میں ایمانداری صاف ستھری ٹیبل سے زیادہ اہم ہو تو اسے فلیگ کریں۔ ایک اچھا تجزیہ کار اپنے انتخاب کا ایک جملے میں دفاع کر سکتا ہے؛ ایک لاپرواہ صرف خالی جگہ بھر دیتا ہے اور امید کرتا ہے کہ کوئی نہیں پوچھے گا۔

1. ImputationSara = 87 (class avg)complete, but estimated2. FlaggingSara = “missing ⚑”gap stays visible3. RemovalSara row droppedclean, but loses SaraFew missing → removal · Need completeness → imputation · Need honesty → flagging
Missing data samjho: khaali jagah ko ya andaze se bharo, ya nishan laga kar khula chhoro, ya hata do — har tareeqe ki qeemat bata kar.
5.3 & 5.3.1 — Building Statistical Models: Introduction۵.۳ اور ۵.۳.۱ — شماریاتی ماڈل بنانا: تعارف
🏷 Tags: statistical model, prediction, real world, past data
ENGLISH

In this section, we will explore the basic building blocks of statistical models, including different types of models, how they are developed, and how to evaluate their performance — and the book promises real-world examples to make the concepts easy to understand. That promise is kept: every model in this chapter arrives with a shop, a classroom or a grocery bill attached. Before the types, though, comes the idea itself. Statistical modelling is introduced as a way to analyse data to make sense of the real world and to predict what will happen in the future.

The book's own analogy does the explaining better than any definition could. Think of it like this: if you want to know how much money you will spend on groceries next month, you can look at your past expenses. By analysing that data, you can create a model to help you estimate your future grocery expenses. Notice the direction of time in that sentence. The past is the teacher, the model is the lesson learned, and the future is the exam. A model is not a crystal ball; it is a summary of what has already happened, turned into a rule for what usually happens next.

That also tells you when a model will fail. If next month is nothing like the past months — a wedding, a guest staying over, prices suddenly rising — the model will still predict the old pattern, because the old pattern is all it knows. Models are powerful exactly when the future resembles the past, and dangerous exactly when it does not. Keep that warning beside every model in this chapter, and you will already be thinking like someone who evaluates models rather than just believing them.

اردو

اس حصے میں ہم شماریاتی ماڈلوں کے بنیادی اجزا کا جائزہ لیں گے، بشمول ماڈلوں کی مختلف اقسام، وہ کیسے تیار کیے جاتے ہیں، اور ان کی کارکردگی کیسے جانچی جاتی ہے — اور کتاب حقیقی دنیا کی مثالوں کا وعدہ کرتی ہے تاکہ تصورات سمجھنا آسان ہو۔ یہ وعدہ پورا ہوتا ہے: اس باب کا ہر ماڈل کسی دکان، کلاس روم یا کریانہ بل کے ساتھ آتا ہے۔ اقسام سے پہلے خود خیال آتا ہے۔ شماریاتی ماڈلنگ کو ڈیٹا کا تجزیہ کرنے کا طریقہ بتایا گیا ہے تاکہ حقیقی دنیا کو سمجھا جا سکے اور پیش گوئی کی جا سکے کہ مستقبل میں کیا ہوگا۔

کتاب کی اپنی مثال کسی بھی تعریف سے بہتر وضاحت کرتی ہے۔ اس طرح سوچیں: اگر آپ جاننا چاہتے ہیں کہ اگلے مہینے کریانے پر کتنا پیسہ خرچ ہوگا تو آپ اپنے گزشتہ اخراجات دیکھ سکتے ہیں۔ اس ڈیٹا کا تجزیہ کر کے آپ ایک ماڈل بنا سکتے ہیں جو آپ کے مستقبل کے کریانے کے اخراجات کا اندازہ لگانے میں مدد دے۔ اس جملے میں وقت کی سمت دیکھیں۔ ماضی استاد ہے، ماڈل سیکھا گیا سبق ہے، اور مستقبل امتحان ہے۔ ماڈل کوئی جادوئی گیند نہیں ہے؛ یہ جو ہو چکا ہے اس کا خلاصہ ہے، جو اس اصول میں بدل دیا گیا ہے کہ عام طور پر آگے کیا ہوتا ہے۔

یہ یہ بھی بتاتا ہے کہ ماڈل کب ناکام ہوگا۔ اگر اگلا مہینہ گزشتہ مہینوں جیسا کچھ نہیں ہے — ایک شادی، کوئی مہمان ٹھہرا ہوا، قیمتیں اچانک بڑھ گئیں — تو ماڈل پھر بھی پرانا پیٹرن پیش گوئی کرے گا، کیونکہ پرانا پیٹرن ہی وہ سب ہے جو وہ جانتا ہے۔ ماڈل بالکل اس وقت طاقتور ہوتے ہیں جب مستقبل ماضی جیسا ہو، اور بالکل اس وقت خطرناک ہوتے ہیں جب وہ نہ ہو۔ اس تنبیہ کو اس باب کے ہر ماڈل کے ساتھ رکھیں، اور آپ پہلے ہی اس شخص کی طرح سوچ رہے ہوں گے جو ماڈلوں کا جائزہ لیتا ہے نہ کہ صرف ان پر یقین کرتا ہے۔

Past datalast months billsModel = rulewhat usually happensPredictionnext months billWorks when the future resembles the past — not when it breaks away
Model سمجھو: گذرا ہوا data استاد ہے, اس سے سیکھا ہوا اصول model ہے, اور اگلے مہینے کی پیش گوئی امتحان ہے.
5.3.1.1 — Model Development: Five Steps۵.۳.۱.۱ — ماڈل تیار کرنا: پانچ مراحل
🏷 Tags: model development, define problem, collect data, algorithm, train, evaluate
ENGLISH

Building a statistical model involves several steps, and the book breaks them down in order so you can follow a real example through all five. The running example is predicting grocery expenses, and each step will use it. Step 1: Define the Problem. First, we need to understand the problem. If we are trying to predict grocery expenses, we need to identify the factors that influence them — for example, family size, location, or income. A vague problem ("spending is high") cannot be modelled; a defined problem ("what drives our monthly grocery bill, and can next month's be predicted from family size and income?") can.

Step 2: Collect Data. Next, we gather data related to the problem. In our example, we will collect data on past spending habits, number of family members, and any other factors that may affect grocery costs. Notice that step 1 decides what step 2 collects — without the factors named in step 1, you would gather everything and understand nothing. Step 3: Choose an Algorithm. Based on the problem and the data, we choose an appropriate algorithm. Algorithms are methods that help us build models, and some popular ones named here are linear regression and logistic regression, which will be discussed later in this section. The algorithm is the recipe; the data is the ingredient.

Step 4: Train the Model. The model is then trained using the collected data. This means the model learns from the data to make predictions — it studies the past bills and family sizes until it finds the pattern connecting them. Step 5: Evaluate the Model. Finally, we test the model to see how well it works by using new or unseen data. This step is very important to ensure the model makes accurate predictions. Testing on the same data it learned from would be like letting a student mark their own exam: the score would look perfect and mean nothing. Unseen data is the only honest test, and the book returns to this point in section 5.3.2.

اردو

شماریاتی ماڈل بنانے میں کئی مراحل شامل ہوتے ہیں، اور کتاب انہیں ترتیب سے توڑتی ہے تاکہ آپ ایک حقیقی مثال کو پانچوں مراحل سے گزار سکیں۔ جاری مثال کریانے کے اخراجات کی پیش گوئی ہے، اور ہر مرحلہ اسے استعمال کرے گا۔ مرحلہ ۱: مسئلہ طے کریں۔ پہلے ہمیں مسئلہ سمجھنا ہوگا۔ اگر ہم کریانے کے اخراجات کی پیش گوئی کرنے کی کوشش کر رہے ہیں تو ہمیں ان عوامل کی شناخت کرنی ہوگی جو ان پر اثر ڈالتے ہیں — مثلاً خاندان کا سائز، مقام، یا آمدنی۔ ایک مبہم مسئلہ ("خرچ زیادہ ہے") ماڈل نہیں بن سکتا؛ ایک طے شدہ مسئلہ ("ہمارے ماہانہ کریانے کے بل کو کیا چلاتا ہے، اور کیا اگلے مہینے کا بل خاندان کے سائز اور آمدنی سے پیش گوئی کیا جا سکتا ہے؟") بن سکتا ہے۔

مرحلہ ۲: ڈیٹا اکٹھا کریں۔ اگلے مرحلے میں ہم مسئلے سے متعلق ڈیٹا جمع کرتے ہیں۔ ہماری مثال میں ہم گزشتہ خرچ کی عادتوں، خاندان کے افراد کی تعداد، اور کسی بھی دوسرے عوامل پر ڈیٹا اکٹھا کریں گے جو کریانے کی لاگت پر اثر ڈال سکتے ہیں۔ دیکھیں کہ مرحلہ ۱ طے کرتا ہے کہ مرحلہ ۲ کیا جمع کرے — مرحلہ ۱ میں نام لیے بغیر آپ سب کچھ جمع کریں گے اور کچھ نہیں سمجھیں گے۔ مرحلہ ۳: الگورتھم چنیں۔ مسئلے اور ڈیٹا کی بنیاد پر ہم ایک مناسب الگورتھم چنتے ہیں۔ الگورتھم وہ طریقے ہیں جو ماڈل بنانے میں مدد دیتے ہیں، اور یہاں نام لیے گئے کچھ مقبول الگورتھم لکیری رجعت اور لاجسٹک رجعت ہیں، جن پر اس حصے میں آگے بحث ہوگی۔ الگورتھم ترکیب ہے؛ ڈیٹا جزو ہے۔

مرحلہ ۴: ماڈل کو تربیت دیں۔ پھر ماڈل کو جمع کردہ ڈیٹا سے تربیت دی جاتی ہے۔ اس کا مطلب ہے کہ ماڈل ڈیٹا سے سیکھ کر پیش گوئیاں کرتا ہے — وہ گزشتہ بلوں اور خاندان کے سائزوں کا مطالعہ کرتا ہے یہاں تک کہ انہیں جوڑنے والا پیٹرن مل جائے۔ مرحلہ ۵: ماڈل کا جائزہ لیں۔ آخر میں ہم ماڈل کو نئے یا ان دیکھے ڈیٹا سے جانچتے ہیں کہ وہ کتنا اچھا کام کرتا ہے۔ یہ مرحلہ بہت اہم ہے تاکہ یقینی ہو کہ ماڈل درست پیش گوئیاں کرتا ہے۔ اسی ڈیٹا پر جانچنا جس سے وہ سیکھا ہو ایسا ہے جیسے طالب علم کو اپنا امتحان خود چیک کرنے دیا جائے: نمبر کامل لگے گا اور مطلب کچھ نہیں ہوگا۔ ان دیکھا ڈیٹا ہی واحد ایماندار جانچ ہے، اور کتاب حصہ ۵.۳.۲ میں اس نکتے پر لوٹتی ہے۔

1. Definethe problem2. Collectthe data3. Choosealgorithm4. Trainon past data5. Evaluateon NEW dataNever evaluate on the data it trained on — that is marking your own exam
Model development سمجھو: مسئلہ واضح کرو, data جمع کرو, طریقہ چنو, سکھاؤ, پھر NAYE data پر جانچو.
5.3.1.2 — Linear Regression۵.۳.۱.۲ — لکیری رجعت (Linear Regression)
🏷 Tags: linear regression, independent variable, dependent variable, slope, intercept
ENGLISH

Linear regression is a widely used statistical model that helps understand the relationship between two variables. It is often used to predict one variable based on another, and the book walks through a practical example to explain how it works. Imagine you run a small fruit stall in your town, and you want to predict how much money you will make each day based on the number of customers who visit your stall. The number of customers is the independent variable (the cause), and the money you earn is the dependent variable (the effect). Linear regression will draw the straight line that best connects them.

Step 1: Collecting Data. To build the model, we need historical data. Suppose you have recorded the number of customers and your daily earnings for the past 5 days (Table 5.3): 10 customers → Rs. 500; 15 → Rs. 700; 20 → Rs. 900; 25 → Rs. 1,100; 30 → Rs. 1,300. Here the number of customers is our independent variable (X), and the daily earnings are the dependent variable (Y). Step 2: Understanding the Formula. The formula for simple linear regression is Y = β0 + β1X + ε, where Y is the dependent variable (daily earnings), X is the independent variable (number of customers), β0 is the intercept, the value of Y when X = 0, β1 is the slope, which shows how much Y changes with each unit change in X, and ε is the error term, which accounts for the difference between the predicted and actual values.

Step 3: Building the Model — slope and intercept. Our goal is to find the best line, and the book gives the values directly: slope 40 and intercept 100. Here is how to see them from the table, step by step. For the slope (β1 = 40): notice that for every 5 extra customers, earnings go up by 200 rupees — from 500 to 700, from 700 to 900, and so on. So for each new customer, β1 = 200 ÷ 5 = 40. Every new customer adds 40 rupees to earnings. For the intercept (β0): it represents the earnings when no customers visit, the point where the line crosses the vertical axis. Take any data point, say 10 customers and 500 rupees, and substitute into Earnings = β0 + β1 × Customers: 500 = β0 + (40 × 10) = β0 + 400, so β0 = 500 − 400 = 100. Final equation: Earnings = 100 + 40 × Customers. In words: you will always earn 100 rupees even if no one comes (the book suggests this may be from regular customers or other fixed earnings), and each new customer adds 40 rupees to your total.

Step 4: Interpreting the Model. Once built, we can predict future earnings. If you expect 22 customers tomorrow, the predicted earnings would be: Earnings = 100 + (40 × 22) = 100 + 880 = 980 Rs. With 22 customers, you can expect to earn around 980 rupees. Step 5: Testing the Model. After building, it is important to test using new data. Say on the 6th day, 28 customers visited and you earned 1,250 Rs. The model predicts: 100 + (40 × 28) = 100 + 1,120 = 1,220 Rs. You actually earned 1,250 Rs, so the difference is the error: Error = 1,220 − 1,250 = −30 Rs (predicted minus actual, the book's sign convention; the size of the miss is 30 rupees). The prediction was close but not perfect, showing that real-world data often has some variation. A "Tidbits" box on the same page adds four ways to improve a model: use more data points for better accuracy; include relevant factors such as family size or special events that may affect spending; regularly update the model with new data to keep it relevant; and test predictions against actual spending to refine the approach.

اردو

لکیری رجعت ایک وسیع پیمانے پر استعمال ہونے والا شماریاتی ماڈل ہے جو دو متغیرات کے درمیان تعلق سمجھنے میں مدد دیتا ہے۔ یہ اکثر ایک متغیر کی بنیاد پر دوسرے کی پیش گوئی کے لیے استعمال ہوتا ہے، اور کتاب ایک عملی مثال سے سمجھاتی ہے کہ یہ کیسے کام کرتا ہے۔ تصور کریں کہ آپ اپنے شہر میں پھلوں کی ایک چھوٹی دکان چلاتے ہیں، اور آپ پیش گوئی کرنا چاہتے ہیں کہ آپ کے اسٹال پر آنے والے گاہکوں کی تعداد کی بنیاد پر آپ روزانہ کتنا پیسہ کمائیں گے۔ گاہکوں کی تعداد آزاد متغیر (سبب) ہے، اور جو پیسہ آپ کماتے ہیں وہ منحصر متغیر (اثر) ہے۔ لکیری رجعت وہ سیدھی لکیر کھینچے گی جو انہیں بہترین طور پر جوڑتی ہے۔

مرحلہ ۱: ڈیٹا اکٹھا کرنا۔ ماڈل بنانے کے لیے ہمیں تاریخی ڈیٹا چاہیے۔ فرض کریں آپ نے گزشتہ ۵ دنوں کے گاہکوں کی تعداد اور اپنی روزانہ آمدنی ریکارڈ کی ہے (ٹیبل ۵.۳): ۱۰ گاہک → ۵۰۰ روپے؛ ۱۵ → ۷۰۰ روپے؛ ۲۰ → ۹۰۰ روپے؛ ۲۵ → ۱۱۰۰ روپے؛ ۳۰ → ۱۳۰۰ روپے۔ یہاں گاہکوں کی تعداد ہمارا آزاد متغیر (X) ہے، اور روزانہ آمدنی منحصر متغیر (Y) ہے۔ مرحلہ ۲: فارمولا سمجھنا۔ سادہ لکیری رجعت کا فارمولا Y = β0 + β1X + ε ہے، جہاں Y منحصر متغیر (روزانہ آمدنی) ہے، X آزاد متغیر (گاہکوں کی تعداد) ہے، β0 انٹرسیپٹ ہے، Y کی قیمت جب X = ۰ ہو، β1 سلوپ ہے، جو دکھاتا ہے کہ X میں ہر اکائی تبدیلی سے Y کتنا بدلتا ہے، اور ε غلطی کی اصطلاح ہے، جو پیش گوئی شدہ اور حقیقی قیمتوں کے فرق کا حساب رکھتی ہے۔

مرحلہ ۳: ماڈل بنانا — سلوپ اور انٹرسیپٹ۔ ہمارا مقصد بہترین لکیر ڈھونڈنا ہے، اور کتاب قدریں براہ راست دیتی ہے: سلوپ ۴۰ اور انٹرسیپٹ ۱۰۰۔ یہاں ٹیبل سے انہیں مرحلہ وار دیکھیں۔ سلوپ (β1 = ۴۰) کے لیے: دیکھیں کہ ہر ۵ اضافی گاہکوں پر آمدنی ۲۰۰ روپے بڑھتی ہے — ۵۰۰ سے ۷۰۰، ۷۰۰ سے ۹۰۰، اور اسی طرح۔ پس ہر نئے گاہک کے لیے β1 = ۲۰۰ ÷ ۵ = ۴۰۔ ہر نیا گاہک آمدنی میں ۴۰ روپے جوڑتا ہے۔ انٹرسیپٹ (β0) کے لیے: یہ اس آمدنی کی نمائندگی کرتا ہے جب کوئی گاہک نہ آئے، وہ نقطہ جہاں لکیر عمودی محور کو کاٹتی ہے۔ کوئی بھی ڈیٹا نقطہ لیں، مثلاً ۱۰ گاہک اور ۵۰۰ روپے، اور آمدنی = β0 + β1 × گاہک میں رکھیں: ۵۰۰ = β0 + (۴۰ × ۱۰) = β0 + ۴۰۰، اس لیے β0 = ۵۰۰ − ۴۰۰ = ۱۰۰۔ آخری مساوات: آمدنی = ۱۰۰ + ۴۰ × گاہک۔ الفاظ میں: آپ ہمیشہ ۱۰۰ روپے کمائیں گے چاہے کوئی نہ آئے (کتاب تجویز کرتی ہے کہ یہ مستقل گاہکوں یا دیگر مقررہ آمدنی سے ہو سکتا ہے)، اور ہر نیا گاہک آپ کے مجموعے میں ۴۰ روپے جوڑتا ہے۔

مرحلہ ۴: ماڈل کی تشریح۔ بن جانے کے بعد ہم مستقبل کی آمدنی کی پیش گوئی کر سکتے ہیں۔ اگر آپ کل ۲۲ گاہکوں کی توقع کرتے ہیں تو پیش گوئی شدہ آمدنی ہوگی: آمدنی = ۱۰۰ + (۴۰ × ۲۲) = ۱۰۰ + ۸۸۰ = ۹۸۰ روپے۔ ۲۲ گاہکوں کے ساتھ آپ تقریباً ۹۸۰ روپے کمانے کی توقع کر سکتے ہیں۔ مرحلہ ۵: ماڈل کی جانچ۔ بنانے کے بعد نئے ڈیٹا سے جانچنا اہم ہے۔ کہیں چھٹے دن ۲۸ گاہک آئے اور آپ نے ۱۲۵۰ روپے کمائے۔ ماڈل پیش گوئی کرتا ہے: ۱۰۰ + (۴۰ × ۲۸) = ۱۰۰ + ۱۱۲۰ = ۱۲۲۰ روپے۔ آپ نے واقعی ۱۲۵۰ روپے کمائے، اس لیے فرق غلطی ہے: غلطی = ۱۲۲۰ − ۱۲۵۰ = −۳۰ روپے (پیش گوئی منفی حقیقی، کتاب کا نشانی کا رواج؛ چوک کی مقدار ۳۰ روپے ہے)۔ پیش گوئی قریب تھی لیکن کامل نہیں تھی، جو دکھاتا ہے کہ حقیقی دنیا کے ڈیٹا میں اکثر کچھ تبدیلی ہوتی ہے۔ اسی صفحے پر ایک "Tidbits" خانہ ماڈل بہتر بنانے کے چار طریقے دیتا ہے: بہتر درستگی کے لیے زیادہ ڈیٹا پوائنٹس استعمال کریں؛ متعلقہ عوامل شامل کریں جیسے خاندان کا سائز یا خاص مواقع جو خرچ پر اثر ڈال سکتے ہیں؛ ماڈل کو نئے ڈیٹا سے باقاعدگی سے اپ ڈیٹ کریں تاکہ وہ متعلقہ رہے؛ اور نقطہ نظر کو بہتر بنانے کے لیے پیش گوئیوں کو حقیقی خرچ سے جانچیں۔

Fruit stall: Earnings = 100 + 40 × Customers10 → 50020 → 90030 → 130022 customers → 100 + 880 = 980 Rs (prediction) · 28 → 1220 vs actual 1250 (error −30)
Linear regression samjho: do cheezon ke darmiyan seedhi lakeer khaincho — har aik gahak 40 rupay, aur shuru ke 100 hamesha.
5.3.1.3 — Logistic Regression۵.۳.۱.۳ — لاجسٹک رجعت (Logistic Regression)
🏷 Tags: logistic regression, yes no, probability, pass fail
ENGLISH

Logistic regression is a powerful tool used when we want to predict an outcome that can be categorised as "yes" or "no." That one sentence draws the whole border between this model and the last one. Linear regression predicts a number — how many rupees, how many marks. Logistic regression predicts a category with two sides, and it does so by giving a probability instead of a plain count. The book's example is: let us say we want to determine whether a student will pass or fail an exam based on the number of hours they study. Instead of predicting a specific score, logistic regression helps us find the probability of passing.

The next page of the book spells out how logistic regression is different from linear regression, and it is worth quoting the logic closely: it does not predict exact numbers. Instead, it provides a probability value between 0 and 1, which tells us how likely something is to happen. A value near 1 means passing is very likely; a value near 0 means it is very unlikely; a value near 0.5 means the model genuinely cannot tell. Teachers often turn that probability into a decision with a cut-off — above 0.5, predict "pass"; below 0.5, predict "fail" — but the probability itself is the model's real answer, and throwing it away for a blunt yes/no loses information.

Picture the student example as a curve, not a line. With zero study hours the probability of passing sits low; as study hours climb, the probability rises steeply through the middle; and after many hours it flattens near 1, because extra hours cannot push a probability past certain. That flattening is the point: more study always helps a little, but it cannot help infinitely, and a straight line would wrongly promise probabilities above 1 or below 0. Logistic regression bends so that its answers always stay inside the honest range of 0 to 1. Other yes/no questions fit the same shape — will a customer buy or not, will a patient recover or not, will an email be spam or not — and that is why the book calls the tool powerful despite its short treatment.

اردو

لاجسٹک رجعت ایک طاقتور اوزار ہے جو اس وقت استعمال ہوتا ہے جب ہم کسی ایسے نتیجے کی پیش گوئی کرنا چاہیں جسے "ہاں" یا "نہیں" کے زمرے میں رکھا جا سکے۔ یہ واحد جملہ اس ماڈل اور پچھلے ماڈل کے درمیان پوری سرحد کھینچ دیتا ہے۔ لکیری رجعت ایک نمبر کی پیش گوئی کرتی ہے — کتنے روپے، کتنے نمبر۔ لاجسٹک رجعت دو طرفہ زمرے کی پیش گوئی کرتی ہے، اور وہ سادہ گنتی کی بجائے احتمال دے کر کرتی ہے۔ کتاب کی مثال ہے: کہیں ہم یہ طے کرنا چاہتے ہیں کہ آیا ایک طالب علم پڑھائی کے گھنٹوں کی بنیاد پر امتحان پاس کرے گا یا فیل ہوگا۔ مخصوص نمبر کی پیش گوئی کی بجائے لاجسٹک رجعت پاس ہونے کا احتمال ڈھونڈنے میں مدد دیتی ہے۔

کتاب کا اگلا صفحہ واضح کرتا ہے کہ لاجسٹک رجعت لکیری رجعت سے کیسے مختلف ہے، اور اس منطق کو قریب سے نقل کرنا فائدہ مند ہے: یہ درست نمبروں کی پیش گوئی نہیں کرتی۔ اس کے بجائے یہ ۰ اور ۱ کے درمیان احتمال کی قیمت دیتی ہے، جو بتاتی ہے کہ کچھ ہونے کا کتنا امکان ہے۔ ۱ کے قریب قیمت کا مطلب ہے پاس ہونا بہت ممکن ہے؛ ۰ کے قریب قیمت کا مطلب ہے بہت ناممکن ہے؛ ۰.۵ کے قریب قیمت کا مطلب ہے ماڈل واقعی نہیں بتا سکتا۔ اساتذہ اکثر اس احتمال کو ایک حد سے فیصلے میں بدل دیتے ہیں — ۰.۵ سے اوپر، "پاس" کی پیش گوئی؛ ۰.۵ سے نیچے، "فیل" کی پیش گوئی — لیکن احتمال ہی ماڈل کا اصل جواب ہے، اور اسے سیدھے ہاں/نہیں کے لیے پھینک دینا معلومات ضائع کرنا ہے۔

طالب علم کی مثال کو لکیر نہیں بلکہ خم کی طرح ذہن میں لائیں۔ صفر پڑھائی کے گھنٹوں پر پاس ہونے کا احتمال کم ہوتا ہے؛ جیسے پڑھائی کے گھنٹے بڑھتے ہیں، احتمال درمیان سے تیزی سے بڑھتا ہے؛ اور کئی گھنٹوں کے بعد وہ ۱ کے قریب چپٹا ہو جاتا ہے، کیونکہ اضافی گھنٹے احتمال کو یقینی سے آگے نہیں دھکیل سکتے۔ یہ چپٹا ہونا ہی اصل نکتہ ہے: زیادہ پڑھائی ہمیشہ تھوڑی مدد کرتی ہے، لیکن لامحدود مدد نہیں کر سکتی، اور ایک سیدھی لکیر غلطی سے ۱ سے اوپر یا ۰ سے نیچے احتمال کا وعدہ کرے گی۔ لاجسٹک رجعت اس طرح مڑتی ہے کہ اس کے جواب ہمیشہ ۰ سے ۱ کی ایماندار حد کے اندر رہیں۔ دوسرے ہاں/نہیں سوالات اسی شکل میں فٹ ہوتے ہیں — کیا گاہک خریدے گا یا نہیں، کیا مریض صحت یاب ہوگا یا نہیں، کیا ای میل سپیم ہوگا یا نہیں — اور اسی لیے کتاب مختصر وضاحت کے باوجود اس اوزار کو طاقتور کہتی ہے۔

Not a number — a probability between 0 and 10 hrs: lowmiddle: rises fastmany hrs: near 1Pass or fail? Answer with a probability, then decide (often at 0.5)
Logistic regression سمجھو: جب جواب ہاں/naheen ہو تو number کی بجائے امکان دو — 0 سے 1 کے درمیان, کبھی اس سے باہر نہیں.
5.3.1.4 — Clustering Techniques (K-Means)۵.۳.۱.۴ — کلسٹرنگ کی تکنیکیں (K-Means)
🏷 Tags: clustering, K-means, similarity, groups, clusters
ENGLISH

Clustering is a way of grouping similar things together based on their characteristics. The book's classroom picture makes it immediate: imagine you have a group of students in your class, and you want to divide them into groups based on their performance in different subjects like maths, science and English. Clustering helps us do that by creating groups of students who perform similarly. Nobody tells the method the groups in advance — that is the crucial difference from classification, where the categories are predefined. Clustering discovers the groups from the data itself.

The worked example uses five students with their maths and English scores (Table 5.4): Basim 85 maths, 70 English; Umer 90 maths, 65 English; Anie 50 maths, 80 English; Tallat 40 maths, 85 English; Maliha 60 maths, 60 English. K-means clustering is one of the simplest and most popular techniques to group data. In K-means, we need to decide how many groups (clusters) we want — that chosen number is the "K." For this example, say we want to divide the students into two clusters: one for students who are strong in maths and one for students who are strong in English. The algorithm groups students with similar performance in maths and English together by calculating the distance between their scores and finding patterns. It assigns students like Basim and Umer (who are good at maths) to one group and students like Anie and Tallat (who are good at English) to another group.

⚠️ Maliha, flagged honestly: the book does not assign Maliha (60, 60) to either cluster. That silence is actually informative. Basim and Umer sit clearly in the high-maths corner, Anie and Tallat clearly in the high-English corner, but Maliha sits in the middle on both subjects — she is not strong in either by the book's contrast, and a distance calculation would place her near the border between the two groups. A careful answer therefore says: the book's two clusters are the maths-strong group (Basim, Umer) and the English-strong group (Anie, Tallat), while Maliha is the borderline case the book leaves unassigned, and any assignment of her would be derived, not the book's. That is also the exercise's MCQ 7 and 8 in disguise: K-means groups by similarity, and K is the number of clusters to be formed.

اردو

کلسٹرنگ ایک جیسی چیزوں کو ان کی خصوصیات کی بنیاد پر گروپ کرنے کا طریقہ ہے۔ کتاب کی کلاس روم کی تصویر اسے فوراً واضح کرتی ہے: تصور کریں کہ آپ کی کلاس میں طلبہ کا ایک گروہ ہے، اور آپ انہیں ریاضی، سائنس اور انگریزی جیسے مختلف مضامین میں ان کی کارکردگی کی بنیاد پر گروہوں میں بانٹنا چاہتے ہیں۔ کلسٹرنگ اس میں مدد دیتی ہے کہ ایک جیسی کارکردگی والے طلبہ کے گروہ بنائے جائیں۔ کوئی بھی طریقے کو گروہ پہلے سے نہیں بتاتا — یہ درجہ بندی سے اہم فرق ہے، جہاں زمرے پہلے سے طے شدہ ہوتے ہیں۔ کلسٹرنگ گروہ خود ڈیٹا سے دریافت کرتی ہے۔

عملی مثال میں پانچ طلبہ کے ریاضی اور انگریزی نمبر استعمال ہوتے ہیں (ٹیبل ۵.۴): باسم ۸۵ ریاضی، ۷۰ انگریزی؛ عمر ۹۰ ریاضی، ۶۵ انگریزی؛ آنیہ ۵۰ ریاضی، ۸۰ انگریزی؛ طلعت ۴۰ ریاضی، ۸۵ انگریزی؛ ملیحہ ۶۰ ریاضی، ۶۰ انگریزی۔ K-means کلسٹرنگ ڈیٹا کو گروپ کرنے کی سب سے سادہ اور مقبول تکنیکوں میں سے ایک ہے۔ K-means میں ہمیں یہ طے کرنا ہوتا ہے کہ ہم کتنے گروہ (کلسٹر) چاہتے ہیں — وہ چنا گیا نمبر ہی "K" ہے۔ اس مثال کے لیے کہیں ہم طلبہ کو دو کلسٹروں میں بانٹنا چاہتے ہیں: ایک ان طلبہ کے لیے جو ریاضی میں مضبوط ہیں اور ایک ان کے لیے جو انگریزی میں مضبوط ہیں۔ الگورتھم ریاضی اور انگریزی میں ایک جیسی کارکردگی والے طلبہ کو ان کے نمبروں کے درمیان فاصلہ نکال کر اور پیٹرن ڈھونڈ کر گروپ کرتا ہے۔ یہ باسم اور عمر جیسے طلبہ (جو ریاضی میں اچھے ہیں) کو ایک گروہ میں اور آنیہ اور طلعت جیسے طلبہ (جو انگریزی میں اچھے ہیں) کو دوسرے گروہ میں رکھتا ہے۔

⚠️ ملیحہ، ایمانداری سے نوٹ: کتاب ملیحہ (۶۰، ۶۰) کو کسی بھی کلسٹر میں نہیں رکھتی۔ یہ خاموشی حقیقت میں معلوماتی ہے۔ باسم اور عمر واضح طور پر زیادہ ریاضی والے کونے میں ہیں، آنیہ اور طلعت واضح طور پر زیادہ انگریزی والے کونے میں ہیں، لیکن ملیحہ دونوں مضامین میں درمیان میں ہے — کتاب کے موازنے سے وہ کسی میں بھی مضبوط نہیں ہے، اور فاصلے کا حساب اسے دونوں گروہوں کے درمیان سرحد کے قریب رکھے گا۔ اس لیے محتاط جواب یہ ہے: کتاب کے دو کلسٹر ریاضی میں مضبوط گروہ (باسم، عمر) اور انگریزی میں مضبوط گروہ (آنیہ، طلعت) ہیں، جبکہ ملیحہ وہ سرحدی صورت ہے جسے کتاب غیر تفویض شدہ چھوڑتی ہے، اور اس کی کوئی بھی تفویض اخذ شدہ ہوگی، کتاب کی نہیں۔ یہی مشق کے MCQ ۷ اور ۸ کا بھیس ہے: K-means مماثلت سے گروپ کرتا ہے، اور K بننے والے کلسٹروں کی تعداد ہے۔

K = 2 clusters: maths-strong vs English-strongBasim 85,70Anie 50,80Maliha 60,60 — borderline, unassigned in bookx-axis: maths score → · y-axis: English score ↑
Clustering سمجھو: پہلے سے زمرے مت بتاؤ — ایک جیسی کارکردگی والوں کو خود ایک group میں جمع ہونے دو.
5.3.2 — Evaluating and Interpreting Models۵.۳.۲ — ماڈلوں کا جائزہ اور تشریح
🏷 Tags: model evaluation, performance metrics, error, accuracy, interpreting outputs
ENGLISH

Once a model is built, it is important to check how well it performs and to understand the results it provides. This is called model evaluation, and the book splits it into measuring and understanding — two jobs students often blur together. Measuring asks "how big are the mistakes, and how often is it right?" Understanding asks "what do the results actually mean for the real decision?" A model can score well on the first question and still be useless on the second, if nobody can explain what its output is telling them to do.

Performance metrics. Some common metrics include error metrics and accuracy metrics. Error metrics measure how much the model's predictions differ from the actual values. In the grocery example, if the model predicts a monthly grocery bill of 8,000 rupees but the actual bill is 10,000 rupees, the difference is the error — here 2,000 rupees, a miss you can feel in a household budget. Accuracy metrics tell us how many of the model's predictions were correct. For example, if a model predicts whether a student will pass or fail an exam, accuracy measures the percentage of correct predictions made by the model. If it judged 100 students and got 85 right, its accuracy is 85%. Use error metrics for numbers (rupees, marks) and accuracy for categories (pass/fail, yes/no) — mixing them up is a classic exam slip.

Interpreting outputs. Interpreting a model's output means understanding what the results reveal. The book gives a compact example under "Drawing Conclusions from Insights": if a linear regression model shows that the number of hours studied strongly affects exam scores, we can conclude that students should study more hours to improve their scores. Read that sentence critically, because it is both useful and risky. It is useful as guidance — study time matters, so protect it. It is risky if read as proof that hours alone cause scores, since motivated students may both study more and score higher for other reasons. A good interpretation states what the model shows, what action it suggests, and what it does not prove. That three-part habit will serve you in every later chapter that uses models.

اردو

ماڈل بن جانے کے بعد یہ جانچنا اہم ہے کہ وہ کتنا اچھا کام کرتا ہے اور اس کے نتائج کو سمجھنا بھی۔ اسے ماڈل کا جائزہ کہتے ہیں، اور کتاب اسے ناپنے اور سمجھنے میں بانٹتی ہے — دو کام جنہیں طلبہ اکثر گڈمڈ کر دیتے ہیں۔ ناپنا پوچھتا ہے "غلطیاں کتنی بڑی ہیں، اور یہ کتنی بار درست ہے؟" سمجھنا پوچھتا ہے "نتائج حقیقی فیصلے کے لیے واقعی کیا مطلب رکھتے ہیں؟" ایک ماڈل پہلے سوال پر اچھا نمبر لا سکتا ہے اور دوسرے پر پھر بھی بیکار ہو سکتا ہے، اگر کوئی یہ نہیں سمجھا سکتا کہ اس کا نتیجہ اسے کیا کرنے کو کہہ رہا ہے۔

کارکردگی کی پیمائشیں۔ کچھ عام پیمائشوں میں غلطی کی پیمائشیں اور درستگی کی پیمائشیں شامل ہیں۔ غلطی کی پیمائشیں ناپتی ہیں کہ ماڈل کی پیش گوئیاں حقیقی قیمتوں سے کتنی مختلف ہیں۔ کریانے کی مثال میں اگر ماڈل ماہانہ کریانے کے بل کی پیش گوئی ۸۰۰۰ روپے کرے لیکن حقیقی بل ۱۰۰۰۰ روپے ہو تو فرق غلطی ہے — یہاں ۲۰۰۰ روپے، ایک چوک جو گھر کے بجٹ میں محسوس ہوتی ہے۔ درستگی کی پیمائشیں بتاتی ہیں کہ ماڈل کی کتنی پیش گوئیاں درست تھیں۔ مثال کے طور پر اگر ایک ماڈل پیش گوئی کرے کہ طالب علم امتحان پاس کرے گا یا فیل ہوگا تو درستگی ماڈل کی درست پیش گوئیوں کا فیصد ناپتی ہے۔ اگر اس نے ۱۰۰ طلبہ کا فیصلہ کیا اور ۸۵ درست ہوئے تو اس کی درستگی ۸۵٪ ہے۔ نمبروں (روپے، نمبر) کے لیے غلطی کی پیمائشیں اور زمروں (پاس/فیل، ہاں/نہیں) کے لیے درستگی استعمال کریں — انہیں گڈمڈ کرنا امتحان کی کلاسیکی غلطی ہے۔

نتائج کی تشریح۔ ماڈل کے نتیجے کی تشریح کا مطلب ہے سمجھنا کہ نتائج کیا ظاہر کرتے ہیں۔ کتاب "بصیرتوں سے نتائج نکالنا" کے تحت ایک مختصر مثال دیتی ہے: اگر لکیری رجعت ماڈل دکھائے کہ پڑھائی کے گھنٹوں کی تعداد امتحانی نمبروں پر مضبوط اثر ڈالتی ہے تو ہم نتیجہ نکال سکتے ہیں کہ طلبہ کو اپنے نمبر بہتر بنانے کے لیے زیادہ گھنٹے پڑھنا چاہیے۔ اس جملے کو تنقیدی نظر سے پڑھیں، کیونکہ یہ مفید بھی ہے اور خطرناک بھی۔ رہنمائی کے طور پر مفید ہے — پڑھائی کا وقت اہم ہے، اس لیے اس کی حفاظت کریں۔ اس لحاظ سے خطرناک ہے اگر اسے ثبوت سمجھا جائے کہ صرف گھنٹے ہی نمبر بناتے ہیں، کیونکہ باہمت طلبہ زیادہ بھی پڑھ سکتے ہیں اور دوسری وجوہات سے زیادہ نمبر بھی لا سکتے ہیں۔ ایک اچھی تشریح بتاتی ہے کہ ماڈل کیا دکھاتا ہے، وہ کس عمل کا مشورہ دیتا ہے، اور وہ کیا ثابت نہیں کرتا۔ یہ تین حصوں والی عادت ہر اگلے باب میں کام آئے گی جو ماڈل استعمال کرتا ہے۔

Error metric (numbers)Predicted 8,000 vs actual 10,000Error = 2,000 RsAccuracy (categories)85 right out of 100Accuracy = 85%Measure first, then interpret: what does it show, what should we do, what is not proved?
Evaluation سمجھو: پہلے غلطی ناپو, پھر سمجھو کے نتیجہ اصل فیصلے کے لیے کیا کہتا ہے — دونوں کے بغیر model ادھورا ہے.
5.3.2.3 — Ethical Considerations۵.۳.۲.۳ — اخلاقی تحفظات
🏷 Tags: ethics, fairness, bias, data privacy, permission
ENGLISH

When building models, it is important to consider the ethical implications, such as fairness and privacy. This short section is easy to skip in revision and costly to skip in understanding, because it is the only place in the chapter where the book asks who a model might harm. A model is not neutral just because it is mathematical: it learns from human data, and human data carries human unfairness. Two implications are named, and both deserve a concrete picture.

Fairness and Bias. A model should be fair and unbiased. For example, if a model is used to decide who gets a loan, it should not unfairly favour one group of people over another. Imagine a loan model trained mostly on applications from one neighbourhood, or one profession. It may learn to approve those applicants and reject others for reasons that have nothing to do with whether they would repay — their postcode, their name, their background standing in for creditworthiness. The model would then not be discovering who is risky; it would be repeating who was favoured before, now with the authority of mathematics behind it. Checking fairness means asking, for each group the model touches, whether its mistakes fall evenly or land mostly on one group.

Data Privacy. When using personal data to build models, it is important to respect privacy. For example, if a company is using customer data to build models, they should ensure the data is secure and not shared without permission. Personal data here is not an abstraction: it is purchase histories, locations, health details, messages — the material of people's lives. A model built on data taken without permission, or left where anyone can copy it, breaks trust even if its predictions are accurate. Accuracy never excuses a privacy breach; it only makes the breach more valuable to whoever exploits it. A "Tidbits" box at the end of this section adds a practical rule worth keeping beside every later model you build: always visualise your data before building models, and test your results on new data for better accuracy.

اردو

ماڈل بناتے وقت اخلاقی مضمرات پر غور کرنا اہم ہے، جیسے انصاف اور رازداری۔ یہ مختصر حصہ دہرائی میں چھوڑنا آسان ہے اور سمجھ میں چھوڑنا مہنگا ہے، کیونکہ یہ باب میں واحد جگہ ہے جہاں کتاب پوچھتی ہے کہ ماڈل کس کو نقصان پہنچا سکتا ہے۔ ایک ماڈل صرف اس لیے غیر جانبدار نہیں ہے کہ وہ ریاضیاتی ہے: وہ انسانی ڈیٹا سے سیکھتا ہے، اور انسانی ڈیٹا انسانی ناانصافی رکھتا ہے۔ دو مضمرات نام لیے گئے ہیں، اور دونوں ایک ٹھوس تصویر کے مستحق ہیں۔

انصاف اور تعصب۔ ایک ماڈل کو منصفانہ اور غیر جانبدار ہونا چاہیے۔ مثال کے طور پر اگر ایک ماڈل یہ طے کرنے کے لیے استعمال ہو کہ کسے قرض ملے تو اسے کسی ایک گروہ کو دوسرے پر ناانصافی سے ترجیح نہیں دینی چاہیے۔ تصور کریں کہ قرض کا ماڈل زیادہ تر ایک محلے، یا ایک پیشے کی درخواستوں پر تربیت یافتہ ہے۔ وہ ان درخواست دہندگان کو منظور کرنا اور دوسروں کو ایسی وجوہات سے مسترد کرنا سیکھ سکتا ہے جن کا اس سے کوئی تعلق نہیں کہ آیا وہ واپس کریں گے — ان کا پوسٹ کوڈ، ان کا نام، ان کا پس منظر قرض کی اہلیت کی جگہ لے لے۔ پھر ماڈل یہ دریافت نہیں کر رہا ہوگا کہ کون خطرناک ہے؛ وہ یہ دہرا رہا ہوگا کہ پہلے کسے ترجیح دی گئی تھی، اب اس کے پیچھے ریاضی کا اختیار ہے۔ انصاف جانچنے کا مطلب ہے ہر اس گروہ کے لیے پوچھنا جسے ماڈل چھوتا ہے کہ آیا اس کی غلطیاں برابر بٹتی ہیں یا زیادہ تر ایک گروہ پر پڑتی ہیں۔

ڈیٹا کی رازداری۔ ماڈل بنانے کے لیے ذاتی ڈیٹا استعمال کرتے وقت رازداری کا احترام کرنا اہم ہے۔ مثال کے طور پر اگر کوئی کمپنی ماڈل بنانے کے لیے گاہکوں کا ڈیٹا استعمال کر رہی ہے تو اسے یقینی بنانا چاہیے کہ ڈیٹا محفوظ ہے اور بغیر اجازت شیئر نہیں کیا جاتا۔ یہاں ذاتی ڈیٹا کوئی تجرید نہیں ہے: یہ خریداری کی تاریخیں، مقامات، صحت کی تفصیلات، پیغامات ہیں — لوگوں کی زندگیوں کا مواد۔ بغیر اجازت لیے گئے ڈیٹا پر بنایا گیا ماڈل، یا ایسا ڈیٹا جسے کوئی بھی نقل کر سکے، اعتماد توڑتا ہے چاہے اس کی پیش گوئیاں درست ہوں۔ درستگی کبھی رازداری کی خلاف ورزی کا جواز نہیں ہے؛ وہ صرف خلاف ورزی کو اس کے استحصال کرنے والے کے لیے زیادہ قیمتی بناتی ہے۔ اس حصے کے آخر میں ایک "Tidbits" خانہ ایک عملی اصول دیتا ہے جو ہر اگلے ماڈل کے ساتھ رکھنے کے قابل ہے: ماڈل بنانے سے پہلے ہمیشہ اپنے ڈیٹا کو بصری شکل دیں، اور بہتر درستگی کے لیے اپنے نتائج کو نئے ڈیٹا پر جانچیں۔

⚖ FairnessLoan model must not favourone group over another🔒 PrivacyPersonal data: secure it,never share without permissionA model can be accurate and still be unfair or invasive — check both
Ethics سمجھو: model صرف درست نہ ہو, منصف بھی ہو اور لوگوں کا data محفوظ بھی رکہے — ورنہ riyazi بھی ظلم بن سکتی ہے.
5.4 & 5.4.1.1 — Introduction to Data Visualization & Bar Charts۵.۴ اور ۵.۴.۱.۱ — ڈیٹا کی تصویر کشی کا تعارف اور بار چارٹ
🏷 Tags: data visualization, bar chart, categories, compare
ENGLISH

Data visualization is the process of representing data in a visual format, such as graphs or charts. It helps us to quickly identify patterns, trends, and insights from the data. That word quickly is doing real work: a table of a thousand sales figures must be read row by row, but a chart of the same figures can be grasped in a glance — the tallest bar, the rising line, the lonely dot far from the rest. Visualisation does not replace statistics; it lets your eyes do the first pass of analysis before any number is calculated.

The book then explains that different types of visualizations serve various purposes, making it easier to interpret and analyse data, and it walks through five common types in detail. The first is the bar chart. Bar charts are ideal for comparing different categories. Each bar represents a category, and the height (or length) of the bar indicates the value associated with that category. The example is comparing sales figures for different products in a store: Figure 5.1 shows a bar chart of product sales, with values running up to 1,000 and two product series side by side, so you can compare both across products and between the two products at a glance.

Reading a bar chart is a small skill with a strict order, so practise it here. First read the axes: what is counted, and in what units? Then find the tallest bar — that category leads. Then compare neighbours: is the lead large or barely visible? A chart whose bars are nearly equal tells a very different story from one where a single bar towers over the rest, even though both use the same rectangles. Bar charts suit categories — products, classes, cities — where there is no natural order to preserve. When order or time matters, the next chart type takes over.

اردو

ڈیٹا کی تصویر کشی ڈیٹا کو بصری شکل میں پیش کرنے کا عمل ہے، جیسے گراف یا چارٹ۔ یہ ڈیٹا سے پیٹرن، رجحانات اور بصیرتیں تیزی سے پہچاننے میں مدد دیتی ہے۔ یہ لفظ تیزی سے حقیقی کام کر رہا ہے: ایک ہزار فروخت کے اعداد کی ٹیبل قطار بہ قطار پڑھنی ہوگی، لیکن انہی اعداد کا چارٹ ایک نظر میں سمجھا جا سکتا ہے — سب سے لمبی بار، اٹھتی ہوئی لکیر، باقی سے دور اکیلا نقطہ۔ تصویر کشی شماریات کی جگہ نہیں لیتی؛ وہ آپ کی آنکھوں کو کسی بھی نمبر کے حساب سے پہلے تجزیے کا پہلا مرحلہ کرنے دیتی ہے۔

پھر کتاب سمجھاتی ہے کہ تصویر کشی کی مختلف اقسام مختلف مقاصد پورا کرتی ہیں، جس سے ڈیٹا کی تشریح اور تجزیہ آسان ہو جاتا ہے، اور وہ پانچ عام اقسام کو تفصیل سے بیان کرتی ہے۔ پہلی بار چارٹ ہے۔ بار چارٹ مختلف زمروں کا موازنہ کرنے کے لیے مثالی ہیں۔ ہر بار ایک زمرے کی نمائندگی کرتی ہے، اور بار کی اونچائی (یا لمبائی) اس زمرے سے وابستہ قیمت بتاتی ہے۔ مثال ایک دکان میں مختلف مصنوعات کی فروخت کے اعداد کا موازنہ کرنا ہے: فگر ۵.۱ مصنوعات کی فروخت کا بار چارٹ دکھاتی ہے، جس میں قدریں ۱۰۰۰ تک جاتی ہیں اور دو مصنوعات کی سیریز ساتھ ساتھ ہیں، تاکہ آپ ایک نظر میں مصنوعات کے درمیان اور دونوں مصنوعات کے درمیان موازنہ کر سکیں۔

بار چارٹ پڑھنا ایک چھوٹی مہارت ہے جس کی سخت ترتیب ہے، اس لیے یہاں اس کی مشق کریں۔ پہلے محور پڑھیں: کیا گنا جا رہا ہے، اور کس اکائی میں؟ پھر سب سے لمبی بار ڈھونڈیں — وہ زمرہ آگے ہے۔ پھر پڑوسیوں کا موازنہ کریں: کیا برتری بڑی ہے یا بمشکل نظر آتی ہے؟ جس چارٹ کی باریں تقریباً برابر ہوں وہ بہت مختلف کہانی سناتا ہے اس سے جس میں ایک بار باقیوں پر چھائی ہو، اگرچہ دونوں وہی مستطیل استعمال کرتے ہیں۔ بار چارٹ زمروں کے لیے موزوں ہیں — مصنوعات، کلاسیں، شہر — جہاں محفوظ کرنے کے لیے کوئی قدرتی ترتیب نہیں ہے۔ جب ترتیب یا وقت اہم ہو تو اگلی چارٹ کی قسم آگے آتی ہے۔

Figure 5.1 redrawn: sales by product (two series)Taller bar = larger value · Compare heights, not widths
Bar chart سمجھو: ہر zamra ایک bar, bar جتنی لمبی اتنی بڑی قیمت — نظر ڈالتے ہی سب سے بڑا نظر آ جاتا ہے.
5.4.1.2 — Line Graphs۵.۴.۱.۲ — لائن گراف
🏷 Tags: line graph, trend over time, data points, temperature
ENGLISH

Line graphs are used to show trends over time. They plot data points and connect them with a line, making it easy to observe changes. That connection is the whole point: a bar chart compares separate things, but a line insists that the points belong to one story unfolding in order. Remove the line and you have scattered dots; join them and you can see rising, falling, flattening and turning at a glance.

The book's example tracks temperature over a day, and Figure 5.2 shows the variation of temperature over time. Read the figure the way the book intends: the horizontal axis runs from 10 am through 12 pm, 2 pm, 4 pm, 6 pm to 8 pm, while the vertical axis shows temperature in degrees Celsius from −10 up to 4. The line starts low at about −5 °C at 10 am, climbs to about 1 °C by noon and peaks near 2 °C around 2 pm, then falls steadily — about −3 °C at 4 pm, −5 °C at 6 pm, and down to about −9 °C by 8 pm. In one glance you have the day's story: a cold morning, a brief mild afternoon, then a sharp evening freeze.

Two reading habits will protect you from misreading any line graph. First, always check whether the line joins points in time order — a line drawn between unrelated categories is decoration, not a trend. Second, watch the steepness: a steep section means fast change, a flat section means little change, and a peak or valley is where the direction turns. The temperature graph's steep evening fall matters more than its gentle morning climb, and steepness is how you see that without calculating a single slope.

اردو

لائن گراف وقت کے ساتھ رجحانات دکھانے کے لیے استعمال ہوتے ہیں۔ وہ ڈیٹا پوائنٹس کو پلاٹ کرتے ہیں اور انہیں لکیر سے جوڑتے ہیں، جس سے تبدیلیاں دیکھنا آسان ہو جاتا ہے۔ یہ جوڑنا ہی اصل نکتہ ہے: بار چارٹ الگ چیزوں کا موازنہ کرتا ہے، لیکن لکیر اصرار کرتی ہے کہ پوائنٹس ایک کہانی سے تعلق رکھتے ہیں جو ترتیب سے کھل رہی ہے۔ لکیر ہٹا دیں تو بکھرے نقطے رہ جاتے ہیں؛ انہیں جوڑیں تو آپ ایک نظر میں اٹھنا، گرنا، چپٹا ہونا اور مڑنا دیکھ سکتے ہیں۔

کتاب کی مثال ایک دن کے دوران درجہ حرارت کو ٹریک کرتی ہے، اور فگر ۵.۲ وقت کے ساتھ درجہ حرارت کی تبدیلی دکھاتی ہے۔ فگر کو اس طرح پڑھیں جیسے کتاب کا مقصد ہے: افقی محور صبح ۱۰ بجے سے دوپہر ۱۲ بجے، ۲ بجے، ۴ بجے، ۶ بجے سے رات ۸ بجے تک جاتا ہے، جبکہ عمودی محور درجہ حرارت ڈگری سیلسیس میں −۱۰ سے ۴ تک دکھاتا ہے۔ لکیر صبح ۱۰ بجے تقریباً −۵ °C سے کم شروع ہوتی ہے، دوپہر تک تقریباً ۱ °C تک چڑھتی ہے اور دوپہر ۲ بجے کے قریب ۲ °C کے قریب عروج پر پہنچتی ہے، پھر مسلسل گرتی ہے — ۴ بجے تقریباً −۳ °C، ۶ بجے −۵ °C، اور رات ۸ بجے تک تقریباً −۹ °C تک۔ ایک نظر میں آپ کے پاس دن کی کہانی ہے: سرد صبح، مختصر معتدل دوپہر، پھر شام کی تیز ٹھنڈ۔

دو پڑھنے کی عادتیں آپ کو کسی بھی لائن گراف کو غلط پڑھنے سے بچائیں گی۔ پہلی، ہمیشہ جانچیں کہ آیا لکیر پوائنٹس کو وقت کی ترتیب میں جوڑتی ہے — غیر متعلقہ زمروں کے درمیان کھینچی گئی لکیر رجحان نہیں بلکہ سجاوٹ ہے۔ دوسری، ڈھلوان دیکھیں: کھڑی حصہ تیز تبدیلی کا مطلب ہے، چپٹا حصہ کم تبدیلی کا، اور چوٹی یا وادی وہ جگہ ہے جہاں سمت مڑتی ہے۔ درجہ حرارت کے گراف کی شام کی کھڑی گراوٹ اس کی صبح کی نرم چڑھائی سے زیادہ اہم ہے، اور ڈھلوان ہی وہ چیز ہے جس سے آپ یہ بغیر کسی سلوپ کے حساب کے دیکھتے ہیں۔

Figure 5.2 redrawn: temperature over one day (°C)10 am2 pm8 pmRises to ~2 °C at 2 pm, then falls steeply to ~−9 °C by 8 pm
Line graph سمجھو: وقت کی ترتیب میں نکتے جوڑو — لکیر کی چڑھائی یا گراوٹ ہی کہانی ہے.
5.4.1.3 — Histograms۵.۴.۱.۳ — ہسٹوگرام
🏷 Tags: histogram, distribution, bins, intervals, frequency
ENGLISH

Histograms are used to show the distribution of a dataset. They group data into bins or intervals, allowing you to see how frequently values occur within those ranges. The word distribution is the key: a histogram does not care about any single student, it cares about the shape of the whole class — where the crowd gathers, where it thins out, and whether it piles up in one place or spreads across many.

The book's example is analysing how students performed in a maths exam, and Figure 5.3 shows the distribution of exam scores. The horizontal axis is divided into score intervals — 50–55, 56–60, 61–65, 66–70, 71–75, 76–80, 81–85, 86–90, 91–95, 96–100 — while the vertical axis counts frequency, how many students fell in each interval, from 0 to 5. Read the shape: the tallest bar is 61–65 with 5 students, followed by 66–70 with 4, and two more humps at 81–85 and 86–90 with 4 each; the lowest intervals, 50–55, hold only 1 student, and the middle intervals 71–75 and 76–80 hold 3 each. The class is not one smooth hill but a shape with a low-end peak and a high-end cluster — a detail a single average would have hidden completely.

Students often confuse histograms with bar charts, and the difference is worth fixing now. In a bar chart each bar is a separate category — apples, oranges, classes — and the bars stand apart. In a histogram each bar is a slice of one continuous scale — a range of scores — and the bars touch, because the scale itself is continuous: 65 flows into 66 without a gap. If the bars have gaps and the labels are names, it is a bar chart. If the bars touch and the labels are number ranges, it is a histogram. That one visual test settles most exam questions on the topic.

اردو

ہسٹوگرام کسی ڈیٹا سیٹ کی تقسیم دکھانے کے لیے استعمال ہوتے ہیں۔ وہ ڈیٹا کو بنز یا وقفوں میں گروپ کرتے ہیں، جس سے آپ دیکھ سکتے ہیں کہ ان حدود میں قدریں کتنی بار آتی ہیں۔ لفظ تقسیم ہی اصل ہے: ہسٹوگرام کو کسی ایک طالب علم کی پرواہ نہیں ہے، اسے پوری کلاس کی شکل کی پرواہ ہے — ہجوم کہاں جمع ہوتا ہے، کہاں پتلا ہوتا ہے، اور کیا وہ ایک جگہ ڈھیر ہوتا ہے یا کئی جگہ پھیلتا ہے۔

کتاب کی مثال ریاضی کے امتحان میں طلبہ کی کارکردگی کا تجزیہ کرنا ہے، اور فگر ۵.۳ امتحانی نمبروں کی تقسیم دکھاتی ہے۔ افقی محور نمبر کے وقفوں میں بٹا ہے — ۵۰–۵۵، ۵۶–۶۰، ۶۱–۶۵، ۶۶–۷۰، ۷۱–۷۵، ۷۶–۸۰، ۸۱–۸۵، ۸۶–۹۰، ۹۱–۹۵، ۹۶–۱۰۰ — جبکہ عمودی محور تعدد گنتا ہے، ہر وقفے میں کتنے طلبہ آئے، ۰ سے ۵ تک۔ شکل پڑھیں: سب سے لمبی بار ۶۱–۶۵ ہے جس میں ۵ طلبہ ہیں، پھر ۶۶–۷۰ میں ۴، اور ۸۱–۸۵ اور ۸۶–۹۰ میں دو اور ابھار ہیں جن میں ۴، ۴ ہیں؛ سب سے کم وقفے، ۵۰–۵۵، میں صرف ۱ طالب علم ہے، اور درمیانی وقفے ۷۱–۷۵ اور ۷۶–۸۰ میں ۳، ۳ ہیں۔ کلاس ایک ہموار پہاڑی نہیں بلکہ ایک شکل ہے جس میں کم سرے پر چوٹی اور زیادہ سرے پر جھرمٹ ہے — ایک تفصیل جسے ایک اوسط مکمل طور پر چھپا دیتی۔

طلبہ اکثر ہسٹوگرام کو بار چارٹ سے گڈمڈ کر دیتے ہیں، اور فرق ابھی طے کرنا فائدہ مند ہے۔ بار چارٹ میں ہر بار ایک الگ زمرہ ہے — سیب، مالٹے، کلاسیں — اور باریں الگ کھڑی ہوتی ہیں۔ ہسٹوگرام میں ہر بار ایک مسلسل پیمانے کا ٹکڑا ہے — نمبروں کی ایک حد — اور باریں چھوتی ہیں، کیونکہ پیمانہ خود مسلسل ہے: ۶۵ بغیر خلا کے ۶۶ میں بہتا ہے۔ اگر باروں میں خلا ہوں اور لیبل نام ہوں تو وہ بار چارٹ ہے۔ اگر باریں چھوتی ہوں اور لیبل نمبر کی حدیں ہوں تو وہ ہسٹوگرام ہے۔ یہ ایک بصری جانچ اس موضوع کے زیادہ تر امتحانی سوالات طے کر دیتی ہے۔

Figure 5.3 redrawn: exam-score distribution (bars touch!)61–65: tallest (5)81–90: second cluster (4+4)
Histogram سمجھو: نمبروں کو حدوں میں بانٹو, ہر حد کی انچائی بتائے گی کتنے طلبہ اس میں آئے — بارے ملتی ہیں, الگ نہیں.
5.4.1.4 — Scatterplots۵.۴.۱.۴ — اسکیٹر پلاٹ
🏷 Tags: scatterplot, relationship, two variables, observation, point
ENGLISH

Scatterplots are used to display the relationships between two variables. Each point on the graph represents an observation, and the position indicates values for both variables. That two-at-once reading is what makes a scatterplot different from every chart before it: a bar chart shows one value per category, a line graph shows one value over time, but a scatterplot point carries two numbers at the same time — its horizontal position is one variable, its vertical position is the other.

The book's example explores the relationship between the number of hours studied and exam scores, in Figure 5.4. The horizontal axis counts hours studied from 0 to 10, and the vertical axis counts exam scores from 0 to 100. Now read the cloud of points as a story. At 0 and 1 hours the scores sit low, around 40. At 2 hours a point reaches 50. Around 4 to 5 hours the points climb into the 60s and 70s, with one at 47 that breaks the pattern. By 6 to 8 hours the points gather in the 85 to 95 range. The overall drift is unmistakable: as hours rise, scores tend to rise too — a positive relationship, visible before any line or calculation.

Two cautions complete the skill. First, a scatterplot shows tendency, not certainty: that 47 at around 4 hours is a real student who studied and still scored low, and a good analyst mentions such points instead of hiding them. Second, a rising cloud does not prove that studying causes the higher score — motivated students may study more and also revise better, sleep better, or ask more questions. The scatterplot earns its place by showing you the relationship clearly enough to ask the next question properly, which is exactly what the regression models of section 5.3 then try to answer.

اردو

اسکیٹر پلاٹ دو متغیرات کے درمیان تعلقات ظاہر کرنے کے لیے استعمال ہوتے ہیں۔ گراف کا ہر نقطہ ایک مشاہدے کی نمائندگی کرتا ہے، اور اس کی پوزیشن دونوں متغیرات کی قدریں بتاتی ہے۔ یہ دوہرا پڑھنا ہی اسکیٹر پلاٹ کو اس سے پہلے کے ہر چارٹ سے الگ کرتا ہے: بار چارٹ فی زمرہ ایک قیمت دکھاتا ہے، لائن گراف وقت کے ساتھ ایک قیمت دکھاتا ہے، لیکن اسکیٹر پلاٹ کا نقطہ ایک وقت میں دو نمبر رکھتا ہے — اس کی افقی پوزیشن ایک متغیر ہے، اس کی عمودی پوزیشن دوسرا۔

کتاب کی مثال پڑھائی کے گھنٹوں اور امتحانی نمبروں کے درمیان تعلق کا جائزہ لیتی ہے، فگر ۵.۴ میں۔ افقی محور پڑھائی کے گھنٹے ۰ سے ۱۰ تک گنتا ہے، اور عمودی محور امتحانی نمبر ۰ سے ۱۰۰ تک گنتا ہے۔ اب نقطوں کے بادل کو کہانی کی طرح پڑھیں۔ ۰ اور ۱ گھنٹے پر نمبر کم ہیں، تقریباً ۴۰۔ ۲ گھنٹے پر ایک نقطہ ۵۰ تک پہنچتا ہے۔ تقریباً ۴ سے ۵ گھنٹوں پر نقطے ۶۰ اور ۷۰ کی دہائی میں چڑھتے ہیں، ایک ۴۷ پر جو پیٹرن توڑتا ہے۔ ۶ سے ۸ گھنٹوں تک نقطے ۸۵ سے ۹۵ کی حد میں جمع ہوتے ہیں۔ مجموعی بہاؤ ناقابل تردید ہے: جیسے گھنٹے بڑھتے ہیں، نمبر بھی بڑھنے کا رجحان رکھتے ہیں — ایک مثبت تعلق، کسی بھی لکیر یا حساب سے پہلے نظر آتا ہے۔

دو احتیاطیں مہارت مکمل کرتی ہیں۔ پہلی، اسکیٹر پلاٹ رجحان دکھاتا ہے، یقین نہیں: تقریباً ۴ گھنٹوں پر ۴۷ والا نقطہ ایک حقیقی طالب علم ہے جس نے پڑھا اور پھر بھی کم نمبر لیے، اور ایک اچھا تجزیہ کار ایسے نقطوں کو چھپانے کی بجائے ذکر کرتا ہے۔ دوسری، اٹھتا ہوا بادل یہ ثابت نہیں کرتا کہ پڑھائی سبب ہے زیادہ نمبر کا — باہمت طلبہ زیادہ بھی پڑھ سکتے ہیں اور بہتر دہرائی بھی کر سکتے ہیں، بہتر سو سکتے ہیں، یا زیادہ سوال پوچھ سکتے ہیں۔ اسکیٹر پلاٹ اپنی جگہ اس لیے کماتا ہے کہ وہ تعلق اتنی وضاحت سے دکھاتا ہے کہ اگلا سوال ٹھیک سے پوچھا جا سکے، جس کا جواب حصہ ۵.۳ کے رجعت ماڈل پھر دینے کی کوشش کرتے ہیں۔

Figure 5.4 redrawn: hours studied vs exam scoreCloud drifts upward: more hours tend to go with higher scoresGrey point (~4 hrs, 47) breaks the pattern — mention it, do not hide it
Scatterplot سمجھو: ہر نکتہ دو قیمتیں ایک ساتھ بتاتا ہے — بدل اوپر جھک رہا ہو تو دونوں میں مثبت تعلق ہے.
5.4.1.5 — Boxplots۵.۴.۱.۵ — باکس پلاٹ
🏷 Tags: boxplot, whisker plot, median, quartiles, outliers
ENGLISH

Boxplots, or whisker plots, summarise data distribution by displaying the median, quartiles, and potential outliers. They provide a visual summary of data variability and spread. If a histogram shows you the whole shape, a boxplot gives you the shape's skeleton in five numbers: the lowest value, the lower quartile, the median, the upper quartile, and the highest value, with stray points marked separately. That skeleton is enough to compare whole classes side by side, which is exactly the book's example.

A boxplot can be used to compare the exam scores of different classes to see which class performed better overall, and Figure 5.5 does this for three classes on one exam-score scale from 50 to 100. Read each row the same way. The thick line inside the box is the median. The box itself stretches from the lower quartile to the upper quartile — the middle half of the class. The dashed whiskers reach out toward the lowest and highest ordinary scores, and the small circles far outside are potential outliers, scores so far from the rest that they deserve a second look. In the figure, Class 3's box sits highest (roughly 68 to 78, median near 73) with outliers on both sides; Class 2's box is narrower and lower (roughly 68 to 76); Class 1's box sits lowest (roughly 62 to 74). On medians alone, Class 3 performed best overall — but Class 3 also has the widest spread and the most extreme outliers, so "best" comes with "most mixed."

The skill to practise is comparison, not memorisation of definitions. Place two boxplots side by side and ask three questions in order: which median is higher, which box is wider (more spread in the middle half), and are there outliers pulling attention? A narrow box high on the scale is a strong, even class. A wide box low on the scale is a struggling, mixed class. A boxplot lets you say both halves of that sentence in one glance, which is why it closes the book's tour of chart types.

اردو

باکس پلاٹ، یا وسکر پلاٹ، وسطانیہ، کوارٹائلز، اور ممکنہ آؤٹ لائرز دکھا کر ڈیٹا کی تقسیم کا خلاصہ کرتے ہیں۔ وہ ڈیٹا کی تبدیلی اور پھیلاؤ کا بصری خلاصہ دیتے ہیں۔ اگر ہسٹوگرام آپ کو پوری شکل دکھاتا ہے تو باکس پلاٹ آپ کو اس شکل کا ڈھانچہ پانچ نمبروں میں دیتا ہے: سب سے کم قیمت، نچلا کوارٹائل، وسطانیہ، اوپری کوارٹائل، اور سب سے زیادہ قیمت، ساتھ بھٹکے ہوئے نقطے الگ نشان زد۔ یہ ڈھانچہ پوری کلاسوں کا آمنے سامنے موازنہ کرنے کے لیے کافی ہے، جو بالکل کتاب کی مثال ہے۔

باکس پلاٹ مختلف کلاسوں کے امتحانی نمبروں کا موازنہ کرنے کے لیے استعمال کیا جا سکتا ہے کہ کون سی کلاس مجموعی طور پر بہتر رہی، اور فگر ۵.۵ یہ تین کلاسوں کے لیے ۵۰ سے ۱۰۰ کے ایک امتحانی نمبر پیمانے پر کرتی ہے۔ ہر قطار کو ایک ہی طرح پڑھیں۔ باکس کے اندر موٹی لکیر وسطانیہ ہے۔ باکس خود نچلے کوارٹائل سے اوپری کوارٹائل تک پھیلتا ہے — کلاس کا درمیانی آدھا حصہ۔ ڈیش والی وسکرز سب سے کم اور سب سے زیادہ عام نمبروں کی طرف پہنچتی ہیں، اور دور چھوٹے دائرے ممکنہ آؤٹ لائرز ہیں، ایسے نمبر جو باقیوں سے اتنے دور ہیں کہ وہ دوسری نظر کے مستحق ہیں۔ فگر میں کلاس ۳ کا باکس سب سے اونچا بیٹھتا ہے (تقریباً ۶۸ سے ۷۸، وسطانیہ ۷۳ کے قریب) دونوں طرف آؤٹ لائرز کے ساتھ؛ کلاس ۲ کا باکس تنگ اور نچلا ہے (تقریباً ۶۸ سے ۷۶)؛ کلاس ۱ کا باکس سب سے نچلا بیٹھتا ہے (تقریباً ۶۲ سے ۷۴)۔ صرف وسطانیہ پر کلاس ۳ مجموعی طور پر بہترین رہی — لیکن کلاس ۳ کا پھیلاؤ بھی سب سے وسیع اور انتہائی آؤٹ لائرز سب سے زیادہ ہیں، اس لیے "بہترین" کے ساتھ "سب سے ملی جلی" بھی آتا ہے۔

مشق کرنے کی مہارت موازنہ ہے، تعریفیں رٹنا نہیں۔ دو باکس پلاٹ آمنے سامنے رکھیں اور ترتیب سے تین سوال پوچھیں: کس کا وسطانیہ زیادہ ہے، کس کا باکس چوڑا ہے (درمیانی آدھے میں زیادہ پھیلاؤ)، اور کیا آؤٹ لائرز توجہ کھینچ رہے ہیں؟ پیمانے پر اونچا تنگ باکس ایک مضبوط، یکساں کلاس ہے۔ پیمانے پر نچلا چوڑا باکس ایک جدوجہد کرنے والی، ملی جلی کلاس ہے۔ باکس پلاٹ آپ کو اس جملے کے دونوں آدھے ایک نظر میں کہنے دیتا ہے، اسی لیے یہ کتاب کے چارٹ کی اقسام کے دورے کو بند کرتا ہے۔

Figure 5.5 redrawn: three classes, one scale (exam scores)Class 3Class 2Class 1Thick line = median · Box = middle half · Dashed whiskers = range · Circles = outliers
Boxplot سمجھو: box کے اندر لکیر median ہے, box خود درمیانی آدھا class ہے, اور دور دائرے عجیب نمبروں کی نشانی ہیں.
5.5 & 5.5.1 — Tools for Data Visualization: Excel and Google Sheets۵.۵ اور ۵.۵.۱ — ڈیٹا کی تصویر کشی کے اوزار: ایکسل اور گوگل شیٹس
🏷 Tags: visualization tools, Excel, Google Sheets, Tableau, Matplotlib, Python
ENGLISH

As discussed in the above section, visualisation data helps us make sense of large amounts of information by turning numbers into easy-to-understand charts and graphs. In this section, we will discuss tools that can be used to create these visualizations and guide you through how to create and interpret them step by step. That guidance matters, because knowing that a bar chart exists is not the same as being able to make one from your own messy spreadsheet before a deadline.

There are many tools available for creating data visualizations, but some of the easiest to use are ones you may already be familiar with, such as Microsoft Excel and Google Sheets. These tools are widely accessible and provide straightforward methods for creating charts, graphs, and other visual representations of data. Section 5.5.1 makes the point concrete: Excel and Google Sheets allow you to easily enter your data and then generate a variety of visualizations such as bar charts, line graphs, and scatterplots. The book's example is a small business in your local area tracking how many products it sells each month: enter the data for each month in Excel or Google Sheets, and with just a few clicks you can create a bar chart to see which month had the most sales.

Do not let the ease of these two tools hide the wider toolbox the chapter's outcomes name: the Student Learning Outcomes list MS Excel, Google Sheets, Python, Tableau, and Matplotlib together as data visualisation software you should be able to create and interpret with. Excel and Sheets are the fastest route for a classroom bar chart; Python with Matplotlib is the route when the dataset grows too large for a spreadsheet or the chart must be reproduced exactly; Tableau is the route for interactive dashboards that managers explore. The chart type you choose stays the same across all of them — only the clicks change. Learn the chart first, the tool second, and you will never be trapped by a single program.

اردو

جیسا کہ اوپر والے حصے میں بحث ہوئی، ڈیٹا کی تصویر کشی بڑی مقدار میں معلومات کو آسان سمجھ آنے والے چارٹ اور گراف میں بدل کر سمجھنے میں مدد دیتی ہے۔ اس حصے میں ہم ان اوزاروں پر بحث کریں گے جو ان تصویر کشیوں کو بنانے کے لیے استعمال کیے جا سکتے ہیں اور آپ کو مرحلہ وار رہنمائی دیں گے کہ انہیں کیسے بنائیں اور کیسے سمجھیں۔ یہ رہنمائی اہم ہے، کیونکہ یہ جاننا کہ بار چارٹ ہوتا ہے، آخری وقت سے پہلے اپنی گڈمڈ اسپریڈ شیٹ سے ایک بنانے کے قابل ہونے جیسا نہیں ہے۔

ڈیٹا کی تصویر کشی بنانے کے لیے کئی اوزار دستیاب ہیں، لیکن استعمال میں سب سے آسان وہ ہیں جن سے آپ پہلے سے واقف ہو سکتے ہیں، جیسے مائیکروسافٹ ایکسل اور گوگل شیٹس۔ یہ اوزار وسیع پیمانے پر دستیاب ہیں اور چارٹ، گراف اور ڈیٹا کی دیگر بصری نمائندگیاں بنانے کے سیدھے طریقے دیتے ہیں۔ حصہ ۵.۵.۱ اس نکتے کو ٹھوس بناتا ہے: ایکسل اور گوگل شیٹس آپ کو آسانی سے اپنا ڈیٹا درج کرنے اور پھر مختلف تصویر کشیاں بنانے دیتے ہیں جیسے بار چارٹ، لائن گراف اور اسکیٹر پلاٹ۔ کتاب کی مثال آپ کے مقامی علاقے کا ایک چھوٹا کاروبار ہے جو ٹریک کرتا ہے کہ وہ ہر مہینے کتنی مصنوعات بیچتا ہے: ہر مہینے کا ڈیٹا ایکسل یا گوگل شیٹس میں درج کریں، اور صرف چند کلکس سے آپ بار چارٹ بنا سکتے ہیں کہ کس مہینے سب سے زیادہ فروخت ہوئی۔

ان دو اوزاروں کی آسانی کو باب کے نتائج کے نام لیے گئے وسیع ٹول باکس کو چھپانے نہ دیں: طلبہ کے سیکھنے کے نتائج MS ایکسل، گوگل شیٹس، پائتھن، ٹیبلو، اور میٹ پلاٹ لب کو ایک ساتھ ڈیٹا تصویر کشی کے سافٹ ویئر کے طور پر درج کرتے ہیں جن سے آپ بنا اور سمجھ سکیں۔ کلاس روم کے بار چارٹ کے لیے ایکسل اور شیٹس تیز ترین راستہ ہیں؛ پائتھن مع میٹ پلاٹ لب وہ راستہ ہے جب ڈیٹا سیٹ اسپریڈ شیٹ کے لیے بہت بڑا ہو جائے یا چارٹ بالکل دوبارہ بنانا ہو؛ ٹیبلو انٹرایکٹو ڈیش بورڈز کا راستہ ہے جنہیں مینیجر کھوجتے ہیں۔ آپ کی چنی ہوئی چارٹ کی قسم ان سب میں وہی رہتی ہے — صرف کلکس بدلتے ہیں۔ پہلے چارٹ سیکھیں، اوزار بعد میں، اور آپ کبھی کسی ایک پروگرام میں پھنس نہیں پائیں گے۔

Monthly sales in a spreadsheet → bar chart in a few clicksMonth | SalesJan 120 · Feb 150Mar 200 · Apr 170Tallest bar = best month — no formula needed to see itSame chart, any tool: Excel · Google Sheets · Python/Matplotlib · Tableau
Tools سمجھو: پہلے chart کی قسم سمجھو, پھر جس tool میں ہاتھ آئے اس میں بناؤ — chart وہی رہے گا.
5.5.2 — Creating and Interpreting Visualizations (Step-by-Step)۵.۵.۲ — تصویر کشیاں بنانا اور سمجھنا (مرحلہ وار)
🏷 Tags: create visualization, enter data, select data, chart type, customize, interpret
ENGLISH

⚠️ کتاب کی numbering غلطی, درست شدہ: on printed page 83 this section is headed "5.2.2 Creating and Interpreting Visualizations," but it sits inside section 5.5 (Tools for Data Visualization) after 5.5.1, so its number should be 5.5.2. This page uses 5.5.2 and flags the book's 5.2.2 as a misprint, since 5.2.2 already names Data Preparation earlier in the chapter.

The section gives a simple step-by-step guide to creating a visualization in Excel or Google Sheets, and each step is worth doing in order rather than jumping to the chart button. Step 1: Enter Your Data. Start by entering your data into the spreadsheet. For example, in one column you could have the months (January, February, etc.), and in another column the sales figures for each month. Clean labels matter here: a column headed "Month" and a column headed "Sales (Rs.)" will label your chart for you, while two mystery columns will confuse every reader. Step 2: Select the Data. Highlight the data you want to visualize by clicking and dragging your mouse over the cells — including the headings, so the chart knows what each column means.

Step 3: Choose a Chart Type. Click on the "Insert" tab and select the type of chart you want to create (bar chart, line graph, etc.). Choose by the question, not by looks: categories to compare mean a bar chart, a trend over time means a line graph, two variables together mean a scatterplot, and a distribution means a histogram. Step 4: Customize the Chart. You can add labels to your chart to make it clearer, such as labelling the x-axis with the months and the y-axis with the sales figures. A chart without axis labels is a picture without a caption — pretty and unusable. Step 5: Understanding Statistical Representations. When you create a visualization, it is important to understand what the chart is telling you. Ask the three questions this chapter has trained: what is the tallest or highest point, what is the trend or shape, and is there an outlier or surprise that needs explaining? A chart you cannot explain in two sentences is not finished, however colourful it looks.

اردو

⚠️ کتاب کی نمبرنگ کی غلطی، درست شدہ: چھپی ہوئی صفحہ ۸۳ پر اس حصے کا عنوان "۵.۲.۲ تصویر کشیاں بنانا اور سمجھنا" ہے، لیکن یہ حصہ ۵.۵ (ڈیٹا کی تصویر کشی کے اوزار) کے اندر ۵.۵.۱ کے بعد آتا ہے، اس لیے اس کا نمبر ۵.۵.۲ ہونا چاہیے۔ یہ صفحہ ۵.۵.۲ استعمال کرتا ہے اور کتاب کے ۵.۲.۲ کو چھپائی کی غلطی کے طور پر نشان زد کرتا ہے، کیونکہ ۵.۲.۲ پہلے ہی باب میں ڈیٹا کی تیاری کا نام ہے۔

یہ حصہ ایکسل یا گوگل شیٹس میں تصویر کشی بنانے کی سادہ مرحلہ وار رہنمائی دیتا ہے، اور ہر مرحلہ چارٹ کے بٹن پر چھلانگ لگانے کی بجائے ترتیب سے کرنا فائدہ مند ہے۔ مرحلہ ۱: اپنا ڈیٹا درج کریں۔ اپنا ڈیٹا اسپریڈ شیٹ میں درج کر کے شروع کریں۔ مثال کے طور پر ایک کالم میں مہینے ہو سکتے ہیں (جنوری، فروری، وغیرہ)، اور دوسرے کالم میں ہر مہینے کی فروخت کے اعداد۔ صاف لیبل یہاں اہم ہیں: "Month" عنوان والا کالم اور "Sales (Rs.)" عنوان والا کالم آپ کے چارٹ کو خود لیبل کر دیں گے، جبکہ دو پراسرار کالم ہر قاری کو الجھا دیں گے۔ مرحلہ ۲: ڈیٹا منتخب کریں۔ ان سیلز پر ماؤس کلک کر کے اور گھسیٹ کر وہ ڈیٹا نمایاں کریں جسے آپ بصری شکل دینا چاہتے ہیں — عنوانات سمیت، تاکہ چارٹ جان سکے کہ ہر کالم کا کیا مطلب ہے۔

مرحلہ ۳: چارٹ کی قسم چنیں۔ "Insert" ٹیب پر کلک کریں اور وہ چارٹ کی قسم منتخب کریں جو آپ بنانا چاہتے ہیں (بار چارٹ، لائن گراف، وغیرہ)۔ شکل سے نہیں بلکہ سوال سے چنیں: موازنہ کرنے والے زمرے بار چارٹ کا مطلب ہیں، وقت کے ساتھ رجحان لائن گراف کا مطلب ہے، دو متغیر ایک ساتھ اسکیٹر پلاٹ کا مطلب ہیں، اور تقسیم ہسٹوگرام کا مطلب ہے۔ مرحلہ ۴: چارٹ کو اپنی مرضی کے مطابق بنائیں۔ آپ اپنے چارٹ کو واضح بنانے کے لیے لیبل لگا سکتے ہیں، جیسے x-axis کو مہینوں سے اور y-axis کو فروخت کے اعداد سے لیبل کرنا۔ محور لیبل کے بغیر چارٹ بغیر عنوان کی تصویر ہے — خوبصورت اور ناقابل استعمال۔ مرحلہ ۵: شماریاتی نمائندگیوں کو سمجھنا۔ جب آپ تصویر کشی بنائیں تو یہ سمجھنا اہم ہے کہ چارٹ آپ کو کیا بتا رہا ہے۔ وہ تین سوال پوچھیں جن کی اس باب نے تربیت دی ہے: سب سے لمبا یا اونچا نقطہ کیا ہے، رجحان یا شکل کیا ہے، اور کیا کوئی آؤٹ لائر یا حیرت ہے جس کی وضاحت چاہیے؟ ایک چارٹ جسے آپ دو جملوں میں سمجھا نہیں سکتے وہ مکمل نہیں ہے، چاہے وہ کتنا ہی رنگین لگے۔

1. Enterdata + labels2. Selectcells + headings3. Choosechart by question4. Labelboth axes5. Interpretin 2 sentencesBook prints this as 5.2.2 — corrected here to 5.5.2 (see text above)
Visualization steps سمجھو: data ڈالو, select کرو, سوال کے حساب سے chart چنو, label لگاؤ, پھر دو جملوں میں سمجھاؤ کے chart کیا کہہ رہا ہے.
📝 Official Exercise Questions — with Answers📝 کتاب کی مشق — جوابات کے ساتھ
KITAB KI EXERCISE

Below are all questions of the chapter exercise from Unit 5 of the official book (printed pages 84–85): 8 multiple-choice, 4 short and 5 long questions = 22 answer blocks (long questions کے English اور Urdu جواب الگ-الگ blocks میں دیے گئے ہیں). تھے book has no inquisitive, review or numerical section ان this unit, so none اس invented here. MCQ keys book کے final Answers section (printed p. 141, Unit 5) سے cross-check کی گئی ہیں: 1-a, 2-b, 3-d, 4-b, 5-a, 7-b. دو exceptions, دونوں answers میں flagged ہیں: (1) MCQ 6 کی printed key (b) غلط ہے — درست جواب (c) ہے; (2) MCQ 8 کی کوئی key Answers table میں ہے ہی نہیں (table صرف Q1–Q7 دیتی ہے), اس لیے اس کی key (b) کتاب کے اپنے §5.3.1.4 کے text سے derived ہے. جہاں جواب derived ہے یا کتاب میں غلطی ہے, وہاں answer میں صاف لکھا گیا ہے.

Multiple Choice Questionsکثیر الانتخابی سوالات

1. An example of a basic statistical model:

Answer / جواب

Answer: (a) Linear Regression — Linear regression is the basic model worked through in section 5.3.1.2 — one straight line, one slope, one intercept. Neural networks, decision trees and support vector machines are more advanced models, not the basic example the chapter builds by hand. لکیری رجعت وہ بنیادی ماڈل ہے جسے حصہ ۵.۳.۱.۲ میں ہاتھ سے بنایا گیا ہے — ایک سیدھی لکیر، ایک سلوپ، ایک انٹرسیپٹ۔ نیورل نیٹ ورک، ڈیسیژن ٹری اور سپورٹ ویکٹر مشینیں زیادہ جدید ماڈل ہیں، بنیادی مثال نہیں۔

2. The activity involved in experimental design in data science:

Answer / جواب

Answer: (b) Collecting and analyzing data systematically — Experimental design is about gathering evidence in an orderly, controlled way — changing one variable, measuring another, keeping the rest steady — which is exactly collecting and analysing data systematically. Charts, code and databases may support the work, but none of them is the design itself. تجرباتی ڈیزائن منظم، قابو شدہ طریقے سے ثبوت جمع کرنے کے بارے میں ہے — ایک متغیر بدلنا، دوسرا ناپنا، باقی مستحکم رکھنا — جو بالکل منظم طریقے سے ڈیٹا اکٹھا کرنا اور اس کا تجزیہ کرنا ہے۔ چارٹ، کوڈ اور ڈیٹا بیس کام میں مدد دے سکتے ہیں، لیکن ان میں سے کوئی خود ڈیزائن نہیں ہے۔

3. A commonly used tool for creating data visualizations:

Answer / جواب

Answer: (d) All of the above — All three are named in this chapter: Excel and Google Sheets in section 5.5, and Python/Matplotlib and Tableau in the Student Learning Outcomes. Since each option is a genuine visualisation tool, the correct choice is all of the above. تینوں اس باب میں نام لیے گئے ہیں: حصہ ۵.۵ میں ایکسل اور گوگل شیٹس، اور طلبہ کے سیکھنے کے نتائج میں پائتھن/میٹ پلاٹ لب اور ٹیبلو۔ چونکہ ہر آپشن ایک حقیقی تصویر کشی کا اوزار ہے، درست انتخاب مندرجہ بالا سب ہیں۔

4. The meaning of the slope in a linear regression model:

Answer / جواب

Answer: (b) The change in the dependent variable for a unit change in the independent variable — The slope β₁ says how much Y moves when X moves by one. In the fruit-stall example β₁ = 40 means each extra customer adds Rs. 40 to earnings. The intercept is the value when X = 0, the error term is the leftover difference, and the mean is a different summary altogether. سلوپ β₁ بتاتا ہے کہ X میں ایک اکائی تبدیلی سے Y کتنا حرکت کرتا ہے۔ پھلوں کی دکان کی مثال میں β₁ = ۴۰ کا مطلب ہے ہر اضافی گاہک آمدنی میں ۴۰ روپے جوڑتا ہے۔ انٹرسیپٹ وہ قیمت ہے جب X = ۰ ہو، غلطی کی اصطلاح بچا ہوا فرق ہے، اور اوسط ایک بالکل مختلف خلاصہ ہے۔

5. An example of a real-world application of statistical models:

Answer / جواب

Answer: (a) Predicting house prices — Predicting a house price from past sales, size and location is exactly what a statistical model does — learn a pattern from past data and predict a new value. The other options are creative or design tasks, not predictions from data. گزشتہ فروخت، سائز اور مقام سے مکان کی قیمت کی پیش گوئی بالکل وہی ہے جو شماریاتی ماڈل کرتا ہے — گزشتہ ڈیٹا سے پیٹرن سیکھنا اور نئی قیمت کی پیش گوئی کرنا۔ دوسرے آپشن تخلیقی یا ڈیزائن کے کام ہیں، ڈیٹا سے پیش گوئیاں نہیں۔

6. Option not considered a benefit of data visualization:

Answer / جواب

Answer: (c) Making data more complex — ⚠️ Kitaab ki key ghalat hai — durust jawab (c) hai. Identifying trends, communicating insights and summarising large datasets are all benefits named in this chapter (section 5.4: visualisation helps quickly identify patterns, trends and insights). Making data more complex is the opposite of a benefit — it is what visualisation exists to prevent. NOTE: the book's final Answers table (printed p. 141, Unit 5, Q6) prints 'b', but option (b) — communicating insights effectively — is plainly a benefit, so the printed key cannot be right and is corrected here to (c). ⚠️ کتاب کی کلید غلط ہے — درست جواب (c) ہے۔ رجحانات پہچاننا، بصیرتیں مؤثر طریقے سے پہنچانا اور بڑے ڈیٹا سیٹوں کا خلاصہ کرنا سب اس باب میں نام لیے گئے فوائد ہیں (حصہ ۵.۴: تصویر کشی پیٹرن، رجحانات اور بصیرتیں تیزی سے پہچاننے میں مدد دیتی ہے)۔ ڈیٹا کو زیادہ پیچیدہ بنانا فائدے کی ضد ہے — یہ وہی ہے جسے روکنے کے لیے تصویر کشی ہے۔ نوٹ: کتاب کی آخری جوابات کی ٹیبل (چھپی ہوئی صفحہ ۱۴۱، یونٹ ۵، سوال ۶) 'b' چھاپتی ہے، لیکن آپشن (b) — بصیرتیں مؤثر طریقے سے پہنچانا — واضح طور پر ایک فائدہ ہے، اس لیے چھپی ہوئی کلید درست نہیں ہو سکتی اور یہاں اسے (c) درست کیا گیا ہے۔

7. A primary goal of K-Means Clustering:

Answer / جواب

Answer: (b) To group data into clusters based on similarity — K-means discovers groups from similarity itself — students who perform alike land together — without being told the categories in advance. Classifying into predefined categories is a different task, predicting continuous outcomes is regression, and reducing dimensionality is a different technique. K-means مماثلت سے خود گروہ دریافت کرتا ہے — ایک جیسی کارکردگی والے طلبہ ایک ساتھ آتے ہیں — بغیر پہلے سے زمرے بتائے۔ پہلے سے طے شدہ زمروں میں درجہ بندی ایک مختلف کام ہے، مسلسل نتائج کی پیش گوئی رجعت ہے، اور جہت کم کرنا ایک مختلف تکنیک ہے۔

8. The meaning of “K” in K-Means Clustering:

Answer / جواب

Answer: (b) Number of clusters to be formed — ⚠️ Derived key — کتاب کی Answers table میں اس سوال کی key موجود نہیں. تھے Answers table for Unit 5 (printed p. 141) lists only questions 1–7, although تھے exercise has 8 MCQs, so no printed key exists for Q8. تھے key (b) اس derived from تھے book's own text ان section 5.3.1.4: 'we need تو decide how many groups (clusters) we want' — that chosen number اس K. It اس not تھے number of features, iterations, اور data points. ⚠️ اخذ شدہ کلید — کتاب کی جوابات کی ٹیبل میں اس سوال کی کلید موجود نہیں ہے۔ یونٹ ۵ کی جوابات کی ٹیبل (چھپی ہوئی صفحہ ۱۴۱) صرف سوال ۱–۷ درج کرتی ہے، حالانکہ مشق میں ۸ MCQs ہیں، اس لیے سوال ۸ کی کوئی چھپی ہوئی کلید موجود نہیں ہے۔ کلید (b) کتاب کے اپنے متن سے حصہ ۵.۳.۱.۴ سے اخذ کی گئی ہے: 'ہمیں یہ طے کرنا ہوتا ہے کہ ہم کتنے گروہ (کلسٹر) چاہتے ہیں' — وہ چنا گیا نمبر ہی K ہے۔ یہ خصوصیات، تکرار، یا ڈیٹا پوائنٹس کی تعداد نہیں ہے۔

Short Questionsمختصر سوالات
1. What is the importance of building statistical models in real-world applications?

Statistical models matter because they turn past data into decisions about the future. A shopkeeper who knows that each extra customer adds about Rs. 40 can plan stock and staff; a school that knows study hours track exam scores can advise students; a business that can forecast next month's grocery or sales bill can budget instead of guessing. Without a model, every such choice is a guess dressed up as experience. With a model, the guess is replaced by a rule learned from data — and, crucially, a rule that can be tested on new data and improved. That is why the chapter's outcomes list model building first: prediction, planning and evaluation all rest on it.

شماریاتی ماڈل اس لیے اہم ہیں کہ وہ گزشتہ ڈیٹا کو مستقبل کے فیصلوں میں بدل دیتے ہیں۔ ایک دکاندار جو جانتا ہے کہ ہر اضافی گاہک تقریباً ۴۰ روپے جوڑتا ہے وہ ذخیرہ اور عملے کی منصوبہ بندی کر سکتا ہے؛ ایک اسکول جو جانتا ہے کہ پڑھائی کے گھنٹے امتحانی نمبروں کے ساتھ چلتے ہیں وہ طلبہ کو مشورہ دے سکتا ہے؛ ایک کاروبار جو اگلے مہینے کے کریانے یا فروخت کے بل کی پیش گوئی کر سکتا ہے وہ اندازے کی بجائے بجٹ بنا سکتا ہے۔ ماڈل کے بغیر ایسا ہر انتخاب تجربے کے بھیس میں اندازہ ہے۔ ماڈل کے ساتھ اندازے کی جگہ ڈیٹا سے سیکھا گیا اصول آ جاتا ہے — اور اہم بات یہ کہ ایک ایسا اصول جسے نئے ڈیٹا پر جانچا اور بہتر کیا جا سکتا ہے۔

2. Name one basic statistical model used for predicting outcomes and explain its purpose.

Linear regression is the chapter's basic model. Its purpose is to predict one variable from another by fitting a straight line to past data — for example, predicting a fruit stall's daily earnings from the number of customers. The line is Earnings = 100 + 40 × Customers: the intercept (100) is the base earning when no customers come, and the slope (40) is the extra earning per customer. Once fitted, the model answers new questions at once: 22 customers predict 100 + 880 = Rs. 980. Its purpose, in one line, is to turn a visible relationship between two variables into a usable prediction rule.

لکیری رجعت باب کا بنیادی ماڈل ہے۔ اس کا مقصد گزشتہ ڈیٹا پر سیدھی لکیر فٹ کر کے ایک متغیر سے دوسرے کی پیش گوئی کرنا ہے — مثال کے طور پر گاہکوں کی تعداد سے پھلوں کی دکان کی روزانہ آمدنی کی پیش گوئی۔ لکیر آمدنی = ۱۰۰ + ۴۰ × گاہک ہے: انٹرسیپٹ (۱۰۰) وہ بنیادی آمدنی ہے جب کوئی گاہک نہ آئے، اور سلوپ (۴۰) فی گاہک اضافی آمدنی ہے۔ فٹ ہو جانے کے بعد ماڈل نئے سوالات کا فوراً جواب دیتا ہے: ۲۲ گاہک ۱۰۰ + ۸۸۰ = ۹۸۰ روپے کی پیش گوئی کرتے ہیں۔ ایک جملے میں اس کا مقصد دو متغیرات کے درمیان نظر آنے والے تعلق کو قابل استعمال پیش گوئی کے اصول میں بدلنا ہے۔

3. List two types of data visualizations and describe when you would use each.

Bar chart — use it when comparing different categories, such as sales of different products in a store. Each bar is one category and its height is the value, so the leader is visible at a glance. Line graph — use it when showing a trend over time, such as temperature across a day (Figure 5.2: about −5 °C at 10 am, peaking near 2 °C at 2 pm, falling to about −9 °C by 8 pm). The joined points make rises, falls and turning points obvious. The choice follows the question: separate things to compare call for bars; one thing changing over time calls for a line.

بار چارٹ — اسے اس وقت استعمال کریں جب مختلف زمروں کا موازنہ کرنا ہو، جیسے دکان میں مختلف مصنوعات کی فروخت۔ ہر بار ایک زمرہ ہے اور اس کی اونچائی قیمت ہے، اس لیے آگے والا ایک نظر میں نظر آتا ہے۔ لائن گراف — اسے اس وقت استعمال کریں جب وقت کے ساتھ رجحان دکھانا ہو، جیسے ایک دن کے دوران درجہ حرارت (فگر ۵.۲: صبح ۱۰ بجے تقریباً −۵ °C، دوپہر ۲ بجے ۲ °C کے قریب عروج، رات ۸ بجے تک تقریباً −۹ °C تک گراوٹ)۔ جڑے ہوئے نقطے اٹھنے، گرنے اور مڑنے کے مقامات واضح کر دیتے ہیں۔ انتخاب سوال کے پیچھے چلتا ہے: موازنہ کرنے والی الگ چیزیں بار مانگتی ہیں؛ وقت کے ساتھ بدلتی ایک چیز لکیر مانگتی ہے۔

4. How does visualizing data help in understanding descriptive statistics?

Descriptive statistics — mean, median, mode, variance and standard deviation — summarise a dataset in numbers, but numbers alone hide the shape. A chart shows that shape instantly: a histogram reveals whether scores pile up in one interval or spread across many; a boxplot shows the median, the middle half and the outliers side by side for whole classes; a scatterplot shows whether two variables rise together. In the book's own words, visualisation helps us quickly identify patterns, trends and insights — so a student who sees the histogram's two humps understands the class better than a student who only knows its average. The numbers say what the centre and spread are; the picture shows why they look that way.

وضاحتی شماریات — اوسط، وسطانیہ، کثیر الوقوع قدر، تغیر اور معیاری انحراف — ڈیٹا سیٹ کا نمبروں میں خلاصہ کرتی ہیں، لیکن اکیلے نمبر شکل چھپا دیتے ہیں۔ ایک چارٹ وہ شکل فوراً دکھاتا ہے: ہسٹوگرام ظاہر کرتا ہے کہ آیا نمبر ایک وقفے میں ڈھیر ہوتے ہیں یا کئی میں پھیلتے ہیں؛ باکس پلاٹ وسطانیہ، درمیانی آدھا حصہ اور آؤٹ لائرز پوری کلاسوں کے لیے آمنے سامنے دکھاتا ہے؛ اسکیٹر پلاٹ دکھاتا ہے کہ آیا دو متغیر ایک ساتھ اٹھتے ہیں۔ کتاب کے اپنے الفاظ میں، تصویر کشی پیٹرن، رجحانات اور بصیرتیں تیزی سے پہچاننے میں مدد دیتی ہے — اس لیے جو طالب علم ہسٹوگرام کے دو ابھار دیکھتا ہے وہ کلاس کو اس طالب علم سے بہتر سمجھتا ہے جو صرف اس کی اوسط جانتا ہے۔ نمبر بتاتے ہیں کہ مرکز اور پھیلاؤ کیا ہیں؛ تصویر دکھاتی ہے کہ وہ ایسے کیوں لگتے ہیں۔

Long Questions — English Answersطویل سوالات — انگریزی جوابات
1. Explain the role and importance of statistical models in solving real-world problems. (English answer)

Statistical models solve real-world problems by giving decision-makers a tested rule instead of a hunch. Their role has three parts. First, they make sense of the past: a model takes messy historical data — past grocery bills, past sales, past exam results — and finds the pattern inside it, such as "earnings rise by about Rs. 40 per customer." Second, they predict the future: that pattern becomes a formula (Earnings = 100 + 40 × Customers) that answers new questions, like the earnings from 22 customers (Rs. 980), before the day happens. Third, they can be checked: a model is tested on unseen data — 28 customers predicted Rs. 1,220 against an actual Rs. 1,250, an error of 30 — so its limits are known, not hidden.

Their importance follows from those three roles. Planning becomes possible: shops order stock, schools advise students, and households budget, all from forecasts rather than guesses. Problems become discussable: instead of arguing opinions about whether printed notes help, a teacher can run the two-group experiment and compare test scores. And mistakes become fixable: when a prediction misses, the error points to what the model lacks — more data, a missing factor such as family size or a special event, or a fresh update — and the Tidbits box in section 5.3.1.2 lists exactly those remedies. A model is therefore not a fortune-teller; it is a disciplined way of learning from what happened, predicting what may happen, and admitting how far off it can be.

2. Describe the steps involved in building a basic statistical model (e.g., linear regression). Include details on data collection, model training, and evaluation. (English answer)

Building a basic model, such as the chapter's linear regression for a fruit stall, follows five steps. 1. Define the problem. State what is to be predicted and what may influence it: predict daily earnings from the number of customers, with factors such as day of the week or season noted as possible influences. 2. Collect data. Gather historical records in matching pairs — here, five days: (10, Rs. 500), (15, Rs. 700), (20, Rs. 900), (25, Rs. 1,100), (30, Rs. 1,300). Good collection matters more than clever mathematics: the data must be relevant, cleaned of errors and gaps (sections 5.2.2–5.2.3.3), and in pairs, because regression learns from how X and Y move together.

3. Choose an algorithm. For a number predicted from another number, choose linear regression, Y = β₀ + β₁X + ε. 4. Train the model. Training means finding the line that best fits the collected pairs. From the table, every 5 extra customers add Rs. 200, so the slope β₁ = 200 ÷ 5 = 40; substituting one pair, 500 = β₀ + 400, gives the intercept β₀ = 100. The trained model is Earnings = 100 + 40 × Customers. 5. Evaluate the model. Test it on new, unseen data, never on the training pairs. For 22 customers it predicts Rs. 980. For a real 6th day with 28 customers and actual earnings Rs. 1,250, it predicts Rs. 1,220, so the error is 1,220 − 1,250 = −30 Rs. The prediction is close but imperfect — and that measured gap, not enthusiasm, is what tells you whether the model is good enough to use, and whether more data or extra factors should be added.

3. Discuss the types of data visualizations and their uses. (English answer)

The chapter teaches five types, each matched to a different question. Bar charts compare different categories: each bar is a category and its height is the value, so Figure 5.1 compares product sales at a glance, with values up to 1,000. Line graphs show trends over time: points are plotted in time order and joined, so Figure 5.2 shows temperature rising from about −5 °C at 10 am to near 2 °C at 2 pm and then falling steeply to about −9 °C by 8 pm. Histograms show the distribution of one dataset: values are grouped into bins such as 61–65 or 81–85, and bar height is frequency, so Figure 5.3 reveals that maths scores pile up at 61–65 (5 students) and again at 81–90 — a shape no average could show. Their bars touch, because the scale is continuous.

Scatterplots display the relationship between two variables: each point is one observation carrying both values, so Figure 5.4 shows hours studied against exam scores drifting upward together, with one low point near 4 hours as a visible exception. Boxplots (whisker plots) summarise distribution for comparison: the box holds the middle half, the line inside is the median, whiskers reach the ordinary extremes, and circles mark outliers, so Figure 5.5 lets three classes be compared on one scale — Class 3 highest on median but most mixed. Choosing well means matching the chart to the question: compare categories with bars, follow time with a line, see a distribution with a histogram, relate two variables with a scatterplot, and compare groups with boxplots.

4. Explain data collection methods. (English answer)

The chapter teaches three data collection methods, chosen by the research objective and the type of data required. Surveys collect large amounts of data in a structured way: a predefined set of questions is asked to a sample group, by online forms, telephone calls or face-to-face interviews. The Islamabad grocery store's five-question survey of 50 customers — what categories they buy most, what they want more of, how often they shop, what influences them, plus open comments — is the model example, and its answers end in a stocking decision. Surveys are best when many people's answers must be counted and compared.

Observations collect data by watching subjects in their natural environment without interference. The restaurant that watches which lunchtime tables fill first over a week learns the truth about seating preference without asking anyone — and rearranges its seating for comfort and traffic flow. Observation is best when asking would change the behaviour or when people cannot report accurately. Experiments manipulate one or more variables to find their effect on another: the teacher gives one group printed notes and the other lectures only, then compares both groups on the same test after a month. Experiments are best when a cause must be tested, not just described, and they only prove something when everything except the changed variable is kept the same. Together the three methods cover asking, watching and testing — and a good study picks the one whose evidence fits its question.

5. Discuss the concept of measure of tendency with example. (English answer)

Measures of central tendency identify the "centre" or typical value in a dataset, giving a sense of the average or most common values. There are three. Mean: the average — add all values and divide by their count. For five students scoring 50, 60, 70, 80 and 90: (50 + 60 + 70 + 80 + 90) ÷ 5 = 350 ÷ 5 = 70. (Note: the book's formula line misprints one score as 40; with the text's scores the sum is 350 and the mean 70, as corrected in section 5.1.1.) Median: the middle value when values are in order. The same scores are already ordered, so the middle (third) value is 70; with an even count, such as 50, 60, 70, 80, the median is the average of the two middle values, (60 + 70) ÷ 2 = 65. Mode: the most frequent value. For 50, 60, 70, 70, 90 the mode is 70 (twice); for 50, 60, 70, 70, 60, 90 there are two modes, 60 and 70.

The three are not interchangeable, and the chapter's examples show why. The mean uses every value, so one extreme score drags it; the median resists extremes, so it stays honest when one value is wild; the mode alone works for words (favourite colour, most common complaint) and alone can be multiple or absent. A complete answer therefore never reports just one: for the class above, mean 70, median 70 and mode 70 agree, which tells you the class is symmetric — but for the scattered Class B of section 5.1.2, the centre alone would hide the spread, which is why dispersion measures follow immediately after. Central tendency answers "what is typical?"; used together, the three measures answer it from three angles.

Long Questions — Urdu Answersطویل سوالات — اردو جوابات
1. Explain the role and importance of statistical models in solving real-world problems. (Urdu jawab)

شماریاتی ماڈل حقیقی دنیا کے مسائل اس لیے حل کرتے ہیں کہ وہ فیصلہ کرنے والوں کو اندازے کی بجائے آزمایا ہوا اصول دیتے ہیں۔ ان کا کردار تین حصوں میں ہے۔ پہلا، وہ ماضی کو سمجھاتے ہیں: ایک ماڈل گڈمڈ تاریخی ڈیٹا — گزشتہ کریانے کے بل، گزشتہ فروخت، گزشتہ امتحانی نتائج — لے کر اس کے اندر پیٹرن ڈھونڈتا ہے، جیسے "ہر گاہک سے آمدنی تقریباً ۴۰ روپے بڑھتی ہے۔" دوسرا، وہ مستقبل کی پیش گوئی کرتے ہیں: وہ پیٹرن ایک فارمولا بن جاتا ہے (آمدنی = ۱۰۰ + ۴۰ × گاہک) جو نئے سوالات کا جواب دیتا ہے، جیسے ۲۲ گاہکوں سے ۹۸۰ روپے کی آمدنی، دن آنے سے پہلے۔ تیسرا، وہ جانچے جا سکتے ہیں: ایک ماڈل کو ان دیکھے ڈیٹا پر جانچا جاتا ہے — ۲۸ گاہکوں پر ۱۲۲۰ روپے کی پیش گوئی بمقابلہ حقیقی ۱۲۵۰ روپے، ۳۰ روپے کی غلطی — اس لیے اس کی حدیں معلوم ہوتی ہیں، چھپی ہوئی نہیں۔

ان کی اہمیت ان تین کرداروں سے نکلتی ہے۔ منصوبہ بندی ممکن ہو جاتی ہے: دکانیں ذخیرہ منگواتی ہیں، اسکول طلبہ کو مشورہ دیتے ہیں، اور گھر بجٹ بناتے ہیں، سب اندازوں کی بجائے پیش گوئیوں سے۔ مسائل قابل بحث ہو جاتے ہیں: اس بحث کی بجائے کہ آیا چھپی ہوئی نوٹس مدد کرتی ہیں، ایک استاد دو گروہوں کا تجربہ کر کے ٹیسٹ نمبروں کا موازنہ کر سکتی ہے۔ اور غلطیاں قابل اصلاح ہو جاتی ہیں: جب پیش گوئی چوک جائے تو غلطی بتاتی ہے کہ ماڈل میں کیا کمی ہے — زیادہ ڈیٹا، کوئی گمشدہ عامل جیسے خاندان کا سائز یا خاص موقع، یا تازہ اپ ڈیٹ — اور حصہ ۵.۳.۱.۲ کا Tidbits خانہ بالکل یہی علاج درج کرتا ہے۔ اس لیے ماڈل کوئی قسمت بتانے والا نہیں ہے؛ وہ جو ہوا اس سے سیکھنے، جو ہو سکتا ہے اس کی پیش گوئی کرنے، اور یہ ماننے کا منظم طریقہ ہے کہ وہ کتنا چوک سکتا ہے۔

2. Describe the steps involved in building a basic statistical model (e.g., linear regression). Include details on data collection, model training, and evaluation. (Urdu jawab)

ایک بنیادی ماڈل بنانا، جیسے باب کی پھلوں کی دکان کی لکیری رجعت، پانچ مراحل میں ہوتا ہے۔ ۱۔ مسئلہ طے کریں۔ بتائیں کہ کس چیز کی پیش گوئی کرنی ہے اور کیا اس پر اثر ڈال سکتا ہے: گاہکوں کی تعداد سے روزانہ آمدنی کی پیش گوئی، ساتھ ہفتے کا دن یا موسم جیسے ممکنہ عوامل نوٹ کر کے۔ ۲۔ ڈیٹا اکٹھا کریں۔ تاریخی ریکارڈ جوڑوں میں جمع کریں — یہاں پانچ دن: (۱۰، ۵۰۰ روپے)، (۱۵، ۷۰۰ روپے)، (۲۰، ۹۰۰ روپے)، (۲۵، ۱۱۰۰ روپے)، (۳۰، ۱۳۰۰ روپے)۔ اچھا اکٹھا کرنا چالاک ریاضی سے زیادہ اہم ہے: ڈیٹا متعلقہ ہونا چاہیے، غلطیوں اور خلا سے صاف (حصے ۵.۲.۲–۵.۲.۳.۳)، اور جوڑوں میں، کیونکہ رجعت X اور Y کے ایک ساتھ حرکت سے سیکھتی ہے۔

۳۔ الگورتھم چنیں۔ ایک نمبر کی دوسرے نمبر سے پیش گوئی کے لیے لکیری رجعت چنیں، Y = β₀ + β₁X + ε۔ ۴۔ ماڈل کو تربیت دیں۔ تربیت کا مطلب ہے وہ لکیر ڈھونڈنا جو جمع کردہ جوڑوں پر بہترین بیٹھے۔ ٹیبل سے ہر ۵ اضافی گاہک ۲۰۰ روپے جوڑتے ہیں، اس لیے سلوپ β₁ = ۲۰۰ ÷ ۵ = ۴۰؛ ایک جوڑا رکھنے سے، ۵۰۰ = β₀ + ۴۰۰، انٹرسیپٹ β₀ = ۱۰۰ ملتا ہے۔ تربیت یافتہ ماڈل آمدنی = ۱۰۰ + ۴۰ × گاہک ہے۔ ۵۔ ماڈل کا جائزہ لیں۔ اسے نئے، ان دیکھے ڈیٹا پر جانچیں، تربیتی جوڑوں پر کبھی نہیں۔ ۲۲ گاہکوں کے لیے وہ ۹۸۰ روپے کی پیش گوئی کرتا ہے۔ ۲۸ گاہکوں اور حقیقی آمدنی ۱۲۵۰ روپے والے حقیقی چھٹے دن کے لیے وہ ۱۲۲۰ روپے کی پیش گوئی کرتا ہے، اس لیے غلطی ۱۲۲۰ − ۱۲۵۰ = −۳۰ روپے ہے۔ پیش گوئی قریب ہے لیکن کامل نہیں — اور یہ ناپا گیا فرق، نہ کہ جوش، بتاتا ہے کہ آیا ماڈل استعمال کے قابل ہے، اور آیا زیادہ ڈیٹا یا اضافی عوامل شامل کرنے چاہیے۔

3. Discuss the types of data visualizations and their uses. (Urdu jawab)

باب پانچ اقسام سکھاتا ہے، ہر ایک مختلف سوال سے ملی ہوئی۔ بار چارٹ مختلف زمروں کا موازنہ کرتے ہیں: ہر بار ایک زمرہ ہے اور اس کی اونچائی قیمت ہے، اس لیے فگر ۵.۱ ایک نظر میں مصنوعات کی فروخت کا موازنہ کرتی ہے، قدریں ۱۰۰۰ تک۔ لائن گراف وقت کے ساتھ رجحانات دکھاتے ہیں: نقطے وقت کی ترتیب میں پلاٹ کر کے جوڑے جاتے ہیں، اس لیے فگر ۵.۲ درجہ حرارت صبح ۱۰ بجے تقریباً −۵ °C سے دوپہر ۲ بجے ۲ °C کے قریب تک اٹھتا اور پھر رات ۸ بجے تک تقریباً −۹ °C تک تیزی سے گرتا دکھاتی ہے۔ ہسٹوگرام ایک ڈیٹا سیٹ کی تقسیم دکھاتے ہیں: قدریں ۶۱–۶۵ یا ۸۱–۸۵ جیسے بنز میں گروپ کی جاتی ہیں، اور بار کی اونچائی تعدد ہے، اس لیے فگر ۵.۳ ظاہر کرتی ہے کہ ریاضی کے نمبر ۶۱–۶۵ (۵ طلبہ) اور پھر ۸۱–۹۰ پر ڈھیر ہوتے ہیں — ایک شکل جسے کوئی اوسط نہیں دکھا سکتی۔ ان کی باریں چھوتی ہیں، کیونکہ پیمانہ مسلسل ہے۔

اسکیٹر پلاٹ دو متغیرات کے درمیان تعلق ظاہر کرتے ہیں: ہر نقطہ ایک مشاہدہ ہے جو دونوں قدریں رکھتا ہے، اس لیے فگر ۵.۴ پڑھائی کے گھنٹے اور امتحانی نمبر ایک ساتھ اوپر بہتے دکھاتی ہے، ساتھ ۴ گھنٹوں کے قریب ایک کم نقطہ واضح استثنا کے طور پر۔ باکس پلاٹ (وسکر پلاٹ) موازنے کے لیے تقسیم کا خلاصہ کرتے ہیں: باکس درمیانی آدھا رکھتا ہے، اندر کی لکیر وسطانیہ ہے، وسکرز عام انتہاؤں تک پہنچتی ہیں، اور دائرے آؤٹ لائرز نشان زد کرتے ہیں، اس لیے فگر ۵.۵ تین کلاسوں کا ایک پیمانے پر موازنہ کرنے دیتی ہے — کلاس ۳ وسطانیہ پر سب سے اونچی لیکن سب سے ملی جلی۔ اچھا انتخاب سوال کو چارٹ سے ملانا ہے: زمروں کا موازنہ بار سے کریں، وقت کو لکیر سے دیکھیں، تقسیم کو ہسٹوگرام سے دیکھیں، دو متغیرات کو اسکیٹر پلاٹ سے جوڑیں، اور گروہوں کا موازنہ باکس پلاٹ سے کریں۔

4. Explain data collection methods. (Urdu jawab)

باب ڈیٹا اکٹھا کرنے کے تین طریقے سکھاتا ہے، جو تحقیق کے مقصد اور درکار ڈیٹا کی قسم سے چنے جاتے ہیں۔ سروے بڑی مقدار میں ڈیٹا منظم طریقے سے اکٹھا کرتے ہیں: پہلے سے طے شدہ سوالات کا مجموعہ نمونہ گروہ سے پوچھا جاتا ہے، آن لائن فارم، ٹیلی فون کالز یا آمنے سامنے انٹرویو سے۔ اسلام آباد کی کریانہ دکان کا ۵۰ گاہکوں کا پانچ سوالات والا سروے — وہ کون سی اقسام سب سے زیادہ خریدتے ہیں، وہ کیا زیادہ چاہتے ہیں، وہ کتنی بار خریدتے ہیں، ان پر کیا اثر ڈالتا ہے، ساتھ کھلے تبصرے — مثالی مثال ہے، اور اس کے جواب ذخیرہ کرنے کے فیصلے پر ختم ہوتے ہیں۔ سروے اس وقت بہترین ہیں جب کئی لوگوں کے جواب گننے اور موازنہ کرنے ہوں۔

مشاہدات مضامین کو ان کے قدرتی ماحول میں بغیر مداخلت کے دیکھ کر ڈیٹا اکٹھا کرتے ہیں۔ وہ ریستوران جو ایک ہفتے تک دیکھتا ہے کہ دوپہر کے کھانے میں کون سی میزیں پہلے بھرتی ہیں وہ کسی سے پوچھے بغیر بیٹھنے کی ترجیح کی سچائی سیکھ لیتا ہے — اور آرام اور آمد و رفت کے لیے اپنی نشستیں دوبارہ ترتیب دیتا ہے۔ مشاہدہ اس وقت بہترین ہے جب پوچھنا رویہ بدل دے یا جب لوگ درست رپورٹ نہ کر سکیں۔ تجربات ایک یا زیادہ متغیرات کو تبدیل کر کے دوسرے پر ان کا اثر ڈھونڈتے ہیں: ٹیچر ایک گروہ کو چھپی ہوئی نوٹس دیتی ہے اور دوسرے کو صرف لیکچرز، پھر ایک مہینے بعد دونوں گروہوں کا وہی ٹیسٹ لے کر موازنہ کرتی ہے۔ تجربات اس وقت بہترین ہیں جب کسی سبب کو جانچنا ہو، نہ کہ صرف بیان کرنا ہو، اور وہ صرف اس وقت کچھ ثابت کرتے ہیں جب بدلے گئے متغیر کے علاوہ سب کچھ ایک جیسا رکھا جائے۔ یہ تینوں طریقے مل کر پوچھنا، دیکھنا اور جانچنا پورا کرتے ہیں — اور ایک اچھا مطالعہ وہی چنتا ہے جس کا ثبوت اس کے سوال سے میل کھائے۔

5. Discuss the concept of measure of tendency with example. (Urdu jawab)

مرکزی رجحان کی پیمائشیں ڈیٹا سیٹ میں "مرکز" یا عام قیمت کی شناخت کرتی ہیں، اوسط یا سب سے عام قیمتوں کا احساس دیتی ہیں۔ تین ہیں۔ اوسط: اوسط — تمام قیمتیں جمع کریں اور ان کی تعداد پر تقسیم کریں۔ پانچ طلبہ کے لیے جنہوں نے ۵۰، ۶۰، ۷۰، ۸۰ اور ۹۰ نمبر لیے: (۵۰ + ۶۰ + ۷۰ + ۸۰ + ۹۰) ÷ ۵ = ۳۵۰ ÷ ۵ = ۷۰۔ (نوٹ: کتاب کی فارمولا سطر ایک نمبر ۴۰ غلط چھاپتی ہے؛ متن کے نمبروں سے مجموعہ ۳۵۰ اور اوسط ۷۰ ہے، جیسا کہ حصہ ۵.۱.۱ میں درست کیا گیا ہے۔) وسطانیہ: ترتیب میں درمیانی قیمت۔ وہی نمبر پہلے سے ترتیب میں ہیں، اس لیے درمیانی (تیسری) قیمت ۷۰ ہے؛ جفت تعداد میں، جیسے ۵۰، ۶۰، ۷۰، ۸۰، وسطانیہ دو درمیانی قیمتوں کا اوسط ہے، (۶۰ + ۷۰) ÷ ۲ = ۶۵۔ کثیر الوقوع قدر: سب سے زیادہ بار آنے والی قیمت۔ ۵۰، ۶۰، ۷۰، ۷۰، ۹۰ کے لیے کثیر الوقوع قدر ۷۰ ہے (دو بار)؛ ۵۰، ۶۰، ۷۰، ۷۰، ۶۰، ۹۰ کے لیے دو کثیر الوقوع قدریں ہیں، ۶۰ اور ۷۰۔

یہ تینوں ایک دوسرے کی جگہ نہیں لے سکتیں، اور باب کی مثالیں دکھاتی ہیں کہ کیوں۔ اوسط ہر قیمت استعمال کرتی ہے، اس لیے ایک انتہائی نمبر اسے کھینچ لیتا ہے؛ وسطانیہ انتہاؤں کے خلاف مزاحمت کرتا ہے، اس لیے جب ایک قیمت بے قابو ہو تو وہ ایماندار رہتا ہے؛ کثیر الوقوع قدر اکیلی الفاظ کے لیے کام کرتی ہے (پسندیدہ رنگ، سب سے عام شکایت) اور اکیلی کئی ہو سکتی ہے یا موجود ہی نہیں ہو سکتی۔ اس لیے مکمل جواب کبھی صرف ایک نہیں بتاتا: اوپر والی کلاس کے لیے اوسط ۷۰، وسطانیہ ۷۰ اور کثیر الوقوع قدر ۷۰ متفق ہیں، جو بتاتا ہے کہ کلاس متوازن ہے — لیکن حصہ ۵.۱.۲ کی بکھری ہوئی کلاس B کے لیے اکیلا مرکز پھیلاؤ چھپا دے گا، اسی لیے انتشار کی پیمائشیں فوراً بعد آتی ہیں۔ مرکزی رجحان "عام کیا ہے؟" کا جواب دیتا ہے؛ ایک ساتھ استعمال ہونے پر تینوں پیمائشیں اس کا جواب تین زاویوں سے دیتی ہیں۔

📌 باب کا خلاصہ اور رہنمائی — اس باب میں کیا ہے؟
ENGLISH SUMMARY

اس chapter میں تم نے سیکھا کے data کو پہلے سمجھنا, پھر صاف کرنا, پھر اس سے سیکھنا اور آخر میں اسے دکھانا ہوتا ہے. Centre کے لیے mean, median اور mode; phailao ke liye variance aur standard deviation (Class A: variance 12.56, SD ≈ 3.55; Class B: variance 454, SD ≈ 21.31); imkaan کے لیے probability; جمع کرنے کے لیے survey, observation اور experiment; صاف کرنے کے لیے cleaning, transformation اور missing-data کے تین طریقے; paish goi کے لیے linear regression (Earnings = 100 + 40 × Customers), logistic regression (ہاں/naheen کا امکان 0–1) اور K-means clustering (K = clusters کی تعداد); اور dikhane کے لیے bar chart, line graph, histogram, scatterplot اور boxplot, جنہیں Excel یا Google Sheets میں پانچ steps میں بنایا جاتا ہے.

Revision guidance: exam سے پہلے چار چیزیں پکی کرو — (1) mean/median/mode کے فرق اور jorri تعداد والا median, (2) variance کا پورا حساب (Class A/B) اور SD کا جذر, (3) regression کی line اور 22 گاہک → 980 روپے والی پیش گوئی, (4) پانچ charts میں سے ہر ایک کس سوال کا جواب دیتا ہے. ان چاروں پر عبور ہو تو exercise کے MCQs اور short/long questions آساں لگیں گے. کتاب کی غلطیاں (mean میں 40, SD میں 456/21.26, MCQ 6 کی key, 5.2.2 numbering) بھی یاد رکھو — examiner اکثر وہی جگہ پوچھتا ہے.

اردو خلاصہ

اس باب میں تم نے سیکھا کہ ڈیٹا کو پہلے سمجھنا، پھر صاف کرنا، پھر اس سے سیکھنا اور آخر میں اسے دکھانا ہوتا ہے۔ مرکز کے لیے اوسط، وسطانیہ اور کثیر الوقوع قدر؛ پھیلاؤ کے لیے تغیر اور معیاری انحراف (کلاس A: تغیر ۱۲.۵۶، معیاری انحراف ≈ ۳.۵۵؛ کلاس B: تغیر ۴۵۴، معیاری انحراف ≈ ۲۱.۳۱)؛ امکان کے لیے احتمال؛ جمع کرنے کے لیے سروے، مشاہدہ اور تجربہ؛ صاف کرنے کے لیے صفائی، تبدیلی اور گمشدہ ڈیٹا کے تین طریقے؛ پیش گوئی کے لیے لکیری رجعت (آمدنی = ۱۰۰ + ۴۰ × گاہک)، لاجسٹک رجعت (ہاں/نہیں کا امکان ۰–۱) اور K-means کلسٹرنگ (K = کلسٹروں کی تعداد)؛ اور دکھانے کے لیے بار چارٹ، لائن گراف، ہسٹوگرام، اسکیٹر پلاٹ اور باکس پلاٹ، جنہیں ایکسل یا گوگل شیٹس میں پانچ مراحل میں بنایا جاتا ہے۔

دہرائی کی رہنمائی: امتحان سے پہلے چار چیزیں پکی کرو — (۱) اوسط/وسطانیہ/کثیر الوقوع قدر کا فرق اور جفت تعداد والا وسطانیہ، (۲) تغیر کا پورا حساب (کلاس A/B) اور معیاری انحراف کا جذر، (۳) رجعت کی لکیر اور ۲۲ گاہک → ۹۸۰ روپے والی پیش گوئی، (۴) پانچ چارٹس میں سے ہر ایک کس سوال کا جواب دیتا ہے۔ ان چاروں پر عبور ہو تو ایکسرسائز کے MCQs اور مختصر/طویل سوالات آسان لگیں گے۔ کتاب کی غلطیاں (اوسط میں ۴۰، معیاری انحراف میں ۴۵۶/۲۱.۲۶، MCQ ۶ کی کلید، ۵.۲.۲ نمبرنگ) بھی یاد رکھو — ممتحن اکثر وہی جگہ پوچھتا ہے۔

🎯 مزید MCQs اور Tests کے لیے

Chapter-wise tests, fresh random papers اور instant score کے لیے PunjabTest.com کا میں test section دیکھو:

PunjabTest.com — Tests →

PunjabTest.com — Complete Guide Book • FSc Part 1 Computer Science, Chapter 5 (New Book, Session 2026–27) • English + Urdu

← Chapter 4Chapter 6 →