1. Home
  2. Explore
  3. Computer Science
  4. Introduction to AI with Python

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Introduction to AI with Python

  • 111Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Search Fundamentals
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is an agent in the context of search problems?

Tap to flipClick to flipspace

An entity that perceives its environment and acts upon it.

Or swipe the card

111 cards

  1. What is an agent in the context of search problems?

    An entity that perceives its environment and acts upon it.

  2. Define 'state' in a search problem.

    A configuration of the agent and its environment at a given moment.

  3. What is the initial state in a search problem?

    The state from which the agent begins its search.

  4. What are actions in a search problem?

    Choices available to the agent in a given state, defined by a function actions(s)\text{actions}(s)actions(s) returning the set of all possible actions in state sss.

  5. What is a transition model in search?

    A function result(s,a)\text{result}(s, a)result(s,a) that returns the state obtained by performing action aaa in state sss.

  6. What is the state space of a search problem?

    The set of all states reachable from the initial state by any sequence of actions.

  7. What is a goal test in search?

    A function that determines whether a given state is a goal state.

  8. What is a path cost in search problems?

    A numerical cost assigned to each path, representing resources like time or distance; the agent seeks to minimize it.

  9. What is a solution in a search problem?

    A sequence of actions that leads from the initial state to a goal state.

  10. What is a node in search?

    A data structure that keeps track of a state, its parent node, the action taken to get there, and the path cost so far.

  11. What is the frontier in a search algorithm?

    A data structure containing all nodes available for exploration that have not yet been visited.

  12. Describe the basic search algorithm loop.

    1. If frontier is empty, return no solution. 2. Remove a node from frontier. 3. If node is goal, return solution. 4. Expand the node: add its neighbors to frontier.
  13. What problem arises with cyclic states in naive search, and how is it fixed?

    Infinite loops can occur when revisiting states; fix by maintaining an explored set to avoid re-adding states already visited or in the frontier.

  14. What is a stack data structure, and how is it used in DFS?

    A stack is a last-in, first-out (LIFO) data structure. Depth-first search uses a stack for the frontier, always expanding the most recently added node.

  15. What is depth-first search (DFS)?

    A search algorithm that always explores the deepest node in the frontier (uses a stack).

  16. What is breadth-first search (BFS)?

    A search algorithm that always explores the shallowest node in the frontier (uses a queue).

  17. What is a queue data structure, and how is it used in BFS?

    A queue is a first-in, first-out (FIFO) data structure. Breadth-first search uses a queue for the frontier, expanding the earliest added node.

  18. What is the difference between uninformed and informed search?

    Uninformed search (e.g., DFS, BFS) uses no problem-specific knowledge; informed search uses heuristics to guide exploration.

  19. What is greedy best-first search?

    A search algorithm that always expands the node that is estimated to be closest to the goal, using a heuristic function h(n)h(n)h(n).

  20. What is a heuristic function h(n)h(n)h(n)?

    A function that estimates the cost from node nnn to the goal; used in informed search algorithms.

  21. What is the Manhattan distance heuristic?

    The number of horizontal and vertical steps needed to reach the goal, ignoring obstacles.

  22. What is the A* search algorithm?

    A search algorithm that expands the node with the lowest g(n)+h(n)g(n) + h(n)g(n)+h(n), where g(n)g(n)g(n) is the cost to reach nnn and h(n)h(n)h(n) is the heuristic estimate to the goal.

  23. What conditions must a heuristic satisfy for A* to be optimal?

    The heuristic must be admissible (never overestimates the true cost) and consistent (satisfies the triangle inequality).

  24. What is minimax search?

    An algorithm for adversarial search (two-player games) where the MAX player maximizes the score and the MIN player minimizes it.

  25. In minimax, what is the utility function?

    A function that assigns a numerical value to terminal game states (e.g., +1 for win, -1 for loss, 0 for draw).

  26. What is the MAX player's decision in minimax?

    MAX chooses the action aaa that maximizes MIN-VALUE(result(s,a))\text{MIN-VALUE}(\text{result}(s, a))MIN-VALUE(result(s,a)).

  27. What is the MIN player's decision in minimax?

    MIN chooses the action aaa that minimizes MAX-VALUE(result(s,a))\text{MAX-VALUE}(\text{result}(s, a))MAX-VALUE(result(s,a)).

  28. What is alpha-beta pruning?

    An optimization of minimax that prunes branches that cannot affect the final decision by keeping track of alpha (best for MAX) and beta (best for MIN).

  29. What is depth-limited minimax?

    A variant of minimax that stops searching at a certain depth and uses an evaluation function to estimate the utility of non-terminal states.

  30. What is an evaluation function in depth-limited minimax?

    A function that estimates the expected utility of a game state from a given perspective.

  31. What is a sentence in propositional logic?

    An assertion about the world in a knowledge representation language, composed of propositional symbols and logical connectives.

  32. What are the five main logical connectives in propositional logic?

    Not (¬\neg¬), And (∧\land∧), Or (∨\lor∨), Implication (→\rightarrow→), Biconditional (↔\leftrightarrow↔).

  33. Define a truth table.

    A table that shows the truth value of a logical expression for all possible truth assignments to its propositional symbols.

  34. What is a model in propositional logic?

    An assignment of truth values (true/false) to every propositional symbol, representing a possible world.

  35. What is a knowledge base (KB)?

    A set of sentences that an AI knows to be true about the world.

  36. What does entailment mean? α⊨β\alpha \models \betaα⊨β

    In every model where α\alphaα is true, β\betaβ is also true.

  37. What is inference?

    The process of deriving new sentences from old ones.

  38. What is model checking?

    An inference algorithm that enumerates all possible models and checks if the knowledge base entails the query.

  39. What are inference rules?

    Rules that allow deriving new sentences from existing ones in a knowledge base.

  40. State modus ponens.

    If α→β\alpha \rightarrow \betaα→β and α\alphaα are known, then β\betaβ can be inferred.

  41. State and-elimination.

    If α∧β\alpha \land \betaα∧β is known, then α\alphaα (and separately β\betaβ) can be inferred.

  42. What is the resolution inference rule?

    If we have P∨QP \lor QP∨Q and ¬P∨R\neg P \lor R¬P∨R, we can infer Q∨RQ \lor RQ∨R.

  43. What is conjunctive normal form (CNF)?

    A logical sentence represented as a conjunction of clauses, where each clause is a disjunction of literals.

  44. What is the resolution algorithm for inference?

    1. Convert KB∧¬αKB \land \neg\alphaKB∧¬α to CNF. 2. Repeatedly apply resolution to generate new clauses. 3. If the empty clause (contradiction) is derived, then KB⊨αKB \models \alphaKB⊨α.
  45. What is first-order logic?

    A more expressive logic than propositional logic, featuring objects, relations, and quantifiers (universal ∀\forall∀ and existential ∃\exists∃).

  46. What are the two main quantifiers in first-order logic?

    Universal quantifier (∀\forall∀) meaning 'for all', and existential quantifier (∃\exists∃) meaning 'there exists'.

  47. What is unconditional probability?

    The probability of an event without any prior evidence, e.g., P(roll a 2)=1/6P(\text{roll a 2}) = 1/6P(roll a 2)=1/6.

  48. What is conditional probability?

    The probability of an event given that another event has occurred, denoted P(A∣B)P(A \mid B)P(A∣B).

  49. State Bayes' rule.

    P(B∣A)=P(A∣B) P(B)P(A)P(B \mid A) = \frac{P(A \mid B) \, P(B)}{P(A)}P(B∣A)=P(A)P(A∣B)P(B)​.

  50. What is a random variable?

    A variable in probability theory that can take on multiple values, each with a certain probability.

  51. What is a probability distribution?

    A function that gives the probability of each possible value of a random variable; it sums to 1.

  52. What is a joint probability distribution?

    A table or function that gives the probability of every combination of values of multiple random variables.

  53. What is independence of two events?

    Events AAA and BBB are independent if P(A∧B)=P(A)P(B)P(A \land B) = P(A)P(B)P(A∧B)=P(A)P(B).

  54. What is a Bayesian network?

    A directed graph where nodes represent random variables and edges represent conditional dependencies; each node has a conditional probability distribution given its parents.

  55. What is inference in a Bayesian network?

    Computing the posterior probability of a query variable given observed evidence variables.

  56. What is the Markov assumption?

    The current state depends only on a finite number of previous states, typically the most recent one.

  57. What is a Markov chain?

    A sequence of random variables where each variable depends only on the previous one, defined by a transition model.

  58. What is a hidden Markov model (HMM)?

    A model with hidden states that are not directly observed but produce observations (emissions); it includes a transition model and an emission model.

  59. What is filtering in HMMs?

    Given observations from start to current time, compute the distribution for the current hidden state.

  60. What is prediction in HMMs?

    Given observations from start to current time, compute the distribution for a future hidden state.

  61. What is the most likely explanation task in HMMs?

    Given observations, compute the most likely sequence of hidden states.

  62. What is local search?

    A search algorithm that maintains a single node (state) and moves to neighboring nodes, typically used when the path to the solution is irrelevant.

  63. What is hill climbing?

    A local search algorithm that repeatedly moves to the neighbor with the highest value (for maximization) until no better neighbor exists.

  64. What is a local maximum?

    A state whose value is higher than all its neighbors, but not necessarily the global maximum.

  65. What is simulated annealing?

    A local search algorithm that sometimes accepts worse solutions to escape local optima, with a probability that decreases over time (cooling schedule).

  66. What is linear programming?

    A method to optimize a linear objective function subject to linear equality and inequality constraints.

  67. What is a constraint satisfaction problem (CSP)?

    A problem defined by variables with domains and constraints that must be satisfied; the goal is to find an assignment of values to variables that satisfies all constraints.

  68. What is node consistency in CSP?

    All values in a variable's domain satisfy its unary constraints.

  69. What is arc consistency?

    For every variable xxx and every variable yyy connected by a constraint, every value in xxx's domain has a consistent value in yyy's domain.

  70. What is backtracking search for CSPs?

    A depth-first search that assigns values to variables one by one, backtracking when a constraint is violated.

  71. What is the minimum remaining values (MRV) heuristic?

    Select the variable with the smallest domain first.

  72. What is the degree heuristic?

    Select the variable involved in the most constraints (highest degree).

  73. What is the least constraining value (LCV) heuristic?

    When selecting a value for a variable, choose the one that rules out the fewest options for neighboring variables.

  74. What is supervised learning?

    A machine learning paradigm where the model learns from input-output pairs (labeled data) to predict outputs for new inputs.

  75. What is classification in supervised learning?

    The task of predicting a discrete category (class) for a given input.

  76. What is the nearest neighbor classification?

    A classification algorithm that assigns a new data point to the class of its closest training example.

  77. What is k-nearest neighbors (k-NN)?

    A classification algorithm that assigns a new data point to the most common class among its kkk nearest neighbors.

  78. What is a perceptron?

    A simple neural network unit that computes a weighted sum of inputs and applies a step activation function to produce a binary output.

  79. What is the perceptron learning rule?

    wi←wi+α(y−y^)xiw_i \leftarrow w_i + \alpha (y - \hat{y}) x_iwi​←wi​+α(y−y^​)xi​, where yyy is true label, y^\hat{y}y^​ is prediction, α\alphaα is learning rate.

  80. What is logistic regression?

    A classification algorithm that uses a logistic (sigmoid) activation function to output a probability between 0 and 1.

  81. What is a support vector machine (SVM)?

    A classifier that finds the hyperplane that maximizes the margin between two classes.

  82. What is regression in supervised learning?

    The task of predicting a continuous output value from input features.

  83. What is a loss function?

    A function that measures how far a prediction is from the actual value; used to evaluate and train models.

  84. What is overfitting?

    When a model fits the training data too closely, capturing noise and failing to generalize to new data.

  85. What is regularization?

    Adding a penalty for model complexity to the loss function to prevent overfitting.

  86. What is reinforcement learning?

    A learning paradigm where an agent learns to make decisions by interacting with an environment and receiving rewards or penalties.

  87. What is a Markov decision process (MDP)?

    A model for decision making that includes states, actions, a transition model, and a reward function.

  88. What is Q-learning?

    A model-free reinforcement learning algorithm that learns the value Q(s,a)Q(s, a)Q(s,a) of taking action aaa in state sss.

  89. What is the exploration vs. exploitation dilemma?

    The trade-off between exploring new actions to discover their rewards and exploiting known actions that yield high rewards.

  90. What is an artificial neural network?

    A computational model inspired by the brain, consisting of interconnected units (neurons) that process inputs and produce outputs.

  91. What is the activation function in a neural network?

    A function applied to the weighted sum of inputs to produce the output of a neuron; examples include step, sigmoid, ReLU.

  92. What is gradient descent?

    An optimization algorithm that iteratively adjusts weights in the direction that minimizes the loss function.

  93. What is backpropagation?

    An algorithm for training multilayer neural networks by propagating the error backward from output to hidden layers to compute gradients.

  94. What is a convolutional neural network (CNN)?

    A neural network that uses convolution (filtering) and pooling layers to extract spatial features, commonly used for images.

  95. What is image convolution?

    Applying a filter (kernel) to an image by element-wise multiplication and summation over a window, then sliding the window across the image.

  96. What is pooling in CNNs?

    Downsampling operation that reduces the spatial size of feature maps, e.g., max pooling takes the maximum value in each region.

  97. What is a recurrent neural network (RNN)?

    A neural network with connections that feed back into itself, allowing it to maintain state and process sequences of data.

  98. What is a feed-forward neural network?

    A neural network where connections only move forward from input to output, with no cycles.

  99. What is natural language processing (NLP)?

    The field of AI focused on enabling computers to understand, interpret, and generate human language.

  100. What is syntax in language?

    The structure of language, i.e., how words are arranged to form grammatically correct sentences.

  101. What is semantics in language?

    The meaning of words and sentences.

  102. What is a context-free grammar (CFG)?

    A formal grammar consisting of rewriting rules that define the syntax of a language, used for parsing.

  103. What is an n-gram?

    A contiguous sequence of nnn items (e.g., words) from a given text.

  104. What is the bag-of-words model?

    A representation of text as an unordered set of words, ignoring grammar and word order but preserving frequency.

  105. What is a naive Bayes classifier?

    A probabilistic classifier based on Bayes' theorem with the naive assumption of feature independence.

  106. What is Word2Vec?

    A model that learns dense vector representations of words such that words with similar meanings have similar vectors.

  107. What is an encoder-decoder architecture?

    A neural network architecture where an encoder maps an input sequence to a context vector, and a decoder generates an output sequence from it.

  108. What is attention in NLP?

    A mechanism that allows the decoder to focus on different parts of the input sequence when generating each output token.

  109. What is the transformer architecture?

    A neural network architecture that relies entirely on self-attention, without recurrence, enabling parallelization and capturing long-range dependencies.

  110. What is self-attention in transformers?

    An attention mechanism where each token in a sequence attends to all other tokens in the same sequence to compute its representation.

  111. What is positional encoding in transformers?

    A vector added to input embeddings to give the model information about the position of each token in the sequence.

Card 1 of 111
Card 1 of 111

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent