Artificial Intelligence (AI) (Cambridge (CIE) A Level Computer Science): Flashcards

Exam code: 9618

1/111

0Still learning

Know0

  • Define graph.

Cards in this collection (111)

  • Define graph.

    A graph is a set of vertices or nodes connected by edges or arcs.

  • What are graphs used for in AI?

    To model relationships, networks and decision-making problems.

  • In AI, graphs are used to model relationships, networks and                 -making problems.

    In AI, graphs are used to model relationships, networks and decision-making problems.

  • Name three things a graph can represent in AI.

    Routes between cities for pathfinding, connections in a neural network, and state transitions in decision trees or planning.

  • Define directed graph.

    A graph where edges have a direction, so connections go from one node to another and cannot be traversed in reverse unless another directed edge exists.

  • True or False?

    In a directed graph, an edge from B to D means you can also travel from D to B.

    False.

    Connections cannot be traversed in reverse unless another directed edge exists.

  • Define undirected graph.

    A graph where edges have no direction, so connections go both ways.

  • Define weighted graph.

    A graph where each edge has a weight, representing costs or heuristics.

  • What can the weight on an edge represent?

    Cost, distance, time, risk or probability.

  • Name the two ways a graph can be represented.

    An adjacency matrix and an adjacency list.

  • When is an adjacency matrix ideal?

    For dense graphs and fast lookup.

  • When is an adjacency list better?

    For sparse graphs. It is often used in AI search.

  • What does a symmetric adjacency matrix confirm?

    That the graph is undirected.

  • True or False?

    A symmetric adjacency matrix means the graph is directed.

    False.

    A symmetric matrix confirms the graph is undirected. A non-symmetric matrix reflects the one-way nature of a directed graph.

  • In an unweighted adjacency matrix, what do 1 and 0 mean?

    A 1 indicates a connection exists between two nodes. A 0 means there is no direct connection.

  • In a weighted adjacency matrix, what is used when no connection exists?

    Infinity.

  • In a weighted adjacency matrix, no connection between two nodes is shown as         .

    In a weighted adjacency matrix, no connection between two nodes is shown as infinity.

  • Name two AI uses of undirected, unweighted graphs.

    Exploring environments with equal-cost connections, clustering in machine learning, and social network analysis where connections are mutual.

  • Which search algorithms use undirected, unweighted graphs?

    Depth-first and breadth-first search, and graph traversal algorithms that explore all reachable nodes.

  • Name two AI uses of directed, unweighted graphs.

    Search algorithms such as A, BFS and DFS; expert systems and rule engines; planning and scheduling; and navigation* with one-way streets.

  • Name two AI uses of undirected, weighted graphs.

    Pathfinding with A or Dijkstra, clustering and similarity graphs, recommendation engines, and robotics and navigation*.

  • Name two AI uses of directed, weighted graphs.

    A* and Dijkstra, route planning in robotics, search algorithms tracking transitions between states, reinforcement learning, and game AI with terrain costs.

  • Why are weights crucial in AI?

    They decide the best route or option when multiple paths are available.

  • Name three AI problem spaces that graphs can represent.

    Game boards, map-based navigation, and resource allocation networks.

  • Define optimisation problem.

    An optimisation problem involves finding the most efficient solution to a problem: minimising cost, time or resource usage, or maximising output, efficiency or value.

  • Name three examples of optimisation problems.

    Finding the shortest route between two locations, minimising resource usage, creating efficient timetables, and scheduling tasks and staff shifts.

  • Define Dijkstra's shortest path algorithm.

    An optimisation algorithm that calculates the shortest path from a starting node to all other nodes in a weighted graph.

  • True or False?

    Dijkstra's algorithm only finds the path to one destination node.

    False.

    It calculates the shortest path from the start node to all other nodes in the graph.

  • How does Dijkstra's compare with breadth-first search?

    Dijkstra's includes edge weights and ensures the lowest total cost to reach each destination node.

  • What is a graph made up of?

    Nodes (vertices) and edges (arcs), where each edge has a weight.

  • What can an edge weight represent in Dijkstra's algorithm?

    Time, distance or cost.

  • What does Dijkstra's algorithm guarantee?

    The optimal path from the start node to every other node in the graph.

  • What is the first step of Dijkstra's algorithm?

    Set the start node's path weight to 0 and all other path weights to infinity.

  • At the start of Dijkstra's, all path weights except the start node are set to                 .

    At the start of Dijkstra's, all path weights except the start node are set to infinity.

  • What do you do when you visit a node?

    Update all neighbouring nodes' path weights to the distance from that node plus the node's own path weight.

  • How do you choose the next node to visit?

    Choose the unvisited node with the lowest path weight.

  • When is a neighbouring node's weight updated?

    Only if the old path weight is bigger than the new path weight, that is when the new path is shorter.

  • True or False?

    A node's weight is updated every time it is reached.

    False.

    It is updated only if the new path is shorter than the current path weight.

  • When does Dijkstra's algorithm finish?

    When all nodes have been visited.

  • How do you find the actual path at the end?

    By back tracking from the destination node.

  • In the Dijkstra pseudocode, which structures are declared?

    previousNode as a dictionary, and visited and unvisited as lists.

  • What does the Dijkstra pseudocode do first with the distances?

    It sets distance[node] to infinity for every node, then sets distance[start] to 0.

  • Which condition controls the main loop in the Dijkstra pseudocode?

    WHILE LENGTH(unvisited) > 0

  • How does the pseudocode find the next node to process?

    It loops through unvisited and keeps the node with the smallest distance in min.

  • What happens when min equals the goal?

    The algorithm exits the WHILE loop.

  • How is a neighbour's distance updated in the pseudocode?

    alt is set to distance[min] + cost. If alt < distance[neighbour], then distance[neighbour] is set to alt.

  • What is recorded alongside an updated distance, and why?

    previousNode[neighbour] is set to min, so that the path can be rebuilt at the end.

  • After processing, min is removed from unvisited and added to               .

    After processing, min is removed from unvisited and added to visited.

  • How is the final path built in the Dijkstra pseudocode?

    Starting at the goal, follow previousNode back to the start, adding each node to path, then reverse the path.

  • Define the A\* algorithm.

    A is a pathfinding algorithm that builds on Dijkstra's algorithm, introducing a heuristic function* to improve efficiency.

  • What is A* used for?

    To find the shortest path from a starting node to a goal node in a graph.

  • What does Dijkstra's consider that A* extends?

    Dijkstra's considers only the actual cost from the start node. A also estimates the remaining distance to the goal*.

  • Why is A* more efficient than Dijkstra's?

    It is more goal-oriented, which avoids inefficient detours.

  • Define the heuristic function h(x).

    A function that estimates the straight-line (Euclidean) distance from the current node to the goal.

  • State the A* formula.

    f(x) = g(x) + h(x)

  • In the A* formula, what is g(x)?

    The actual cost from the start node to the current node.

  • In the A* formula, what is h(x)?

    The heuristic estimate to the goal node.

  • In the A* formula, what is f(x)?

    The total estimated cost of the cheapest solution through node x.

  • Which node does A* choose next?

    The node with the lowest f(x) value, so it explores paths that are both cheap and move closer to the goal.

  • What must be true of the heuristic function?

    It should never overestimate the true cost to the goal.

  • The heuristic should never                          the true cost to the goal.

    The heuristic should never overestimate the true cost to the goal.

  • Why must the heuristic not overestimate?

    This ensures A remains optimally efficient*.

  • What is the effect of a heuristic closer to the true cost?

    The fewer nodes A* needs to explore.

  • What may an increasing h(x) indicate?

    That the algorithm is moving away from the goal, which helps it backtrack or choose a better path.

  • Is Dijkstra's algorithm goal-aware?

    No. A is* goal-aware; Dijkstra's is not.

  • Compare the cost functions of Dijkstra's and A*.

    Dijkstra's uses g(x). A uses g(x) + h(x)*.

  • True or False?

    A* uses the same cost function as Dijkstra's.

    False.

    Dijkstra's uses g(x) only. A uses g(x) + h(x)*.

  • Which is faster, and why?

    A, because it moves more directly toward the goal. Dijkstra's is slower because it explores more*.

  • True or False?

    A* explores more nodes than Dijkstra's.

    False.

    Dijkstra's explores more. A* is more direct toward the goal.

  • When is Dijkstra's the better choice?

    When you need a full shortest path map to all nodes.

  • When is A* the better choice?

    For the fastest route to a specific destination.

  • Does Dijkstra's use a heuristic?

    No. A uses one to estimate the distance to the goal*; Dijkstra's uses none.

  • In the A* pseudocode, which two values are initialised to infinity?

    g[node] and f[node], for every node in the graph.

  • In the A* pseudocode, what are g[start] and f[start] set to?

    g[start] is set to 0, and f[start] is set to h[start].

  • What is the openSet in the A* pseudocode?

    The list of nodes still to be considered. It begins containing only the start node.

  • How does the A* pseudocode choose the current node?

    It finds the node in openSet with the lowest f value.

  • How is a neighbour's g value updated in A*?

    tentativeG is set to g[min] + cost(min, neighbour). If tentativeG < g[neighbour], then g[neighbour] is updated to tentativeG.

  • In the A pseudocode, h[node] is your                   * table.

    In the A pseudocode, h[node] is your heuristic* table.

  • Define machine learning.

    Machine learning is a type of AI that allows computers to learn patterns from data and improve performance without being explicitly programmed.

  • What do machine learning systems do instead of following fixed rules?

    They analyse large amounts of data, identify patterns or trends, and make predictions or decisions based on that data.

  • Name three uses of machine learning.

    Spam filters, voice assistants, recommendation systems and fraud detection.

  • Define artificial neural network (ANN).

    An algorithm inspired by the structure of the human brain, made up of layers of nodes (neurons) connected by weighted links.

  • What does each neuron in an ANN do?

    It receives input, processes it, and passes the result to the next layer.

  • How does a neural network learn?

    It adjusts the weights based on errors in its output, using algorithms such as backpropagation.

  • Name three reasons ANNs are powerful.

    They learn from experience even with complex or unstructured data, they improve accuracy with more data and training, and they can solve problems too complex for rule-based programming.

  • Define deep learning.

    Deep learning is a subfield of machine learning that uses deep, multi-layered neural networks.

  • True or False?

    Deep learning is a separate field from machine learning.

    False.

    Deep learning is a subfield of machine learning.

  • What does adding more layers to a network allow?

    The more complex the patterns the network can learn.

  • What is deep learning especially effective at?

    Learning abstract features in images, text, audio and video.

  • Define reinforcement learning.

    A type of machine learning where an agent learns by interacting with an environment, receiving rewards for good actions and penalties for poor ones.

  • Reinforcement learning agents receive rewards for good actions and                    for poor ones.

    Reinforcement learning agents receive rewards for good actions and penalties for poor ones.

  • Define policy in reinforcement learning.

    The optimal strategy an agent learns over time in order to maximise rewards.

  • Name three uses of reinforcement learning.

    Robotics, self-driving cars, game-playing AI and industrial automation.

  • Define supervised learning.

    Supervised learning is when the algorithm is trained on a labelled dataset, where the input data has known outputs.

  • What is the goal of supervised learning?

    To learn a function that maps inputs to the correct output, so the trained model can make predictions on unseen data.

  • Give an example of supervised learning.

    Input is email text and output is spam or not spam. The model learns from thousands of pre-labelled emails.

  • What two things is supervised learning used for?

    Classification, such as face recognition or spam detection, and regression, such as predicting house prices.

  • Define unsupervised learning.

    Unsupervised learning is when the algorithm is given unlabelled data and must find patterns or groupings on its own.

  • True or False?

    Unsupervised learning is trained on data with known correct answers.

    False.

    It uses unlabelled data. There are no correct answers, and the system explores the data structure itself.

  • What does unsupervised learning identify?

    Clusters, trends or anomalies, without any guidance.

  • What two things is unsupervised learning used for?

    Clustering, such as customer segmentation or social network analysis, and dimensionality reduction, such as simplifying complex data.

  • Define back propagation.

    A training method used in artificial neural networks to improve accuracy by adjusting the weights of connections.

  • Back propagation is a key part of the                      learning process.

    Back propagation is a key part of the supervised learning process.

  • Name the four steps of back propagation.

    Forward pass, error calculation, backward pass, and weight adjustment.

  • What happens in the forward pass?

    Input data passes through the network layer by layer, and the network produces an output, which is its prediction.

  • What is the error in back propagation?

    The difference between the network's output and the actual target value.

  • What happens in the backward pass?

    The error is propagated backwards through the network, and each layer calculates its contribution to the error.

  • Which algorithm is used to adjust the weights?

    Gradient descent.

  • Define regression.

    Regression is a type of supervised learning used to predict continuous values rather than categories.

  • Name the three types of regression.

    Linear regression, multiple linear regression and logistic regression.

  • What does logistic regression predict?

    Binary outcomes, such as yes or no, despite the name 'regression'.

Sign up to unlock flashcards

or