These are the solved end-of-unit exercises for Unit 5, Data Analytics, from the PECTAA Computer Science and Entrepreneurship-11 textbook used by BISE Rawalpindi, Lahore and the other Punjab boards. Every answer is written from the text of the unit, for the 1st Year (HSSC Part I) Annual Examination 2027. The textbook calls its chapters “units”.
This unit covers basic statistics (mean, median, mode, variance, standard deviation and probability), data collection and preparation, statistical models, and data visualisation with bar charts, line graphs, histograms and scatterplots in Excel or Google Sheets.
| Unit | 5: Data Analytics |
|---|---|
| Class | 1st Year (HSSC Part I), Punjab boards |
| MCQs answered | 8 |
| Questions solved | 9 |
Exercise questions deleted in the ALP Smart Syllabus 2027
Under PECTAA’s ALP Smart Syllabus 2027 for Computer Science and Entrepreneurship-11, the following content of Unit 5 is not part of the 2027 annual exam: Topics 5.3 Building Statistical Models (linear regression, logistic regression, clustering, evaluating models) and 5.4.1.5 Boxplots · MCQs 1, 4, 5, 7 and 8 · Short Questions 1 and 2 · Long Questions 1 and 2. These questions are marked below and still solved, so you can practise them if you want.
Multiple Choice Questions
| Q. | Correct option | Reason from the textbook |
|---|---|---|
| 1 (ALP deleted) | (a) Linear Regression | Linear regression is the basic statistical model explained in the unit. |
| 2 | (b) Collecting and analyzing data systematically | Experiments and data collection are planned and analysed in a systematic way. |
| 3 | (d) All of the above | MS Excel, Python (Matplotlib) and Tableau are all named as visualisation tools. |
| 4 (ALP deleted) | (b) The change in the dependent variable for a unit change in the independent variable | The slope β1 shows how much Y changes for each unit change in X (Rs. 40 per customer in the book’s example). |
| 5 (ALP deleted) | (a) Predicting house prices | Statistical models are used to predict future values from past data. |
| 6 | (c) Making data more complex | Visualisation makes data easier, not harder, to understand. Note: the answer key printed at the back of the book gives (b), but “communicating insights” is a benefit of visualisation, so (c) matches the chapter text. Check with your teacher. |
| 7 (ALP deleted) | (b) To group data into clusters based on similarity | K-means puts students with similar scores into the same group. |
| 8 (ALP deleted) | (b) Number of clusters to be formed | In K-means you first decide how many groups (K) you want. (The printed key at the back of the book misses this question.) |
Short Questions
Q.1 What is the importance of building statistical models in real-world applications? (Deleted in ALP Smart Syllabus 2027)
- A statistical model uses data to make sense of the real world and to predict what will happen in the future.
- Example: from past grocery bills, a family can estimate next month’s grocery expenses. A fruit-stall owner can predict daily earnings from the number of customers.
- Predictions help people and businesses plan, set budgets and make better decisions, for example predicting house prices or whether a student will pass.
Q.2 Name one basic statistical model used for predicting outcomes and explain its purpose. (Deleted in ALP Smart Syllabus 2027)
- Linear regression.
- Its purpose is to find the relationship between two variables and use one (the independent variable X) to predict the other (the dependent variable Y).
- Formula: Y = β0 + β1X + ε, where β0 is the intercept, β1 the slope and ε the error.
- Example: Earnings = 100 + 40 × Customers. With 22 customers, the predicted earnings are 100 + 880 = Rs. 980.
Q.3 List two types of data visualizations and describe when you would use each.
- Bar chart: used to compare different categories. Each bar is a category, and its height shows the value. Example: comparing the sales of different products in a shop.
- Line graph: used to show a trend over time. Points are joined by a line so rises and falls are easy to see. Example: temperature recorded at different times of the day or over a week.
(Other types: a histogram shows how often values fall in each range, such as exam score bands, and a scatterplot shows the relationship between two variables, such as hours studied and marks.)
Q.4 How does visualizing data help in understanding descriptive statistics?
- Descriptive statistics such as the mean, median, mode, variance and standard deviation summarise data in numbers. A chart shows the same facts at a glance.
- A histogram shows where most values lie (the centre) and how widely they are spread, so a high or low spread is visible at once.
- A bar chart or line graph makes the largest and smallest values, patterns and trends easy to spot.
- Unusual values (outliers) that would change the mean become visible.
- Insights can be communicated quickly to people who do not read tables of numbers easily.
Long Questions
Q.1 Explain the role and importance of statistical models in solving real-world problems. (Deleted in ALP Smart Syllabus 2027)
Statistical modelling is used to analyse data, understand real-world situations and predict future outcomes.
Role:
- Prediction: linear regression predicts a number. Example: a fruit stall predicts earnings from the number of customers.
- Yes/no decisions: logistic regression gives the probability (0 to 1) of an outcome, for example whether a student will pass based on hours of study.
- Grouping: clustering (K-means) groups similar items, for example students who are strong in Maths and students who are strong in English.
- Drawing conclusions: interpreting the model’s output, for example if study hours strongly affect scores, students should study more.
Importance:
- It helps families, shops and organisations plan budgets, stock and resources.
- Decisions are based on evidence from data rather than guesswork.
- Models are checked with performance metrics (error and accuracy), so their reliability is known.
- Models must be built fairly and without bias, for example when deciding loans, and personal data must be kept private and secure.
Q.2 Describe the steps involved in building a basic statistical model (e.g., linear regression). Include details on data collection, model training, and evaluation. (Deleted in ALP Smart Syllabus 2027)
Steps of model development: (1) define the problem, (2) collect data, (3) choose an algorithm, (4) train the model, (5) evaluate the model. The fruit-stall example from the book shows each step.
Step 1: Define the problem. Predict daily earnings (Y, the dependent variable) from the number of customers (X, the independent variable).
Step 2: Collect data. Record five days of history:
| Customers (X) | Earnings in Rs. (Y) |
|---|---|
| 10 | 500 |
| 15 | 700 |
| 20 | 900 |
| 25 | 1,100 |
| 30 | 1,300 |
Step 3: Choose the algorithm. Simple linear regression: Y = β0 + β1X + ε
Step 4: Train the model (find the slope and intercept).
- Every 5 extra customers add Rs. 200, so the slope β1 = 200 ÷ 5 = 40 rupees per customer.
- Use one data point (10 customers, Rs. 500): 500 = β0 + 40 × 10, so β0 = 500 − 400 = 100.
- Model: Earnings = 100 + 40 × Customers
- Prediction for 22 customers: 100 + 40 × 22 = 100 + 880 = Rs. 980.
Step 5: Evaluate the model with new data. On day 6 there were 28 customers and actual earnings of Rs. 1,250.
- Predicted = 100 + 40 × 28 = 100 + 1,120 = Rs. 1,220
- Error = predicted − actual = 1,220 − 1,250 = −Rs. 30
- The prediction is close but not perfect. The model can be improved with more data points, more factors and regular updates.
Q.3 Discuss the types of data visualizations and their uses.
Data visualisation shows data as graphs or charts so that patterns, trends and insights can be seen quickly.
| Type | What it shows | Example of use |
|---|---|---|
| Bar chart | Compares categories. Bar height shows the value. | Sales of Product 1 and Product 2 in a store. |
| Line graph | Trends over time, with points joined by a line. | Temperature from 10 am to 8 pm. |
| Histogram | Distribution of data grouped into bins (ranges). | How many students scored 50-55, 56-60 … 96-100 in a Maths exam. |
| Scatterplot | Relationship between two variables. Each point is one observation. | Hours studied compared with exam scores. |
| Boxplot (ALP deleted topic) | Median, quartiles and outliers of a dataset. | Comparing exam scores of three classes. |
Tools: MS Excel and Google Sheets (enter the data, select it, choose Insert and a chart type, then add axis labels), as well as Python with Matplotlib and Tableau.
Q.4 Explain data collection methods.
Data collection is gathering the information needed for a purpose. The method depends on the research objective and the type of data required.
- Surveys: a fixed set of questions asked to a sample group through online forms, telephone calls or face-to-face interviews. They collect large amounts of structured data. Example: a grocery store in Islamabad gives a five-question survey to 50 customers to learn which products to stock.
- Observations: watching subjects in their natural setting without interfering. Example: a restaurant staff member notes which tables customers choose at lunchtime for a week, then rearranges the seating.
- Experiments: changing one variable to see its effect on another under controlled conditions. Example: a teacher gives printed notes to one group and only lectures to another, and compares their test results after a month.
After collection, the data is prepared: cleaned (wrong names, missing values and duplicates fixed), transformed into a useful format, and missing values handled by imputation, flagging or removal.
Q.5 Discuss the concept of measure of tendency with example.
Measures of central tendency find the centre, or typical value, of a dataset. The three measures are the mean, median and mode.
- Mean: the average. Add all values and divide by the number of values. Example: scores 50, 60, 70, 80, 90. Mean = 350 ÷ 5 = 70.
- Median: the middle value after arranging the data in order. For 50, 60, 70, 80, 90 the median is 70. With an even number of values, take the average of the two middle values. For 50, 60, 70, 80 the median is (60 + 70) ÷ 2 = 65.
- Mode: the value that occurs most often. For 50, 60, 70, 70, 90 the mode is 70. A dataset can have more than one mode. For 50, 60, 70, 70, 60, 90 the modes are 60 and 70.
Worked example with the book’s sample data: 3, 5, 8, 8, 10, 12, 15, 15, 16, 18
- Mean = 110 ÷ 10 = 11
- Median: the two middle values (5th and 6th) are 10 and 12, so the median = (10 + 12) ÷ 2 = 11
- Mode: 8 and 15 each appear twice, so the modes are 8 and 15
More for 1st Year Computer Science
- All units: 1st Year Computer Science exercise solutions 2027
- 11th Class pairing scheme, model papers and ALP deleted topics
The exercise questions are from the PECTAA Computer Science and Entrepreneurship-11 textbook. The deleted list follows the PECTAA ALP Smart Syllabus 2027. Please confirm all dates and figures on the official website: pectaa.edu.pk
Need help with 1st Year Computer Science? Join our live online classes for Intermediate (Punjab and Federal Board). Book a free demo class.

Ask a question about this topic