Punjab Board · New syllabus 2026

10th Class Computer Chapter 6 Notes

Introduction to Artificial Intelligence (AI) and Machine Learning (ML)

Definition

Artificial Intelligence (AI) is the broad field of building systems that can perform tasks normally requiring human intelligence — such as understanding language, recognizing images, or making decisions.


Machine Learning (ML) is a specific approach/subset within AI, where a system learns patterns directly from data and improves its performance over time, rather than being explicitly programmed with fixed rules for every situation.


The difference between AI and ML: AI is the overall goal of making machines act intelligently (specifically trying to show human-like behaviour, like speaking, seeing, or understanding), while ML is one particular method used to achieve that goal — every ML system is a form of AI, but not all AI is built using ML (some older AI used hand-coded rules instead of learning from data).

Definition

Examples of AI in everyday use: a smart assistant like Google Assistant (understands and responds to spoken requests) and a recommendation system like the one an app uses to recommend videos based on ML analysis of past viewing behaviour.


A chatbot on a service like JazzCash is an example of AI being used for automated customer support/interaction.


One real-life example of AI used in Pakistan: AI-powered chatbots used by telecom and banking apps for customer service, or AI-based traffic/agriculture monitoring systems.

Definition

AI is mostly used for automating tasks that would otherwise need human judgement or effort — recognizing patterns, making predictions, understanding language, and assisting or replacing repetitive human decision-making.

Definition

In supervised learning, the training data is labelled — each example includes both the input and the correct, known output/answer, and the model learns by comparing its predictions against these known correct answers to gradually improve.


In unsupervised learning, the data used is unlabelled — there's no known correct answer provided; instead the model looks for patterns, structures, or groupings within the data on its own, without being told what the 'right' answer looks like.


An example of unsupervised learning: grouping (clustering) students with similar interests together, without being told in advance what the groups should be — the algorithm discovers natural groupings from the data itself.

Example 1 — how supervised learning works

Explain how supervised learning works, with an example.

  1. A dataset is prepared where each example has both input features and the correct known output — e.g. photos of animals, each already labelled 'cat' or 'dog'.
  2. The model is trained on this labelled data, adjusting itself to better match its predictions to the known correct labels.
  3. Once trained, the model can predict the label for new, previously unseen examples (e.g. a new photo it hasn't seen before).

Answer: Supervised learning trains a model on labelled data (input known correct output) so it can later predict outputs for new inputs

Definition

Linear regression predicts future/continuous values based on a straight-line relationship between two variables — e.g. predicting a house's price based on its size, assuming a roughly linear trend.


A decision tree uses a tree-like model of yes/no (or true/false) questions to arrive at a decision, branching at each question based on the answer, until reaching a final outcome at a 'leaf' of the tree.


Clustering algorithms are used to group similar items together (like grouping students with similar interests) without pre-labelled categories — an unsupervised learning technique.

Definition

A confusion matrix is a table that summarizes a classification model's predictions against the actual known outcomes, breaking results into: true positives (correctly predicted positive), true negatives (correctly predicted negative), false positives (incorrectly predicted positive), and false negatives (incorrectly predicted negative).


Accuracy measures the overall proportion of predictions the model got right (both positive and negative), calculated as (true positives true negatives) divided by the total number of predictions.


Precision measures, out of all the cases the model predicted as positive, what proportion were actually positive — calculated as true positives divided by (true positives false positives). High precision means the model rarely raises a false alarm when it predicts 'positive'.

Example 2 — building a confusion matrix and finding accuracy

A model predicts whether students will pass () or fail (). Suppose the results are: students correctly predicted to pass, correctly predicted to fail, incorrectly predicted to pass (who actually failed), and incorrectly predicted to fail (who actually passed). Fill the confusion matrix and calculate accuracy.

  1. True positives (predicted pass, actually passed) .
  2. True negatives (predicted fail, actually failed) .
  3. False positives (predicted pass, actually failed) .
  4. False negatives (predicted fail, actually passed) .
  5. Check total: — matches the given number of students.
  6. Accuracy .

Answer: Confusion matrix: TP, TN, FP, FN; Accuracy

Definition

Bias in AI is a systematic unfairness in a model's predictions, usually arising because the training data itself was unrepresentative or skewed — e.g. a hiring AI trained mostly on past resumes from one gender might unfairly favour that gender's applicants going forward, since it learned patterns from biased historical data rather than fair, balanced examples.


Two best practices for protecting user privacy when building AI systems: collecting and storing only the minimum data actually necessary for the task, and anonymizing or securely encrypting personal data wherever possible.


If an AI-powered system makes a wrong decision, responsibility is generally shared between the people and organizations involved in creating, training, deploying, and overseeing it — the developers (for flaws in design/training data), the deploying organization (for how and where it's used), and sometimes regulators (for insufficient oversight) — since an AI system itself has no legal or moral accountability of its own; the humans behind it remain responsible.

Definition

Machine Learning does always need data to work, since it's precisely the process of learning patterns from data — without training data, an ML model has nothing to learn from and cannot make useful predictions.

Definition

Businesses can use AI to automate repetitive tasks, analyze large volumes of customer data for insights, personalize recommendations, and improve customer service through chatbots and automated support.


Customer analysis is the process of studying customer data (purchase history, browsing behaviour, preferences) to understand their needs and behaviour patterns; businesses use AI for it by applying ML algorithms to this data to predict what customers might want next, personalize marketing, and improve retention.


An essential skill for a data analyst is being able to interpret data and statistics accurately, translating raw numbers and patterns into meaningful, actionable insights.

Quick Recap

  • ●AI: broad goal of human-like intelligent behaviour. ML: a subset of AI, learns patterns from data rather than fixed rules
  • ●Supervised learning: labelled data (known correct answers) trains to predict new labels. Unsupervised learning: unlabelled data finds patterns/groupings (e.g. clustering)
  • ●Algorithms: linear regression (straight-line prediction), decision tree (yes/no branching), clustering (grouping similar items)
  • ●Confusion matrix: TP, TN, FP, FN. Accuracy . Precision
  • ●Bias in AI: from unrepresentative training data unfair predictions. Privacy: minimize data collected, anonymize/encrypt
  • ●Responsibility for AI mistakes lies with the humans/organizations behind it, not the AI itself; ML always needs data to learn from
  • ●AI in business: automation, customer analysis, personalized recommendations, chatbots for support

Keep going

More 10th Class Computer notes

All 10th Class Computer chapters