question
stringlengths
6
13.7k
text
stringlengths
1
25.8k
source
stringclasses
3 values
Assume you are part of a team developing a mobile app using Scrum. At the last sprint planning, you were assigned the task of adding a new authentication method. However, a customer representative just sent you an email: "the representative believes authentication is less important than support for right-to-left langua...
In response to the customer representative's request, you should continue focusing on the assigned authentication method for the current sprint and inform the Product Owner about the request for possible inclusion in the product backlog. **Step-by-step breakdown:** 1. **Prioritize Sprint Goals**: Focus on completing ...
M1 preference data
Suppose that you are given an insertion only stream of items. For every $k\geq 1$, give an algorithm that at each point in the stream maintains $k$ uniformly random elements from the prefix of the stream sampled without replacement. Your algorithm must use $O(k\log n)$ space.
To solve the problem of maintaining \( k \) uniformly random elements from an insertion-only stream while using \( O(k \log n) \) space, we can use a method based on reservoir sampling, but we need to adapt it to ensure we sample without replacement. ### Steps of the Algorithm: 1. **Initialization**: - We maintain...
M1 preference data
For a user that has not done any ratings, which method can make a prediction?
To determine which recommendation method can make a prediction for a user who has not provided any ratings, let's analyze each option: **A) User-based collaborative RS** - User-based collaborative filtering relies on the ratings and preferences of similar users to make predictions. If a user has not provided any ratin...
M1 preference data
Tick the \textbf{false} assertion. In Differential Cryptanalysis, the corresponding differential circuit of \ldots
To address the question systematically, let’s review each assertion and analyze their validity within the context of differential cryptanalysis, which focuses on how differences in input can affect differences in output through various types of gates in a circuit. 1. **Linear Circuit ($Y=M\times X$)**: - The asser...
M1 preference data
Assume that you are part of a team developing a mobile app using Scrum. When using the app, you identified multiple bugs and features which you think should be implemented, and took some notes. You want to share these with the Product Owner. Your backlog of tasks includes the following task: - [ ] [Bug] When I click on...
Yes, the item is suitable for submission to the Product Backlog because it clearly describes a bug in the app's functionality, indicating the observed issue and suggesting a necessary improvement for the user experience. It would be beneficial to include steps to reproduce the bug and the expected behavior for further ...
M1 preference data
We apply a Gaussian Mixture Model made of $K$ isotropic Gaussians (invariant to rotation around its center) to $N$ vectors of dimension $D$. What is the number of \emph{free} parameters of this model?
To find the number of free parameters in a Gaussian Mixture Model (GMM) made of \( K \) isotropic Gaussians applied to \( N \) vectors of dimension \( D \), we need to consider the parameters for the mixture model itself. ### Parameters of a GMM: 1. **Means**: Each of the \( K \) Gaussian components has a mean vector...
M1 preference data
Which of the following statement(s) is/are true about different types of coverage for coverage-guided fuzzing?
To analyze the statements regarding coverage types in coverage-guided fuzzing, let's evaluate each option carefully: **Option A: "If you cover all edges, you also cover all blocks."** - **Evaluation**: This statement is **true**. In a control flow graph (CFG), edges represent transitions between blocks (or nodes). If ...
M1 preference data
If the top 100 documents contain 50 relevant documents
Let's analyze each option step-by-step based on the definitions and the given scenario: 1. **Precision at K** is calculated as the number of relevant documents among the top K results divided by K. 2. **Recall** is calculated as the number of relevant documents retrieved divided by the total number of relevant doc...
M1 preference data
Many general evaluation metrics can be considered for various NLP tasks. The simplest one is accuracy. Give several examples of NLP tasks for which accuracy can be used as an evaluation metric. Justify why. In general, what property(ies) must an NLP task satisfy in order to be evaluable through accuracy?
Accuracy can be used as an evaluation metric for tasks like Part-of-Speech tagging, Information Retrieval, Text Classification, and Information Extraction because these tasks involve clear correct and incorrect predictions that can be compared against a reference. For accuracy to be meaningful, there must be a defined ...
M1 preference data
The statistical distance between two distributions is \dots
The statistical distance between two distributions is a measure that quantifies how distinguishable the two distributions are from each other in terms of the probabilities they assign to the same events. Mathematically, it is often represented as the total variation distance, which captures the maximum difference in pr...
M1 preference data
Design and analyze a polynomial time algorithm for the following problem: \begin{description} \item[INPUT:] An undirected graph $G=(V,E)$. \item[OUTPUT:] A non-negative vertex potential $p(v)\geq 0$ for each vertex $v\in V$ such that \begin{align*} \sum_{v\in S} p(v) \leq |E(S, \bar S)| \quad \mbox{for every $\emptyset...
To solve the problem of finding a non-negative vertex potential \( p(v) \geq 0 \) for each vertex \( v \in V \) in an undirected graph \( G = (V, E) \) such that: \[ \sum_{v \in S} p(v) \leq |E(S, \bar{S})| \quad \text{for every } \emptyset \neq S \subsetneq V, \] and maximizing \( \sum_{v \in V} p(v) \), we can leve...
M1 preference data
If there are {t} PoS tags, what is the maximum number of (not necessarily free) parameters the probabilistic model needs to consider to determine the best possible PoS tag sequence given a word sequence of length {w}, subjected to the limited lexical conditioning and limited scope for syntactic dependencies (1 neighbor...
To determine the maximum number of parameters required for a probabilistic model that predicts the best possible Part-of-Speech (PoS) tag sequence given a word sequence, we will consider the following aspects: 1. **Word Sequence Length (w)**: We have a sequence of words of length \( w \). 2. **PoS Tags (t)**: There a...
M1 preference data
In which of the following groups is the decisional Diffie-Hellman problem (DDH) believed to be hard?
The decisional Diffie-Hellman problem (DDH) is a foundational problem in cryptography, particularly in public key systems. It is believed to be hard in certain groups, making them suitable for secure cryptographic applications. The groups where DDH is typically considered hard include those where the underlying mathema...
M1 preference data
Assume your colleague wants to wait until the next minor release to include a major bugfix instead of making a bugfix release. Explain why this is not a good idea.
Answer: Waiting for the next minor release to include a major bugfix can lead to prolonged exposure to the bug for users, potentially causing significant issues or dissatisfaction. Additionally, bundling critical fixes with new features may complicate the release process, increasing the risk of introducing new bugs and...
M1 preference data
Select the \emph{incorrect} statement. The discrete logarithm
A. The discrete logarithm can be solved by a polynomial algorithm is incorrect because, in general scenarios, especially in cryptography, there is no known polynomial time algorithm to solve this problem. I chose option (A) because it incorrectly asserts that the discrete logarithm can be solved by a polynomial algorit...
M1 preference data
Briefly describe the specific objectives of the morphological module in the general perspective of automated Natural Language Processing.
The morphological module in automated Natural Language Processing (NLP) serves several specific objectives that are crucial for effective language understanding and generation. 1. **Word Structure Analysis**: One of the primary objectives is to analyze the internal structure of words. This involves breaking down word...
M1 preference data
Consider the following sentence: High-energy pulsed laser beams are used in soft-tissue surgery. Using a 1-gram language model and a tokenizer that splits on whitespaces and punctuation (including hyphens (-)), assume that the tokenization is now enhanced with Named Entity Recognition (NER) specialized on technical and...
**Advantage:** Enhancing the tokenization with Named Entity Recognition (NER) improves probability estimation and inference by treating technical and medical terms as single entities rather than independent tokens. This allows the model to capture contextual relationships between words, leading to more accurate predict...
M1 preference data
Your friend Charlie was training a neural net, and observed something very curious. During training, the same network, with the same exact weights, doesn't always give the same prediction for a given example. What can cause this behavior?
**Batch normalization, Dropout** Batch normalization and dropout can introduce randomness during training, which can lead to different predictions even with the same weights. Batch normalization normalizes the input of each layer based on the current batch, which can vary from one training iteration to another. Dropou...
M1 preference data
What happens in our "Consensus-Based Total-Order Broadcast" algorithm, if the set of messages delivered in a round is not sorted deterministically after deciding in the consensus abstraction, but before it is proposed to consensus?
In the "Consensus-Based Total-Order Broadcast" algorithm, achieving a total order of messages is crucial for ensuring that all participants in a distributed system process messages in the same sequence. When we discuss what happens if the set of messages delivered in a round is not sorted deterministically after deci...
M1 preference data
For any function $f:\{0,1\}^p\rightarrow \{0,1\}^q$ and for any $a\in\{0,1\}^p$, we have\ldots
To analyze the notation and the question, we first need to clarify what \(\mathsf{DP}^f(a,b)\) means. Typically, in the context of functions \(f:\{0,1\}^p \rightarrow \{0,1\}^q\), \(\mathsf{DP}^f(a,b)\) represents the output of the function \(f\) when given the input \(a\) and is compared or related to \(b\) in some wa...
M1 preference data
For an interactive proof system, the difference between perfect, statistical and computational zero-knowledge is based on \ldots
The question asks about the differences between perfect, statistical, and computational zero-knowledge proofs in interactive proof systems, specifically focusing on what these differences are based on. The key concept here revolves around the degree of indistinguishability between the distributions of outputs (transcr...
M1 preference data
You have been publishing a daily column for the Gazette over the last few years and have recently reached a milestone --- your 1000th column! Realizing you'd like to go skiing more often, you decide it might be easier to automate your job by training a story generation system on the columns you've already written. Then...
To compute the probability mass \( P(s_1) \) using the softmax function, use the formula: \[ P(s_1) = \frac{e^{s_1}}{\sum_{i=1}^{|V|} e^{s_i}} \] This transforms the score into a normalized probability. --- To derive the probability mass \( P(s_1) \) using the softmax function, we start from the vector of scores \(...
M1 preference data
The following function(s) have a unique minimizer.
To determine which functions have a unique minimizer in their respective intervals, let's analyze each option. (a) \( f(x) = x^{2}, x \in [-3, 2] \) The function \( f(x) = x^{2} \) is a quadratic function that is concave up (its second derivative is positive). The minimum occurs at the vertex, which is at \( x = 0 \)...
M1 preference data
(Convex III) Let $f, g: \mathbb{R} \rightarrow \mathbb{R}$ be two convex functions. Then $h=f \circ g$ is always convex.
Answer: 2 Reasoning: The composition of two convex functions is not always convex unless additional conditions are met, such as g being non-decreasing. A counterexample can be constructed where f and g are both convex but their composition h = f(g(x)) is not convex.
M1 preference data
A shadow stack...
A shadow stack is primarily used to enhance the security of the call stack in programming languages, especially against control flow attacks such as return-oriented programming (ROP) and other stack-based exploits. Analyzing each option: 1. **Offers stronger protection than stack canaries**: This statement is true; ...
M1 preference data
Which of the following is/are true about fuzzing with sanitizers?
Let's evaluate each of the provided statements regarding fuzzing with sanitizers: 1. **Some fuzzers use fork servers to reduce sanitizer overhead.** **True.** Fork servers allow a fuzzer to spawn multiple test cases from a single process, which can significantly reduce the overhead associated with instrumentation...
M1 preference data
Which of the following statements on Latent Semantic Indexing (LSI) and Word Embeddings (WE) is false?
To answer the question regarding Latent Semantic Indexing (LSI) and Word Embeddings (WE), let's first understand the key concepts involved and then evaluate each option. 1. **Latent Semantic Indexing (LSI)**: - LSI is a technique in natural language processing that uses singular value decomposition (SVD) to reduce ...
M1 preference data
In Bluetooth, the link key $K_{link}$ is ...
The link key \( K_{link} \) in Bluetooth is primarily **used to authenticate devices**. This key is established during the pairing process and is essential for ensuring that the devices can verify each other's identity before establishing a secure connection. To elaborate further, the link key is a symmetric key that...
M1 preference data
Let $E$ be a finite ground set and let $\mathcal{I}$ be a family of ground sets. Which of the following definitions of $\mathcal{I}$ guarantees that $M = (E, \mathcal{I})$ is a matroid? \begin{enumerate} \item $E$ is the edges of an undirected bipartite graph and $\mathcal{I} = \{X \subseteq E : \mbox{$X$ is an acyclic...
To determine which options guarantee that \( M = (E, \mathcal{I}) \) is a matroid, we need to evaluate each of the proposed definitions of \( \mathcal{I} \) based on the two matroid axioms: the hereditary property and the exchange property. 1. **Option 1: \( E \) is the edges of an undirected bipartite graph and \( \m...
M1 preference data
/True or false:/ Is the following statement true or false? Justify your answer. "The node with the highest clustering coefficient in an undirected graph is the node that belongs to the largest number of triangles."
**True.** The clustering coefficient of a node in an undirected graph measures the degree to which its neighbors are also connected to each other. Specifically, it quantifies the proportion of pairs of the node's neighbors that are connected by edges, thus forming triangles with the node itself. A triangle is a compl...
M1 preference data
Consider the following sentences: ```Aphrodite and Eros are Gods.``` ```Aphrodite is a parent of Eros.``` ```Aphrodite is beautiful.``` ```Aphrodite is happy.``` Specify which are the *classes*, the *instances* and the *properties* in the above statements.
To analyze the given sentences, we must first understand the distinctions between classes, instances, and properties in the context of ontology and knowledge representation. 1. **Classes** are general categories or types that group together similar entities. They represent sets of objects that share common characteris...
M1 preference data
Consider the linear programming relaxation for minimum-weight vertex cover: \begin{align*} \text{Minimize} \quad &\sum_{v\in V} x_v w(v)\\ \text{Subject to} \quad &x_u + x_v \geq 1 \quad \forall \{u,v\} \in E \\ &0 \leq x_v \leq 1 \quad \ \ \forall v \in V \end{align*} In class, we saw that any extreme point is integ...
To prove that any extreme point \( x^* \) of the linear programming relaxation for the minimum-weight vertex cover satisfies \( x^*_v \in \{0, \frac{1}{2}, 1\} \) for every vertex \( v \in V \), we need to analyze the feasible region and the implications of the constraints more rigorously. ### Step 1: Understanding th...
M1 preference data
You are asked to implement the following List functions using only the specified List API methods. You are also allowed to use the reverse method in any subquestion, should you see it fit. If you need another method of List, you need to reimplement it as part of your answer. Please refer to the appendix on the last pag...
To implement the `scanLeft` function using only `foldLeft`, `Nil`, and `::` (the cons operator), we need to understand the purpose of `scanLeft`. The `scanLeft` function computes a running total (or accumulation) of a binary operation applied to the elements of a list, starting with an initial value. The `foldLeft` fu...
M1 preference data
Let $n$ be a positive integer. An element $x \in \mathbb{Z}_n$ is \emph{always} invertible when \dots
To determine when an element \( x \in \mathbb{Z}_n \) is always invertible, we need to understand the conditions under which an element has a multiplicative inverse in the modular arithmetic system \( \mathbb{Z}_n \). 1. **Invertibility in \( \mathbb{Z}_n \)**: An element \( x \) is invertible in \( \mathbb{Z}_n \) if...
M1 preference data
Tick the \emph{true} assertion related to the ElGamal signature scheme.
In the context of the ElGamal signature scheme, the true assertion is: **The generator \(g\) generates a subgroup of prime order.** ### Explanation: In the ElGamal signature scheme, we work within a cyclic group of prime order \(q\) that is generated by \(g\). The security of the scheme relies on the difficulty of th...
M1 preference data
Let $$G= egin{pmatrix} 1 &1 &1 &0 &1 &0\ 0 &1 &1 &1 &0 &0\ 0 &1 &1 &0 &0 &0\ 0 &1 &1 &1 &0 &1 \end{pmatrix}$$ be the generator matrix of a $(6,4)$ linear code $\mathcal C$ over $\mathbb F_2$. True or false: $G$ admits a systematic form (i.e., it can be put into systematic form via elementary row operations).
To determine whether the given generator matrix \( G \) of a \((6,4)\) linear code over \( \mathbb{F}_2 \) can be transformed into systematic form through elementary row operations, we will follow the outlined steps. ### 1. Define Systematic Form A matrix is said to be in systematic form if it has the structure: \[ ...
M1 preference data
In this problem we are going to formally analyze the important median trick. Suppose that we have a streaming algorithm for distinct elements that outputs an estimate $\hat d$ of the number $d$ of distinct elements such that \begin{align*} \Pr[\hat d > 3d] \leq 47 \% \qquad \mbox{and} \qquad \Pr[\hat d < d/3] \leq 47...
To prove that the median of \(t\) independent estimates from the algorithm yields an estimate \(\hat d\) such that \(d/3 \leq \hat d \leq 3d\) with probability at least \(1 - \delta\), we can utilize the properties of the median and Chernoff bounds. ### Step 1: Define the Problem We have \(t\) independent copies of t...
M1 preference data
Once software has been shipped, what does the Software Development Lifecycle require you to do to maintain security guarantees?
To maintain security guarantees after software has been shipped, the Software Development Lifecycle (SDLC) requires the following actions: 1. **Track the Evolution of Third Party Dependencies**: - Continuously monitor and assess third-party libraries and frameworks used in the software. - Stay informed about vu...
M1 preference data
You have been publishing a daily column for the Gazette over the last few years and have recently reached a milestone --- your 1000th column! Realizing you'd like to go skiing more often, you decide it might be easier to automate your job by training a story generation system on the columns you've already written. Then...
A potential harm could be the generation of misleading or inaccurate information about COVID-25 symptoms or treatments, which could lead individuals to make unsafe health decisions or avoid seeking necessary medical care, thereby endangering their health and safety.
M1 preference data
Thick the \emph{incorrect} assertion.
To analyze the assertions regarding SAS-based cryptography, let's break down each option step-by-step: 1. **The goal of SAS-based cryptography is to reduce the length of the string that has to be authenticated.** - This statement is misleading. The primary goal of SAS (Short Authentication String) is to provide a w...
M1 preference data
Assume that your team is discussing the following java code: public final class DataStructure { public void add(int val) { /*...*/ } private boolean isFull() { /*...*/ } } One of your colleagues thinks that "isFull" should be made public. Explain whether this breaks backward compatibility and why or why not ...
The answer is correct. In Java, if a method is declared as private, it means that it can only be accessed within the same class. No other class, including subclasses, can call or see this method. Therefore, if you change the visibility of the `isFull` method from private to public, it does not break backward compatibil...
M1 preference data
For his awesome research, Tugrulcan is going to use the PageRank with teleportation and HITS algorithm, not on a network of webpages but on the retweet network of Twitter! The retweet network is a directed graph, where nodes are users and an edge going out from a user A and to a user B means that "User A retweeted User...
To answer this question, we first need to understand a few key concepts related to the PageRank and HITS algorithms, as well as the structure of the retweet network on Twitter. **Key Definitions:** 1. **Directed Graph:** A structure consisting of nodes (users, in this case) connected by edges (retweets), where the di...
M1 preference data
Consider an IR engine, which uses an indexing mechanism implementing the following 3 consecutive filters: a morpho-syntactic filter that restricts indexing term candidates to only nouns, and reduces them to their root forms; a frequencial filter parameterized with \(f_\text{min}=0.06\) (resp. \(f_\text{max}=0.20\)) as...
To find the multi-set resulting from the indexing of document \(d\) using the described IR engine, we will follow the three filters step by step. 1. **Morpho-syntactic filter**: We will extract only nouns from the document and reduce them to their root forms (lemmas). From the document, the nouns are: - Cats → ...
M1 preference data
Calculate the mean of individuals who remain alive in the data. The data is stored in a pandas.DataFrame and the respective column is "alive".
To calculate the mean of the values in the 'alive' column, where `1` represents individuals who are alive and `0` represents those who are not, follow these steps: 1. **Calculate the Mean**: You can directly calculate the mean of the 'alive' column in the DataFrame. This will give you the proportion of individuals who...
M1 preference data
Consider an undirected graph $G=(V,E)$ and let $s\neq t\in V$. In the minimum (unweighted) $s,t$-cut problem, we wish to find a set $S\subseteq V$ such that $s\in S$, $t\not \in S$ and the number of edges crossing the cut is minimized. We shall use a linear program to solve this problem. Let ${P}$ be the set of all pat...
To prove that \(\optlp \leq \opt\), we need to establish a relationship between the optimal value of the linear program \(\optlp\) and the minimum number of edges crossing an \(s,t\)-cut, denoted as \(\opt\). Here’s a step-by-step breakdown of the reasoning: 1. **Understanding the Linear Program**: - The linear p...
M1 preference data
Vectorize the input with the Vector Space Model
{"answer":"To vectorize the input using the Vector Space Model, represent each document as a vector in a multi-dimensional space where each dimension corresponds to a unique term from the vocabulary. The vector components can be term frequency (TF) or term frequency-inverse document frequency (TF-IDF). The formula for ...
M1 preference data
Which of the following is true regarding the random forest classification algorithm?
1) **It is not suitable for parallelization.** False. Random forests can build each tree independently, making them suitable for parallelization. 2) **It uses only a subset of features for learning in each weak learner.** True! Each decision tree is built using a random subset of features, typically \( k \) out of...
M1 preference data
Consider two fully connected networks, A and B, with a constant width for all layers, inputs and outputs. Network A has depth $3L$ and width $H$, network B has depth $L$ and width $2H$. Everything else is identical for the two networks and both $L$ and $H$ are large. In this case, performing a single iteration of ba...
To determine whether the statement is true or false, we need to analyze the computational cost of performing a single iteration of backpropagation for both networks A and B. 1. **Network A** has: - Depth: \(3L\) - Width: \(H\) 2. **Network B** has: - Depth: \(L\) - Width: \(2H\) ### Backpropagation Cost ...
M1 preference data
Let $X$, $Y$, and $K$ be respectively the plaintext, ciphertext, and key distributions. $H$ denotes the Shannon entropy. The consequence of perfect secrecy is \dots
Perfect secrecy is a fundamental concept in cryptography that ensures that a ciphertext provides no information about the plaintext without the key. This concept is primarily defined in the context of the one-time pad (OTP), where the key is as long as the message, truly random, and used only once. To define perfect ...
M1 preference data
Assume that you are part of a team developing a mobile app using Scrum. When using the app, you identified multiple bugs and features which you think should be implemented, and took some notes. You want to share these with the Product Owner. Your backlog of tasks includes the following task: - [ ] Login Is this item su...
Yes, the item "Login" is suitable to be submitted to the Product Backlog. Here’s a clear explanation of why this is the case: ### 1. **Definition of Product Backlog:** The Product Backlog is a prioritized list of features, enhancements, bug fixes, and technical work that needs to be completed for the product. It serve...
M1 preference data
Given a matrix $\Xm$ of shape $D imes N$ with a singular value decomposition (SVD), $X=USV^ op$, suppose $\Xm$ has rank $K$ and $\Am=\Xm\Xm^ op$. Which one of the following statements is extbf{false}?
The statement that is **false** is: 'The eigenvalues of A are the singular values of X' because the eigenvalues of A are the square of the singular values of X.
M1 preference data
You are responsible for a project aiming at providing on-line recommendations to the customers of a on-line book selling company. The general idea behind this recommendation system is to cluster books according to both customers and content similarities, so as to propose books similar to the books already bought by a g...
To perform clustering on the six documents (d1 to d6) using cosine similarity and single linkage, we will follow a systematic approach. The steps include calculating cosine similarities between the documents, forming a distance matrix, and then applying the single linkage clustering method to create a dendrogram. ### ...
M1 preference data
What happens in the uniform reliable broadcast algorithm if the completeness property of the failure detector is violated?
To address the question regarding the implications of a violation of the completeness property in a uniform reliable broadcast algorithm, we first need to clarify some fundamental concepts related to distributed systems, particularly focusing on failure detectors and broadcast algorithms. ### Step 1: Understanding Uni...
M1 preference data
Choose the \emph{correct} statement
To analyze each option regarding elliptic curves, we need to understand the mathematical structure of elliptic curves in the context of algebraic geometry and number theory. 1. **Elliptic curves form a field.** - A field is a set equipped with two operations (usually addition and multiplication) that satisfy certai...
M1 preference data
Which of the following is an acceptable commitment scheme, i.e., one that verifies the hiding and binding property (for a well chosen primitive and suitable $x$ and $r$):
To determine which of the provided options forms an acceptable commitment scheme that satisfies the hiding and binding properties, we analyze each one: Option 0: ( Commit(x;r) = Enc_r(x) ), where ( Enc_r ) is a symmetric encryption scheme with key ( r ). Hiding: This holds as long as the symmetric encryption scheme i...
M1 preference data
Let $\xv_1, . . . , \xv_N$ be a dataset of $N$ vectors in $\R^D$. What does it mean for the data vectors $\xv_1, . . . , \xv_N$ to be centered, as for principle component analysis (PCA) to be meaningful? Use the notation $x_{nd}$ for individual entries.
For the data vectors \(\xv_1, \ldots, \xv_N\) in \(\mathbb{R}^D\) to be considered centered, it means that the mean of each dimension across all vectors is zero. Mathematically, this can be expressed as follows: for each dimension \(d\) (where \(d = 1, 2, \ldots, D\)), the mean of the \(d\)-th entries of all vectors mu...
M1 preference data
Which statement is true for linear regression?
Let's analyze each statement regarding linear regression: ### Option A: **A linear regression model can be expressed as an inner product between feature vectors and a weight vector.** This statement is true. In linear regression, we model the relationship between the dependent variable \( y \) and independent variab...
M1 preference data
we'd like to do some sentence topic classification using a Naive-Bayes model. Consider the following toy learning corpus, where each sentence has been assigned a topic, either "Medical" or "Computer": \item Medical: plastic surgery process initial consultation can be scheduled by sending an email to the administration....
To classify the sentence "pulsed laser used for surgery process" using the Naive-Bayes model, we need to calculate the probabilities for each topic ("Medical" and "Computer") given the sentence. We will use the following steps: 1. **Calculate the prior probabilities** for each class: - P(Medical) = Number of Medica...
M1 preference data
Given the following function sums: 1 def add(c: Int, acc: List[(Int, Int)]): List[(Int, Int)] = acc match 2 case Nil => List((c, 1)) 3 case x :: xs => if x._1 == c then (c, x._2+1) :: xs else x :: add(c, xs) 4 5 def sums(digits: List[Int]): List[(Int, Int)] = 6 digits.foldRight(List[(Int, Int)]())(add) Your task is to ...
### Overview of the Functions To understand the operation implemented by the `mystery3` function, we first need to analyze the helper function `sums` and the function `add` that it uses. ### Understanding the `add` Function The `add` function takes two parameters: an integer `c` and a list of tuples `acc`, where ea...
M1 preference data
Which is an appropriate method for fighting skewed distributions of class labels in classification?
To analyze the multiple-choice question regarding methods for addressing skewed distributions of class labels in classification, we will follow the structured approach outlined in the instructions. ### Core Concepts The question tests knowledge of techniques used to handle imbalanced class distributions in classificat...
M1 preference data
One of your colleagues has recently taken over responsibility for a legacy codebase, a library currently used by some of your customers. Before making functional changes, your colleague found a bug caused by incorrect use of the following method in the codebase: public class User { /** Indicates whether the user’s...
### Understanding API Design Principles When designing an API, it’s critical to consider how changes will affect existing users. APIs often have consumers who rely on specific methods, and altering or removing them can lead to compatibility issues. ### The Role of Compatibility When a method is removed from an API, ...
M1 preference data
In User-Based Collaborative Filtering, which of the following is correct, assuming that all the ratings are positive?
Correct Answer: ['If the variance of the ratings of one of the users is 0, then their Cosine Similarity is not computable']
M1 preference data
Which of the following lock acquisition orders (locks are acquired from left to right), for thread 1 (T1) and thread 2 (T2), will result in a deadlock ? Assume that A, B, C, D are lock instances.
Thank you for your patience. Let's reevaluate the lock acquisition orders for each option to determine which sequences can lead to a deadlock. ### Step-by-Step Analysis: 1. **Understanding Deadlock**: - A deadlock occurs when two or more threads are waiting indefinitely for resources held by each other. - For t...
M1 preference data
Let $b$ be the maximum number of linearly independent columns of a parity check matrix $H$ of a linear code. True or false: Then, the minimum distance of the code is $b+1$.
Let's carefully analyze the statement again regarding the relationship between the maximum number of linearly independent columns of a parity check matrix \( H \) and the minimum distance \( d \) of the corresponding linear code. 1. **Understanding the Parity Check Matrix**: The parity check matrix \( H \) of a linear...
M1 preference data
Consider an HMM Part-of-Speech tagger, the tagset of which contains, among others: DET, N, V, ADV and ADJ, and some of the parameters of which are: $$ \begin{gathered} P_{1}(\mathrm{a} \mid \mathrm{DET})=0.1, \quad P_{1}(\text {accurately} \mid \mathrm{ADV})=0.1, \quad P_{1}(\text {computer} \mid \mathrm{N})=0.1, \\ P...
To determine the output of the HMM Part-of-Speech (PoS) tagger given the specified parameters, we will employ the Viterbi algorithm to identify the most probable sequence of tags for a sequence of words. ### Understanding Key Components 1. **Emission Probabilities \(P_1(w \mid y)\)**: These represent the likelihood ...
M1 preference data
In JOS, suppose one Env sends a page to another Env. Is the page copied?
No. In JOS, when one Env sends a page to another Env, the page is not copied; instead, the original page is mapped into the address space of the receiving Env, allowing both Envs to access the same physical memory without duplicating it.
M1 preference data
Given this program snippet which is part of a large (> 10000 LoC) codebase, which of these statements are true, given that the contents of string "s" are attacker controlled, the attacker can run the function f only once, the attacker has access to the binary and the binary is compiled for x86\_64 on a ...
To analyze the options given the provided C code snippet and the conditions outlined in the question, let's break down the relevant aspects of the code and the implications of different security mitigations. ### Code Analysis The function `f` takes a string `s` and performs the following: 1. It declares a local buffer...
M1 preference data
The Kerckhoffs principle says that
The correct answer is: **the security of a system should not rely on the secrecy of the cryptosystem.** Kerckhoffs' principle emphasizes that a cryptographic system should remain secure even if everything about the system, except the secret key, is public knowledge.
M1 preference data
In Itanium's procedure call and return mechanism, What is the purpose of the erb+alloc+ instruction? Where do you expect a compiler to place it? What is the meaning of its two arguments and how would a compiler determine their values? Describe what the processor does whe...
The `erb+alloc+` instruction in Itanium's architecture plays a crucial role in the procedure call and return mechanism by managing the stack frame for function calls. The primary purpose of `erb+alloc+` is to allocate a new stack frame for the called procedure and to update the stack pointer accordingly. This is essent...
M1 preference data
Which of the following statements on Latent Semantic Indexing (LSI) and Word Embeddings (WE) is incorrect
### Step 1: Understanding Latent Semantic Indexing (LSI) and Word Embeddings (WE) Latent Semantic Indexing (LSI) and Word Embeddings (WE) are both methodologies in natural language processing (NLP) that serve to analyze and represent text data, but they operate on different principles and have distinct characteristics...
M1 preference data
The number of non-zero entries in a column of a term-document matrix indicates:
The correct answer is indeed: none of the other responses is correct. In a term-document matrix, the number of non-zero entries in a column indicates how many documents contain at least one occurrence of the corresponding term, not how many terms are in a document or how often a term occurs in a specific document.
M1 preference data
Consider the following lexicon \(L\): boy : Adj, N boys : N blue : Adj, N drink : N, V drinks : N, V Nice : Adj, N When using an order-1 HMM model (using \(L\)) to tag the word sequence:"Nice boys drink blue drinks"does the tag of drink depend on the tag of nice?
- In an order-1 Hidden Markov Model (HMM), the tag assigned to a word in a sequence depends on the tag of the previous word, but not on any other word beyond that. - In the given sequence "Nice boys drink blue drinks," the tags of "Nice" and "drink" are separated by "boys," which is tagged independently. - Therefore, t...
M1 preference data
Consider a source $S$ with some distribution $P_S$ over the alphabet $\mathcal{A} = \{a, b, c, d, e, f\}$. Consider the following encoding $\Gamma$ over a code alphabet $\mathcal{D}$ of size $D$ with the following codeword lengths: egin{center} egin{tabular}{ |c|c|c|c|c|c|c| } \hline & $a$ & $b$ & $c$ & $d$...
The correct answer is "True." To understand why, we need to look at the concept of uniquely-decodable codes. A code is uniquely decodable if every possible sequence of codewords can be decoded in only one way. This means that there should not be two different sequences of codewords that result in the same concatenated...
M1 preference data
Following the notation used in class, let us denote the set of terms by $T=\{k_i|i=1,...,m\}$, the set of documents by $D=\{d_j |j=1,...,n\}$, and let $d_i=(w_{1j},w_{2j},...,w_{mj})$. We are also given a query $q=(w_{1q},w_{2q},...,w_{mq})$. In the lecture we studied that, $sim(q,d_j) = \sum^m_{i=1} \frac{w_{ij}}{|...
To rank the documents based on their relevance to the query using the probabilistic interpretation provided, we need to compute the similarity score \( sim(q, d_j) \) for each document \( d_j \) using the formula derived: \[ sim(q, d_j) = \sum_{i=1}^{m} P(k_i|d_j) P(q|k_i) \] In this case, we have 3 terms (so \( m = ...
M1 preference data
You are working on a dataset with lots of outliers, and want to perform a regression task. Everything else being equal, and assuming that you do not do any pre-processing, which loss function will be less affected by these outliers?
To determine which loss function is less affected by outliers in a regression task, let's analyze both options provided: Mean Squared Error (MSE) and Mean Absolute Error (MAE). 1. **Mean Squared Error (MSE)**: The formula for MSE is given by: \[ \mathcal{L}(y, \hat{y}) = (y - \hat{y})^2 \] - MSE squares th...
M1 preference data
Consider a bipartite graph $G=(V,E)$ where $V$ is partitioned into $A$ and $B$. Let $(A, \mathcal{I})$ be the matroid with ground set $A$ and \begin{align*} \mathcal{I} = \{ A' \subseteq A: \mbox{ $G$ has a matching in which every vertex of $A'$ is matched}\}\,. \end{align*} Recall that we say that a vertex is matched ...
To show that \((A, \mathcal{I})\) is a matroid, we need to verify that the collection \(\mathcal{I}\) satisfies the two axioms of a matroid: 1. **Non-emptiness**: The empty set is in \(\mathcal{I}\). 2. **Hereditary property**: If \(A' \in \mathcal{I}\) and \(A'' \subseteq A'\), then \(A'' \in \mathcal{I}\). ### Step...
M1 preference data
Select the \emph{incorrect} statement. The UMTS improves the security of GSM using
To determine the incorrect statement regarding how UMTS (Universal Mobile Telecommunications System) improves the security of GSM (Global System for Mobile Communications), we must analyze each option: 1. **Authentication of the challenge**: UMTS does improve authentication methods over GSM. 2. **Integrity protection*...
M1 preference data
MD5 is
MD5 is classified as "a broken hash function." Originally designed as a secure hashing algorithm, it has been proven vulnerable through various attacks revealing flaws that allow for easy generation of collisions—two different inputs producing the same output. This compromises its integrity in applications requiring st...
M1 preference data
Assume we enforce CFI for function returns. Which of the following statements are true?
The true statements regarding Control Flow Integrity (CFI) for function returns are: 1. **"CFI on returns will make control-flow hijacking harder."** This statement is accurate because enforcing CFI on function returns restricts the possible control flow of the program, making it significantly more difficult for an at...
M1 preference data
Design a polynomial-time algorithm for the matroid matching problem: \begin{description} \item[Input:] A bipartite graph $G=(A \cup B, E)$ and two matroids $\mathcal{M}_A = (A, \mathcal{I}_A)$, $\mathcal{M}_B = (B, \mathcal{I}_B)$. \item[Output:] A matching $M \subseteq E$ of maximum cardinality satisfying: \begin{enum...
To design a polynomial-time algorithm for the matroid matching problem, we need to ensure that we can find a maximum matching in a bipartite graph while satisfying constraints imposed by two matroids \(\mathcal{M}_A\) and \(\mathcal{M}_B\). Let's break this down step-by-step. ### Step 1: Problem Setup We have: - A bi...
M1 preference data
An expression is referentially transparent if it always returns the same value, no matter the global state of the program. A referentially transparent expression can be replaced by its value without changing the result of the program. Say we have a value representing a class of students and their GPAs. Given the follow...
The result of `e2` is `0` because the `innerCount` function checks for equality between `Student2` instances based on their reference (object identity) rather than their attributes. Since the `Student2(6.0, "*")` created in `count2` is a new instance and does not match any existing instance in the `students2` list (whi...
M1 preference data
Tick the \textbf{true} statement regarding RSA Cryptosystem.
The correct answer is: **'$ed \equiv 1 \pmod{\varphi(N)}$.'**
M1 preference data
Which protocol is used for encryption in GSM?
The correct answer to the question "Which protocol is used for encryption in GSM?" is **A5**. ### Rationale for the Correct Option (A5) 1. **Encryption Functionality**: The A5 protocol is specifically designed for encryption in the GSM (Global System for Mobile Communications) network. It provides confidentiality for...
M1 preference data
We aim at tagging English texts with 'Part-of-Speech' (PoS) tags. For this, we consider using the following model (partial picture): ...some picture... Explanation of (some) tags: \begin{center} \begin{tabular}{l|l|l|l} Tag & English expl. & Expl. française & Example(s) \\ \hline JJ & Adjective & adjectif & yellow \...
To refine my previous response regarding the Part-of-Speech (PoS) tagging of the sentence "my daughter whose first adult tooth has just developed programs," we need to delve deeper into the formal parameters that differentiate the PoS tagging choices. By utilizing a structured approach, we can clarify the mathematical ...
M1 preference data
In ElGamal signature scheme and over the random choice of the public parameters in the random oracle model (provided that the DLP is hard), existential forgery is \ldots
... a challenge that can arise if certain conditions are met within the framework of the ElGamal signature scheme. The security of the scheme relies on the difficulty of a specific mathematical problem, which, if compromised, could lead to potential vulnerabilities in the signing process. Thus, the overall resilience a...
M1 preference data
When using bootstrapping in Random Forests, the number of different data items used to construct a single tree is:
To understand how bootstrapping works in the context of Random Forests and the number of distinct data items used to construct a single tree, we need to go through the process step by step: 1. **Bootstrapping Basics**: Bootstrapping is a resampling technique where we create multiple datasets (bootstrap samples) from t...
M1 preference data
In the above, what is the chance agreement between the two annotators?Give your answer as a numerical value to three decimal places.
To calculate the chance agreement between two annotators, you typically use a measure such as Cohen's Kappa or the chance-corrected agreement formula. However, the exact method requires a confusion matrix or data about the classifications made by the annotators. Since you haven’t provided specific data or a context fo...
M1 preference data
Tick the \textbf{false} assertion. A distinguisher can \ldots
### Step 1: Understand the concept of a distinguisher In cryptography, a distinguisher is a tool that helps differentiate between two distributions, typically to assess whether a given function (like a cipher) behaves like a random function. Distinguishers are crucial in analyzing the security of encryption schemes. ...
M1 preference data
Tick the \textbf{true} assertion. A first preimage attack on a hash function H is \ldots
To identify the true assertion about a first preimage attack on a hash function \( H \), we need to understand the definition of a first preimage attack. This type of attack involves finding an input that produces a specific output when hashed. ### Definitions of the Options: 1. **Given \( x \), find \( y \) such tha...
M1 preference data
What is the benefit of LDA over LSI?
To determine the benefit of LDA (Latent Dirichlet Allocation) over LSI (Latent Semantic Indexing), let's analyze each option step by step: A. **LSI is sensitive to the ordering of the words in a document, whereas LDA is not.** - This statement is not entirely accurate. LSI does not consider the order of words eithe...
M1 preference data
In Support Vector Machines (SVM), we want to maximize the margin
Certainly! Let's revise the answer to ensure that all key terms are defined clearly, the logic is complete, and the reasoning is transparent without any assumptions. --- ### Question: In Support Vector Machines (SVM), we want to maximize the margin. Options: ['TRUE', 'FALSE'] ### Answer: The correct option is **'TR...
M1 preference data
Which flag prevents user programs from reading and writing kernel data?
To determine which flag prevents user programs from reading and writing kernel data, let's analyze each of the options provided: 1. **PTE_P**: This flag typically stands for "Page Table Entry Present." It indicates whether the page is present in memory or not. It does not specifically control access rights for reading...
M1 preference data
Which of the following operations would switch the user program from user space to kernel space?
To understand which of the provided operations would switch the user program from user space to kernel space, we need to first clarify some concepts regarding user space, kernel space, and system calls. ### Concepts: 1. **User Space vs. Kernel Space**: - **User Space**: This is where user applications run. It has l...
M1 preference data
The number of non-zero entries in a column of a term-document matrix indicates:
To understand what the number of non-zero entries in a column of a term-document matrix indicates, let's break down the components of a term-document matrix and what the entries represent. 1. **Term-Document Matrix Structure**: - In a term-document matrix, rows typically represent terms (words) from the vocabulary,...
M1 preference data
What could Out of Vocabulary (OoV) forms consist of? Select all that apply.A penalty will be applied for wrong answers.
To answer the question about what Out of Vocabulary (OoV) forms could consist of, we can evaluate each option provided: 1. **Words from the lexicon**: This option is incorrect. Words that are part of the lexicon are recognized and included in the vocabulary of a language model. Therefore, they cannot be classified as ...
M1 preference data
Consider a source $S$ with some distribution $P_S$ over the alphabet $\mathcal{A} = \{a, b, c, d, e, f\}$. Bob designs a uniquely decodable code $\Gamma$ over a code alphabet $\mathcal{D}$ of size $D$ with following codeword lengths. egin{center}egin{tabular}{ |c|c|c|c|c|c|c| } \hline& $a$ & $b$ & $c$ & $d$ & $e$ & $...
To answer the question regarding the uniquely decodable code $\Gamma$ designed by Bob, let's evaluate the options based on key concepts in coding theory—specifically, average codeword length and entropy. ### Key Concepts: 1. **Average Codeword Length**: The average length \(L(\Gamma)\) of the code is computed as: \...
M1 preference data
Given the following function sums: 1 def add(c: Int, acc: List[(Int, Int)]): List[(Int, Int)] = acc match 2 case Nil => List((c, 1)) 3 case x :: xs => if x._1 == c then (c, x._2+1) :: xs else x :: add(c, xs) 4 5 def sums(digits: List[Int]): List[(Int, Int)] = 6 digits.foldRight(List[(Int, Int)]())(add) Your task is to ...
The function `mystery1` processes a list of digits to return a list of those digits that appear exactly once in the input list, but importantly, the output list is in reverse order compared to the original input. It first calls the `sums` function to generate a list of tuples, where each tuple consists of a digit and i...
M1 preference data
Let \( f : A ightarrow B \) be a function from A to B such that \(f (a) = |a| \). f is a bijection if:
To determine whether the function \( f(a) = |a| \) is a bijection for the option \( A = [-1, 0] \) and \( B = [0, 1] \), we need to evaluate its injectivity and surjectivity. ### Step 1: Define the Function The function is defined as \( f(a) = |a| \), which outputs the absolute value of \( a \). ### Step 2: Analyze I...
M1 preference data
A beautiful result by the Swiss mathematician Leonhard Euler (1707 - 1783) can be stated as follows: \begin{itemize} \item[] Let $G= (V,E)$ be an undirected graph. If every vertex has an even degree, then we can orient the edges in $E$ to obtain a directed graph where the in-degree of each vertex equals its out-degree....
To correct an imperfect orientation \( A \) of an undirected graph with even degree vertices into a perfect orientation \( A' \), follow these steps: 1. Assess each vertex’s out-degrees versus in-degrees. 2. Categorize edges based on their current directionality. 3. Model this situation using a flow network where nod...
M1 preference data
Consider an operation we will call scanRight1 that, given a function $f$ of two arguments, and a sequence $a_1, \ldots, a_N$, computes a sequence $b_1, \ldots, b_N$ such that: $b_N = a_N$ $b_i = f(a_{i}, b_{i+1})$, for $0 < i < N$ Define similarly scanLeft1 in a manner similar to scanRight1: Given a function $f$ of t...
To determine whether performing `scanLeft1` followed by reversing a sequence yields the same result as reversing the sequence first and then performing `scanRight1`, we will analyze the operations step-by-step, focusing on the associative function \( f(x, y) = x \:\:\:\: y \) (list concatenation). ### Definitions 1. ...
M1 preference data