question
stringlengths
6
13.7k
text
stringlengths
1
25.8k
source
stringclasses
3 values
When constructing a word embedding, negative samples are:
In constructing a word embedding, negative samples are best described as **"word-context word combinations that are not occurring in the document collection."** Let’s use a simple analogy. Imagine teaching a robot what an "apple" is. You show it pictures of apples along with the word, which represent positive samples....
M1 preference data
Consider the following contains function defined on Iterable (in particular, it accepts both Vector and List). def contains[A](l: Iterable[A], elem: A): Boolean = val n = l.size if n <= 5 then for i <- l do if i == elem then return true false else val (p0, p1) = parallel( contains...
To analyze the asymptotic depth of the `contains` function when called on a `List`, we must first understand how the function operates and how the underlying data structure affects its performance. ### Function Overview: The `contains` function checks if a given element exists in an iterable collection. The key point...
M1 preference data
Let us assume that a kernel $K: \mathcal{X} \times \mathcal{X} \rightarrow \mathbb{R}$ is said to be valid if there exists $k \in \mathbb{N}$ and $\Phi: \mathcal{X} \rightarrow \mathbb{R}^{k}$ such that for all $\left(x, x^{\prime}\right) \in \mathcal{X} \times \mathcal{X}, K\left(x, x^{\prime}\right)=\Phi(x)^{\top} \P...
To determine which kernels are not valid, we need to analyze each option to see if there exists a mapping \(\Phi: \mathcal{X} \rightarrow \mathbb{R}^k\) such that \(K(x, x') = \Phi(x)^{\top} \Phi(x')\). 1. **Option 1: \(\mathcal{X}=\mathbb{N}, K(x, x')=2\)** This kernel is constant and does not depend on \(x\) or...
M1 preference data
Tick all correct answers:
The correct answers are indeed: 1. **Fuzz testing scales at least to 1'000s of lines of code.** This is correct because fuzz testing can efficiently identify vulnerabilities in large applications, especially when the code is modular. 2. **Compiler warnings scale to millions of lines of code.** This is also ...
M1 preference data
The company finally decides to implement a hybrid model consisting of a 4-gram character model combined (independently) with a 3-gram word model.How many parameters would such a hybrid model have in total?Provide the answer in the form 10^A + 10^B (for instance, write "10^7 + 10^9").
To ensure security guarantees after software has been shipped, several important practices must be followed: **1. Conduct regular security assessments** **2. Implement a robust incident response plan** ### Explanation: 1. **Conduct regular security assessments**: - After shipping software, it’s vital to routi...
M1 preference data
Consider the min-cost perfect matching problem on a bipartite graph $G=(A \cup B, E)$ with costs $c: E \rightarrow \mathbb{R}$. Recall from the lecture that the dual linear program is \begin{align*} \text{Maximize} \quad & \sum_{a\in A} u_a + \sum_{b\in B} v_b\\ \text{Subject to} \quad &u_a + v_b \leq c(\{a,b\}) \qqu...
To show that the dual linear program is unbounded under the condition that there exists a set \( S \subseteq A \) such that \( |S| > |N(S)| \), we can consider the following. Let us define \( v_b = 0 \) for all \( b \in B \) and set \( u_a = 0 \) for all \( a \in A \). This gives us a feasible solution to the dual, a...
M1 preference data
To support very large scale neural networks in limited amount of memory, one may want to use floating point numbers with very few bits. Here we consider substantially simplified operations on such numbers, Float8. A value Float8(mant,exp) represents the non-negative integer mant * 2^exp. We call mant a mantissa (which ...
Hey! So, you're asking if the addition operation for these Float8 numbers is associative, right? Basically, associative means that it doesn't matter how you group the numbers when you add them. Like, (a + b) + c should give you the same result as a + (b + c). To check this out, let's take some examples. Let's say we ha...
M1 preference data
Tick the \emph{incorrect} assertion. In RSA with public key $(e,N)$ and private key $(d,N)$ \ldots
The correct answer is **Option 1: we can recover \(d\) if we can compute square root modulo \(N\) efficiently.** ### Explanation of the Correct Assertion (Option 1): In RSA, the public key consists of an exponent \(e\) and a modulus \(N\), while the private key consists of an exponent \(d\) and the same modulus \(N\)....
M1 preference data
Which of the following probability distributions are members of the exponential family:
To determine which of the given distributions belong to the exponential family, we can analyze their forms: 1. **Cauchy distribution**: The Cauchy distribution does not fit into the exponential family. Its probability density function does not have the structure of the form \( p(y|\theta) = h(y) \exp(\eta(\theta) T(y)...
M1 preference data
Consider the following toy learning corpus of 59 tokens (using a tokenizer that splits on whitespaces and punctuation), out of a possible vocabulary of $N=100$ different tokens: Pulsed operation of lasers refers to any laser not classified as continuous wave, so that the optical power appears in pulses of some duration...
Let’s break this down step-by-step to find the Maximum-Likelihood Estimates (MLE) for the bigrams "continuous wave" and "pulsed laser" based on the provided corpus. ### Step 1: Count the Bigrams First, we need to identify how many times each bigram appears in the text. 1. **Identify occurrences:** - **"continuous ...
M1 preference data
In this week's lecture, you have been introduced to the aggregate method of ParSeq[A] (and other parallel data structures). It has the following signature: def aggregate[B](z: B)(f: (B, A) => B, g: (B, B) => B): B Discuss, as a group, what aggregate does and what its arguments represent. Under which condition(s) on z,...
The `aggregate` method in ParSeq[A] is designed to combine elements of a parallel collection using a specified binary operation. It takes three arguments: `z`, which is the initial value or the "zero" element that serves as the starting point for the aggregation; `f`, a function that specifies how to combine the initia...
M1 preference data
The inverse document frequency of a term can increase
**Chosen Option:** 4. by adding a document to the document collection that does not contain the term. **Rationale:** - **Understanding Inverse Document Frequency (IDF):** - IDF is a measure used in information retrieval to evaluate how important a term is within a collection of documents. It is calculated using th...
M1 preference data
The \textbf{parameters} (weights \textbf{W}) are learned with ... (One answer)
To answer the question regarding how the parameters (weights W) are learned in the context of machine learning, let's evaluate each of the provided options: 1. **Training**: This is the correct answer. In machine learning, the parameters of a model are learned from the training dataset. The training dataset is used to...
M1 preference data
Which of the following is correct regarding the use of Hidden Markov Models (HMMs) for entity recognition in text documents?
Let's analyze each of the answer choices regarding Hidden Markov Models (HMMs) for entity recognition in text documents: 1. **HMMs cannot predict the label of a word that appears only in the test set**: This statement is not entirely correct. While HMMs rely on the training data to estimate probabilities, they can sti...
M1 preference data
You are given the following accident and weather data. Each line corresponds to one event: 1. car_accident rain lightning wind clouds fire 2. fire clouds rain lightning wind 3. car_accident fire wind 4. clouds rain wind 5. lightning fire rain clouds 6. clouds wind car_accident 7. rain lightning clouds fire 8. lightnin...
{car_accident} -> {rain} (support: 0.625, confidence: 1.0) {fire} -> {lightning} (support: 0.625, confidence: 1.0) {clouds} -> {rain} (support: 0.625, confidence: 1.0) {lightning} -> {fire} (support: 0.625, confidence: 1.0) {rain} -> {clouds} (support: 0.625, confidence: 1.0)
M1 preference data
Give some concrete examples of NLP applications that might benefit from the semantic vectorial representations.
1. **Search Engines**: Semantic vectorial representations can improve search results by understanding the meaning behind queries rather than just matching keywords. For example, a search for "best places to eat" can return results about restaurants without explicitly mentioning "restaurants." 2. **Chatbots and Convers...
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() { /*...*/ } } Your colleagues were changing the parameter type of "add" to an "Integer". Explain whether this breaks backward compatibility and why or ...
Changing the parameter type of the `add` method from `int` to `Integer` affects compatibility in two ways: binary compatibility and source compatibility. 1. **Binary Compatibility**: This change breaks backward binary compatibility. Existing compiled code that calls the original `add(int val)` method will fail at runt...
M1 preference data
Assume you are working in a company on the back-end of a mobile application. One colleague explains that the team had originally configured the repo so that only code with >80% path coverage could be merged, but have now dropped this requirement. In one sentence, give one possible reason behind this removal.
One possible reason for the removal of the >80% path coverage requirement could be to accelerate the development process and allow for more rapid feature delivery, especially if the team felt that the strict coverage standard was hindering productivity or causing delays in merging essential code.
M1 preference data
Tick the \textbf{false} statement regarding the Enigma machine.
"It is an electro-mechanical encryption device used by German armies in World War 2." True. The Enigma machine was indeed used for military communication during World War 2. "Its specifications are secret." False. While the Enigma's code was initially a secret, its specifications, including the machine's design, beca...
M1 preference data
Tick the \textbf{true} assertion. Assume an arbitrary $f:\{0,1\}^p \rightarrow \{0,1\}^q$, where $p$ and $q$ are integers.
To determine the true assertion among the given options, let's evaluate each one step by step: 1. **First Assertion:** \[ \mathsf{DP}^f(a,b)=\Pr_{X\in_U\{0,1\}^p}[f(X\oplus a)\oplus f(X)\oplus b=1] \] - This defines the differential privacy metric. It states that the probability of a certain output, condi...
M1 preference data
Tick the \textbf{true} assertion. Let $X,Y$ be two random variables over the same probability space. Then,
The correct answer is option 2: \( E(XY) = E(X) \times E(Y) \), if \( X \) and \( Y \) are independent. Here's why this is the true assertion: 1. **Independence of Random Variables**: When we say that two random variables \( X \) and \( Y \) are independent, it means that the occurrence of one does not affect the occ...
M1 preference data
A sequential object is a tuple T = (Q, q0, O, R, ∆), where: ● Q is a set of states. ● q0 ∈ Q is an initial state. ● O is a set of operations. ● R is a set of responses. ● ∆ ⊆ (Q × Π × O) × (Q × R) is a relation that associates a state, a process, and an operation to a set of possible new states and responses. Processes...
The sequential object for Asset Transfer can be formally defined as follows: Let \( A \) be an arbitrary set of accounts. Define a state function \( q: A \rightarrow \mathbb{N} \), where \( q(a) \) represents the balance of account \( a \in A \). The initial state is denoted as \( q_0 \), such that \( q_0(a) = b_a \)...
M1 preference data
Your team is developing a library that is mostly intended to be used by your company's own applications, but the library is nevertheless distributed via a public repo on GitHub. It contains the following java function: "public InputStream convertToPdf(Document document) throws GoogleServerNotRespondingError" A security...
Changing the parameter from "Document" to "String" could lead to risks related to input validation, as it may allow for unfiltered or improperly sanitized user input to be processed, potentially resulting in security vulnerabilities like injection attacks or malformed content.
M1 preference data
Recall the Jaccard index that we saw in Exercise Set 10: Suppose we have a universe $U$. For non-empty sets $A,B \subseteq U$, the Jaccard index is defined as \begin{align*} J(A,B) = \frac{|A \cap B|}{|A \cup B|}\,. \end{align*} Design a locality sensitive hash (LSH) family $\mathcal{H}$ of functions $h: 2^U \rightarr...
To design a locality sensitive hash (LSH) family \(\mathcal{H}\) that satisfies the given properties with respect to the Jaccard index, we need to leverage the characteristics of the Jaccard similarity in our hashing functions. ### Initial Interpretation of the Problem The Jaccard index \(J(A, B)\) measures the simi...
M1 preference data
Let us remind that we define the max-margin $M_\star$ as egin{align*} M_\star = \max_{\wv\in\mathbb R^D, \| \wv\|_2=1} M ext{ such that } y_n \xv_n^ op \wv \geq M ext{ for } n=1,\cdots, N \end{align*} and a max-margin separating hyperplane $ar \wv$ as a solution ...
To bound the number of perceptron updates \( t \), we can use the following result from the theory of the perceptron algorithm: Given a dataset with \( N \) points \( (\xv_n, y_n) \) where \( y_n \in \{-1, +1\} \) and assuming \( \|\xv_n\| \leq R \) for all \( n \), the number of updates \( t \) of the perceptron can ...
M1 preference data
Implement RSME score based on the following formula. \begin{equation} \mathit{RMSE} =\sqrt{\frac{1}{N} \sum_i (r_i -\hat{r_i})^2} \end{equation} You can use the mean_squared_error function from sklearn.metrics.
To understand the implementation of the RMSE (Root Mean Square Error) score using the provided formula and Python code, we should break down the components involved in both the mathematical formula and the coding process. ### Understanding RMSE RMSE is a widely used metric for evaluating the accuracy of a predictive ...
M1 preference data
Which statement is true for the Mean Squared Error (MSE) loss MSE( $\mathbf{x}, y):=\left(f_{\mathbf{w}}(\mathbf{x})-y\right)^{2}$, with $f_{\mathrm{w}}$ a model parametrized by the weights $\mathbf{w}$ ?
Let's evaluate each statement regarding the Mean Squared Error (MSE) loss function: 1. **MSE is not necessarily convex with respect to the weights of the model $\mathbf{w}$.** - **Justification:** This statement is **true**. The MSE loss is convex with respect to the model parameters (weights) $\mathbf{w}$ if the m...
M1 preference data
Now let $\xv$ be a random vector distributed according to the uniform distribution over the finite centered dataset $\xv_1, . . . , \xv_N$ from above. % Consider the problem of finding a unit vector, $\wv \in \R^D$, such that the random variable $\wv^ op \xx$ has \emph{maximal} variance. What is the variance of the ran...
To address your question, we need to delve into some concepts related to random vectors, variance, and the properties of projections in linear algebra. Let’s break this down step-by-step. ### Understanding the Problem We have a random vector \(\xv\) that is uniformly distributed over a finite dataset \(\{\xv_1, \xv_2...
M1 preference data
The test loss of the 1-nearest neighbor classifier is always zero.
The correct option is: **B. FALSE** ### Reasoning: The statement that the test loss of the 1-nearest neighbor (1-NN) classifier is always zero is not true. While the 1-NN classifier will always predict the label of the nearest training example for any given test example, there are several scenarios where the test lo...
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 determine whether it would be beneficial to pretrain your story generation model on other text, we can analyze the situation step by step, ensuring that we define key terms and justify our conclusions clearly. ### Step 1: Understanding the Context You have published **1000 columns**, but only **800 of those can be...
M1 preference data
Devise an algorithm for the following graph orientation problem: \begin{description} \item[Input:] An undirected graph $G = (V,E)$ and capacities $k : V \rightarrow \mathbb{Z}$ for each vertex. \item[Output:] If possible, an orientation of $G$ such that each vertex $v\in V$ has in-degree at most $k(v)$. \end{descriptio...
To solve the problem of orienting an undirected graph \( G = (V, E) \) such that each vertex \( v \in V \) has an in-degree at most \( k(v) \), we can utilize a combination of graph theory concepts, particularly focusing on the idea of matroid intersection or bipartite matching. Here’s a step-by-step breakdown of how w...
M1 preference data
Is “type-directed programming” a language mechanism that infers types from values?
Answer: 2 Reasoning: Type-directed programming emphasizes using existing type information to guide program design, rather than inferring types from values.
M1 preference data
Consider a $(k+1,k)$ block code that to a binary sequence $x_1,\dots,x_k$ associates the codeword $x_1,\dots,x_k,x_{k+1}$, where $x_{k+1}= x_1+\ldots+x_k$ mod $2$. This code can detect all the errors of odd weight.
A. True. This code can detect all errors of odd weight because flipping an odd number of bits changes the parity, which will be detected during decoding. I chose option A (True) because the $(k+1,k)$ block code is specifically designed to include a parity bit that represents the sum of the first k bits modulo 2. This d...
M1 preference data
Tick the \emph{correct} assertion about $\mathbf{Z}_{pq}^*$, where $p$ and $q$ are distinct prime numbers \ldots
To analyze the assertions about the multiplicative group of integers modulo \( pq \), denoted as \( \mathbf{Z}_{pq}^* \), we will evaluate each option step by step. 1. **Understanding \( \mathbf{Z}_{pq}^* \)**: The group \( \mathbf{Z}_{pq}^* \) consists of all integers \( x \) such that \( 1 \leq x < pq \) and \( \...
M1 preference data
Assume you are working on a mobile application. In the daily standup, you mention you are having issues with JavaFX. Before you can give more details, your team's JavaFX expert tells you to leave it at that and instead pass by her office afterwards. The Scrum Master disagrees and asks you to give more details. In one s...
No, the Scrum Master is not taking the right approach because addressing issues openly in the standup fosters transparency and collaboration among the team.
M1 preference data
Which one of the following notions is not in the fundamental trilogy of cryptography?
To determine which notion is not part of the fundamental trilogy of cryptography, we need to look at the key concepts typically associated with secure communication. 1. **Confidentiality**: This ensures that information is only accessible to those who are authorized to access it. It is a core principle of cryptograph...
M1 preference data
What is the order of $2^{124}$ in $(\mathbb{Z}_{2^{128}},+)$?
To determine the order of \(2^{124}\) in the group \((\mathbb{Z}_{2^{128}},+)\), we first need to understand the structure of this group. The group \((\mathbb{Z}_{2^{128}}, +)\) is the additive group of integers modulo \(2^{128}\). The order of an element \(a\) in a group is defined as the smallest positive integer \(...
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...
No, the result of `scanRight1` is not necessarily the same as `scanLeft1`, even if the function \( f \) is associative. To illustrate this, consider the length-two sequence \( A = (a_1, a_2) \) and the function \( f(x, y) = y \). For `scanLeft1`: - Start with \( b_1 \) initialized to some identity element (let's ass...
M1 preference data
Which of the following is well preserved by 2G?
The correct answer is: **Authentication of Mobile Station**. In 2G (GSM), the authentication process ensures that the mobile station is verified before gaining access to the network, effectively preserving its identity and preventing unauthorized access.
M1 preference data
Tick the \emph{true} assertion among the followings:
Let's analyze each option in relation to the question: ### Option 1: Visual cryptography is perfectly secure (at an unreasonable cost). **Analysis:** Visual cryptography is a technique that allows a secret to be encrypted in such a way that it can be visually decrypted without needing complex computations. The concep...
M1 preference data
Consider a binary classification task as in Figure~\AMCref{fig:lr_data}, which consists of 14 two-dimensional linearly separable samples (circles corresponds to label $y=1$ and pluses corresponds to label $y=0$). We would like to predict the label $y=1$ of a sample $(x_1, x_2)$ when the following holds true ...
To determine which decision boundary the given logistic regression model will approximate, we first need to analyze the optimization objective and the implications of the parameters \( w_1 \) and \( w_2 \) under the context of a large regularization parameter \( C \). ### Understanding the Objective Function The opti...
M1 preference data
Tick the \emph{correct} assertion. In RSA with public key $(e,N)$ and private key $(d,N)$ \ldots
In RSA, if we know \(\phi(N)\), we can compute the private key \(d\) from the public key \(e\) using the relationship \(d \equiv e^{-1} \pmod{\phi(N)}\). With \(d\) and the ciphertext \(y\), we can decrypt the message by computing \(y^d \mod N\), recovering the original plaintext. This process relies on the properties ...
M1 preference data
Consider the (toy) grammar $G$ consisting of the following rules: R1: S --> NP VP R2: NP --> NN R3: NP --> Det NN R4: NN --> N R5: NN --> NN NN R6: NN --> NN PNP R7: PNP --> Prep NP R8: VP --> V R9: VP --> Adv V What is the number $N$ of additional rules that should be added to $G$ to make it applicable to any sequence...
N = 15000 To determine the number of additional rules needed for the grammar, we must consider how many distinct (PoS-tag, surface form) associations we need to accommodate the vocabulary of 10,000 distinct words with an average syntactic ambiguity of 1.5. 1. **Understanding Syntactic Ambiguity**: The average synta...
M1 preference data
The exponent of the group $\mathbb{Z}_9^*$ is
To find the exponent of the group \(\mathbb{Z}_9^*\), we first need to identify the group \(\mathbb{Z}_9^*\) itself. The group \(\mathbb{Z}_9^*\) consists of the integers from \(1\) to \(8\) that are coprime to \(9\). 1. **Identifying elements of \(\mathbb{Z}_9^*\)**: The integers from \(1\) to \(8\) are: - \(1...
M1 preference data
Select all valid answers about UNIX-like shell.
The valid answers about UNIX-like shell are: 1. **The shell is a program, that runs in user-space.** - **Reasoning:** The shell operates as a user-level program, allowing users to interact with the operating system without requiring direct access to kernel-level functions. 3. **The shell is a program, which reads ...
M1 preference data
Explain how it is possible to compute Precision at different Recalls.
To compute Precision at different Recalls, we first need to establish the relationship between Precision, Recall, and the number of true positives (TP), false positives (FP), and false negatives (FN). Precision is calculated as \( \text{Precision} = \frac{TP}{TP + FP} \) and Recall is given by \( \text{Recall} = \frac{...
M1 preference data
Which loss function(s) should you use? (One or multiple answers)
The correct answers are: 'mean square error (MSE) loss', 'cross entropy loss', and 'hinge loss'. Explanation: 1. **Mean Square Error (MSE) Loss**: This loss function is commonly used in regression problems where the goal is to minimize the average of the squares of the errors between predicted and actual values. 2. *...
M1 preference data
You have been hired to evaluate an email monitoring system aimed at detecting potential security issues. The targeted goal of the application is to decide whether a given email should be further reviewed or not. Give four standard measures usually considered for the evaluation of such a system? Explain their meaning. B...
When evaluating an email monitoring system for detecting potential security issues, four standard measures to consider are: 1. **Accuracy** (Error Rate/Overall Performance): This measure is calculated as the number of correctly classified emails (both positive and negative) divided by the total number of emails. ...
M1 preference data
When constructing a word embedding, negative samples are
When constructing a word embedding, negative samples are best described as: - **word - context word combinations that are not occurring in the document collection.** Negative sampling is a technique used in models like Word2Vec to efficiently train word embeddings. It involves selecting pairs of words that do not app...
M1 preference data
Assume you are writing server-side code for an online shop. The code will be invoked over HTTP from a mobile app. Your current code is as follows: public class ShoppingCart { public void buy(Product product, int quantity) { if (product == null) { throw new IllegalArgumentException("product cannot be null");...
Introducing a "Thread.sleep" call at the beginning of the "buy" method is a poor idea because it artificially delays the execution, leading to a negative user experience and potential timeouts, while also complicating the codebase for no real benefit, which can mislead customers about actual performance improvements. ...
M1 preference data
Daemons are just long running processes. When applying mitigations to these processes, several aspects change. Which ones?
The correct options are: 0: ASLR becomes less effective as multiple requests across different users are handled in a single process. Explanation: ASLR relies on randomizing the memory layout to make it difficult for attackers to predict where critical data resides. Long-running daemons that handle multiple client requ...
M1 preference data
What differentiates VLIW processors from out-of-order superscalar processors?
VLIW (Very Long Instruction Word) processors and out-of-order superscalar processors differ primarily in how they handle instruction execution and resource management. Let's break down the key differences step by step: 1. **Instruction Issuance**: - **VLIW Processors**: VLIW architectures issue multiple instruction...
M1 preference data
Tick the \textbf{incorrect} assertion regarding plain Rabin, i.e., Rabin without any redundancy.
To identify the incorrect assertion regarding plain Rabin, let's analyze each statement: 1. **The Rabin Key Recovery Problem relies on the discrete logarithm problem.** - This is incorrect. The Rabin cryptosystem is not based on the discrete logarithm problem; it relies on the difficulty of factoring large intege...
M1 preference data
Imagine you're working at at JaaS, the Jokes-as-a-Service platform. With JaaS, everyone can be funny any time by having new jokes at their fingertips via a public API. Your first task is to convert user feedback into user stories. Here is one such piece of feedback: "Hi, I have been using your app for a long time, but ...
To convert the provided user feedback into a user story, we need to focus on the key elements that capture the user's needs and challenges without including unnecessary details. Here’s how to approach it step by step: ### Step 1: Identify the User The feedback comes from a user who has been using the app for a long ti...
M1 preference data
Select all of the regions that ASLR randomizes the address when PIE is not enabled in x86-64 Linux:
When Position Independent Executables (PIE) are not enabled in x86-64 Linux, Address Space Layout Randomization (ASLR) still randomizes certain regions. The regions that are randomized include: 1. **The heap** - The heap is randomized to prevent attackers from easily predicting where dynamic memory allocations will oc...
M1 preference data
Consider a classic pipeline with Fetch, Decode, Execute, Memory, and Writeback stages such as MIPS's. Give an example snippet made of 2-3 instructions (use any credible assembly language) which would benefit from a forwarding path between the Memory and Execute stage (assume that no other forwarding paths exist...
An example of instructions that would benefit from a forwarding path between the Memory and Execute stages is as follows: ``` lw r1, 0(r2) ; Load word from memory into r1 add r3, r1, r4 ; Add r1 (loaded value) to r4 and store result in r3 ``` In this snippet, the `add` instruction requires the value of `r1` that is...
M1 preference data
In Machine Learning, we want to learn the \textbf{parameters W} for the mapping function f: $y=f(x,W) +\epsilon$ where x is the input, y the output, and $\epsilon$ the error term.\\ (One or multiple answers)
The correct interpretations are: - **True**: When \( f: R → {1,..N}\), it is a classification task. - **True**: When \( f: R^M → {1,..N}\), it is also a classification task. - **False**: When \( f:R^M → R\), it is not a classification task; rather, it's typically considered as performing regression. - **True**: Convers...
M1 preference data
Imagine you're working at JaaS, the Jokes-as-a-Service platform. With JaaS, everyone can be funny any time by having new jokes at their fingertips via a public API. During the orientation at JaaS, the VP of engineering explains to you their workflow: 1. Branching: Developers must use a separate branch for each feature,...
The "Testing" directive should require developers to run tests on a Continuous Integration (CI) server after pushing code, in addition to local tests. This approach ensures consistent testing environments, enabling prompt identification of integration issues and fostering collaboration through immediate feedback. In ...
M1 preference data
Your input is "Distributed Information Systems". Your model tries to predict "Distributed" and "Systems" by leveraging the fact that these words are in the neighborhood of "Information". This model can be:
To determine which model best fits the description provided—predicting words based on their context in a neighborhood—we should consider each option in detail: 1. **Bag of Words**: This model represents text data as a set of words without considering their order or context. It simply counts the occurrences of words in...
M1 preference data
The Vernam cipher\dots
Answer:** 1 **Explanation:** The Vernam cipher is perfectly secure when the key is random, used only once, and kept secret. This makes it theoretically unbreakable, unlike other methods such as DES, which has fixed key sizes and vulnerabilities.
M1 preference data
Can one easily adapt the Spectre attack to Itanium? If so, give some hints on how different it will be from the classic attack and how potential victims could protect sensitive parts of their code. If not, explain why it is not possible.
Answer: Yes, one can adapt the Spectre attack to Itanium, but it will differ from the classic attack primarily due to lower control over timing. Explanation: Spectre leverages branch prediction and speculative execution, which is more limited in VLIW architectures like Itanium. However, Itanium's capability for specula...
M1 preference data
For this question, one or more assertions can be correct. Tick only the correct assertion(s). There will be a penalty for wrong assertions ticked.Which of the following associations can be considered as illustrative examples for inflectional morphology (with here the simplifying assumption that canonical forms are rest...
Let’s examine each option carefully to determine whether it represents an example of inflectional morphology. 1. **(activate, action)**: - Think about the relationship between these two words. Does "activate" change form to become "action"? No, these are different roots and represent different concepts. This pair ...
M1 preference data
Consider $GF(8)$ defined as $\mathbb{Z}_2[X]/(P(X))$ with $P(x) = X^3 + X + 1$. Compute $X^2 \times (X + 1)$ in $\mathbb{Z}_2[X]/(P(X))$
To compute \( X^2 \times (X + 1) \) in the field \( GF(8) \) defined as \( \mathbb{Z}_2[X]/(P(X)) \) with \( P(X) = X^3 + X + 1 \), we will follow these steps: 1. **Multiply the polynomials**: First, we perform the multiplication in \( \mathbb{Z}_2[X] \): \[ X^2 \times (X + 1) = X^2 \cdot X + X^2 \cdot 1 = X^3 +...
M1 preference data
Which one of these ciphers does achieve perfect secrecy?
To determine which cipher achieves perfect secrecy, we need to understand the concept of perfect secrecy and analyze each option. ### Definition of Perfect Secrecy: Perfect secrecy is a property of a cipher where the ciphertext reveals no information about the plaintext, regardless of the computational power of an att...
M1 preference data
Assume you decide to contribute to an open source project, by adding a feature to an existing class of the project. The class uses an underscore at the beginning of names then "camelCase" for private properties such as "_likeThis", but you find this odd because you're used to the "snake case" "like_this". Which option ...
**Reasoning:** When contributing to an open-source project, consistency with the existing codebase is crucial. In programming, naming conventions help maintain readability and clarity across the code. 1. **Understanding the Existing Convention:** The class uses an underscore at the beginning of property names followe...
M1 preference data
If rule {A,B} -> {C} has confidence c1 and rule {A} -> {C} has confidence c2, then
To analyze the relationship between the confidence values of the two rules {A,B} -> {C} and {A} -> {C}, we first need to understand what confidence means in the context of association rules. Confidence is defined as the probability of the consequent given the antecedent. Specifically: 1. For the rule {A,B} -> {C}, th...
M1 preference data
Assume you are working on SuperQuiz, a trendy app that lets everyone design quizzes and share them with friends! SuperQuiz recently hired a new CEO, who wants to improve the development practices using modern methods. However, this CEO has no engineering background, so the suggested improvements are well intentioned bu...
Answer:** The CEO's expectation that CI will ensure bug-free code and that all branches must pass tests daily is unrealistic and overly rigid, as it disregards the inherent nature of software development. **Explanation:** CI cannot guarantee bug-free code, and expecting all branches to pass tests daily is impractical,...
M1 preference data
Which of the following is true in the context of inverted files?
The correct option in the context of inverted files is: **'Index merging compresses an inverted file index on disk and reduces the storage cost.'** ### Rationale for the Correct Option: 1. **Index Merging**: Inverted files, which are essential for efficient searching in large text collections, often require maintena...
M1 preference data
Regarding the Expectation-Maximization algorithm, which one of the following false?
To determine which statement about the Expectation-Maximization (EM) algorithm is false, let's analyze each option step-by-step. 1. **Assigning equal weights to workers initially decreases the convergence time**: - In the context of the EM algorithm, initializing parameters (or weights) can significantly affect co...
M1 preference data
The data contains information about submissions to a prestigious machine learning conference called ICLR. Columns: year, paper, authors, ratings, decisions, institution, csranking, categories, authors_citations, authors_publications, authors_hindex, arxiv. The data is stored in a pandas.DataFrame format. Create two f...
To create the two new fields `has_top_company` and `has_top_institution` in your pandas DataFrame containing ICLR submissions data, you can follow these steps. This involves checking whether any of the authors are from the specified top companies or top institutions. ### Step-by-Step Breakdown 1. **Import Pandas Libr...
M1 preference data
Consider the following SCFG with the following probabilities: S → NP VP      0.8 S → NP VP PP      0.2 VP → Vi     {a1} VP → Vt NP     {a2} VP → VP PP         a NP → Det NN     0.3 NP → NP PP     0.7 PP → Prep NP    1.0 Vi → sleeps    1.0Vt → saw   1.0NN → man   {b1}NN → dog      bNN → telescope  ...
The value of a is 0.2. Explanation: In a stochastic context-free grammar (SCFG), the probabilities of production rules must sum to 1 for each non-terminal symbol. For the production rule VP → VP PP, we denote its probability as "a". We have the following productions for VP: 1. VP → Vi (probability 1.0) 2. VP → Vt ...
M1 preference data
As a group, write a function called minMax, which should take a non-empty array as input and return a pair containing the smallest and the largest element of the array. def minMax(a: Array[Int]): (Int, Int) = ??? Now write a parallel version of the function. You may use the constructs task and/or parallel, as seen in ...
Certainly! Below is the parallel version of the `minMax` function that finds the minimum and maximum of a non-empty `Array[Int]`. This implementation uses a threshold to decide whether to compute the values sequentially or in parallel. ```scala import scala.collection.parallel._ def minMax(a: Array[Int], threshold: I...
M1 preference data
What is TRUE regarding Fagin's algorithm?
Let's evaluate each of the answer options regarding Fagin's algorithm: 1. **'Posting files need to be indexed by TF-IDF weights'**: - **Incorrect**: Fagin's algorithm does not require posting files to be indexed by TF-IDF weights specifically. It is designed to handle ranked retrieval based on scores that can be c...
M1 preference data
Consider the cipher defined by $$\begin{array}{llll} C : & \{0,1\}^{4} & \rightarrow & \{0,1\}^{4} \\ & x & \mapsto & C(x)=x \oplus 0110 \\ \end{array} $$ The value $LP^C(1,1)$ is equal to
To calculate \( LP^C(1, 1) \) for the given cipher \( C(x) = x \oplus 0110 \), we first need to understand what \( LP^C(a, b) \) represents. Here, \( LP^C(a, b) \) denotes the probability that, given two inputs \( x_0 \) and \( x_1 \) such that \( x_0 \) and \( x_1 \) differ in exactly \( a \) bits, the outputs \( C(x_...
M1 preference data
What is the complexity of concatenation of two conc-trees with heights $h_1$ and $h_2$?
**Reasoning:** 1. A conc-tree (contraction tree) is a specialized structure often used in data compression and representation of sequences. The height of a conc-tree indicates the maximum number of edges from the root to any leaf. 2. Concatenating two conc-trees involves creating a new root node and attaching the root...
M1 preference data
Let $p$ and $q$ be two distinct prime numbers and let $x \in \mathbf{Z}_{pq}^*$. Which of the following assertion is always true in $\mathbf{Z}_{pq}^*$?
The correct answer is: '$x^{(p-1)(q-1)} = 1$'. ### Reasoning: In the multiplicative group of integers modulo \(n\), denoted as \(\mathbf{Z}_n^*\), the order of any element \(x\) that is coprime to \(n\) (which is the case for \(x \in \mathbf{Z}_{pq}^*\)) must divide \(\varphi(n)\), where \(\varphi\) is the Euler's to...
M1 preference data
Now let $\xv$ be a random vector distributed according to the uniform distribution over the finite centered dataset $\xv_1, . . . , \xv_N$ from above. % Consider the problem of finding a unit vector, $\wv \in \R^D$, such that the random variable $\wv^ op \xx$ has \emph{maximal} variance. What does it mean for the data ...
When we say that the data vectors \(\xv_1, \ldots, \xv_N\) are centered, it means that the mean of the dataset is zero. In mathematical terms, this can be expressed as: \[ \frac{1}{N} \sum_{i=1}^N \xv_i = \mathbf{0} \] This condition ensures that the dataset is centered around the origin in the \(D\)-dimensional spac...
M1 preference data
In the setting of EM, where $x_{n}$ is the data and $z_{n}$ is the latent variable, what quantity is called the posterior?
The posterior distribution in Bayesian statistics is defined as \( p(z_n \mid x_n, \boldsymbol{\theta}) \). This represents our updated belief about the latent variable \( z_n \) after observing the data \( x_n \) and considering parameters \( \boldsymbol{\theta} \). Now, let’s evaluate the options: 1) **(a)** \( p(x...
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 tw...
To determine whether the result of `scanRight1` is the same as the result of `scanLeft1` on the reversed sequence, we need to analyze the definitions and properties of the operations and the function involved. ### Definitions Recap: 1. **scanRight1**: - Given a function \( f \) of two arguments and a sequence \( a_...
M1 preference data
The MIPS R10000 fetches four instructions at once and, therefore, there are four such circuits working in parallel inside the processor. What do ``WrPtr'' and ``RdPtr'' represent, respectively? Very briefly explain what they are used for and when their value changes.
In the context of the MIPS R10000 processor, WrPtr (Write Pointer) and RdPtr (Read Pointer) are used to manage the instruction fetch and execution from the instruction cache or instruction buffer. WrPtr (Write Pointer): This pointer indicates where the next fetched instruction will be written in the instruction buffer...
M1 preference data
Which of the following statements about mitigations are true?
The correct statements about mitigations are: **A. The bug remains in the application, mitigations simply make exploitation harder** **B. The performance of certain mitigations depends on underlying architecture features (e.g., i386 versus x86-64)** ### Explanation: **A. The bug remains in the application, mitigat...
M1 preference data
Let $A \in \mathbb{R}^{m\times n}$, $b\in \mathbb{R}^m$ and $c\in \mathbb{R}^n$. Consider the following linear program with $n$ variables: \begin{align*} \textbf{maximize} \hspace{0.8cm} & c^Tx \\ \textbf{subject to}\hspace{0.8cm} & Ax =b \\ \hspace{0.8cm} & x \geq 0 \end{align*} Show that any extreme point $x^*$ has a...
To establish that any extreme point \( x^* \) of the linear program has at most \( m \) non-zero entries, we can approach the problem methodically. Let's break down the reasoning step-by-step, while also considering the implications of linear dependence among the columns of the matrix \( A \). ### Step 1: Definition o...
M1 preference data
Suppose that in a given FP Tree, an item in a leaf node N exists in every path. Which of the following is TRUE?
In an FP Tree, which is a data structure used for frequent pattern mining, if an item N is located in a leaf node and appears in every path from the root to the leaves, we can evaluate several statements regarding its properties. First, consider the statement that "N co-occurs with its prefixes in every transaction." ...
M1 preference data
You are given an i.i.d source with symbols taking value in the alphabet $\mathcal{A}=\{a,b,c,d\}$ and probabilities $\{1/8,1/8,1/4,1/2\}$. Consider making blocks of length $n$ and constructing a Huffman code that assigns a binary codeword to each block of $n$ symbols. Choose the correct statement regarding the average ...
The correct answers are B) and D). B) It strictly decreases as \( n \) increases because as the block length increases, the probability distribution of the blocks tends to become more uniform. This allows for more efficient encoding and reduces the average codeword length per source symbol. D) In going from \( n \) t...
M1 preference data
Which of the following problems has not been shown equivalent to the others?
- **RSA Key Recovery Problem**: This problem involves recovering the private key from the public key and the ciphertext. It is generally considered hard if the RSA modulus is sufficiently large. - **RSA Decryption Problem**: This problem refers to decrypting a ciphertext using the public key. It can be seen as a strai...
M1 preference data
A monad M is a parametric type M[T] with two operations, flatMap and unit: extension [T, U](m: M[T]) def flatMap(f: T => M[U]): M[U] def unit[T](x: T): M[T] To qualify as a monad, a type has to satisfy the three following laws for all m: M[T], x: T, f: T => M[U] and g: U => M[V]: (Associativity) m.flatMap(f).flatMap(g)...
Yes, the `List` type, using its standard `flatMap` method and defining `unit(x) = List(x)`, is indeed a monad. Let’s break it down. 1. **Operations**: - The `unit` operation takes a single value and creates a `List`. For example, `unit(5)` produces `List(5)`. - The `flatMap` operation takes a `List` and a functi...
M1 preference data
Tick the \textbf{\emph{incorrect}} assertion.
To find the incorrect assertion, let’s look at each option: 1. **$P \subseteq NP$**: This must be true because if you can solve a problem quickly (in P), you can also check the solution quickly (in NP). 2. **$NP \subseteq IP$**: This one seems right too. Interactive proofs can probably handle NP problems since they i...
M1 preference data
Suppose that for points p, q, and t in metric space, the following hold:p is density-reachable from q t is density-reachable from qp is density-reachable from tWhich of the following statements is false?
To solve the problem, we need to analyze the relationships between the points \( p \), \( q \), and \( t \) in the context of density-reachability and density-connectivity in a metric space. Let's break down the statements step-by-step: ### Key Concepts: 1. **Density-Reachability**: A point \( x \) is density-reachabl...
M1 preference data
Once paging is enabled, load instruction / CR3 register / Page Table entry uses Virtual or Physical address?
When paging is enabled: 1. The load instruction uses a **Virtual** address because the CPU operates with virtual addresses. 2. The CR3 register, which holds the base address of the page table, uses a **Physical** address because it points to physical memory locations. 3. The Page Table entry contains the mapping of vi...
M1 preference data
Your team is developing a library that is mostly intended to be used by your company's own applications, but the library is nevertheless distributed via a public repo on GitHub. It contains the following java function: "public InputStream convertToPdf(Document document) throws GoogleServerNotRespondingError" This libra...
Answer:** The maintainability issue with `convertToPdf` is an example of an "abstraction leak," where specific implementation details (such as a dependency on a Google service) are exposed through its exception handling. This forces users to manage these details, complicating error handling and reducing the library's f...
M1 preference data
You have just started your prestigious and important job as the Swiss Cheese Minister. As it turns out, different fondues and raclettes have different nutritional values and different prices: \begin{center} \begin{tabular}{|l|l|l|l||l|} \hline Food & Fondue moitie moitie & Fondue a la tomate & Raclette & Requirement pe...
{ "answer1": { "objective": "Minimize the total cost of the fondues and Raclette.", "variables": { "x1": "kg of Fondue moitie moitie", "x2": "kg of Fondue a la tomate", "x3": "kg of Raclette" }, "objective_function": "Minimize Z = 50x1 + 75x2 + 60x3", "constraints": { "vita...
M1 preference data
Tick the \emph{false} assertion about Diffie and Hellman.
To determine the false assertion about Diffie and Hellman, we need to analyze each of the provided options in the context of their contributions to cryptography. 1. **"They wrote an article entitled 'New directions in Cryptography' in 1976."** This statement is true. Diffie and Hellman published their seminal pap...
M1 preference data
Assume we are in a group $G$ of order $n = p_1^{\alpha_1} p_2^{\alpha_2}$, where $p_1$ and $p_2$ are two distinct primes and $\alpha_1, \alpha_2 \in \mathbb{N}$. The complexity of applying the Pohlig-Hellman algorithm for computing the discrete logarithm in $G$ is \ldots (\emph{choose the most accurate answer}):
3: $\mathcal{O}( \alpha_1 \sqrt{p_1} + \alpha_2 \sqrt{p_2})$. This option is relevant under specific contexts, such as when you use the number of elements in the cyclic subgroups generated by the factors of the group order. The complexity can be analyzed based on the square root of the size of the group in each prime ...
M1 preference data
Which statement is false about clustering?
The false statement is: "DBSCAN is a deterministic algorithm." DBSCAN can yield different results based on the order of the data points and the choice of parameters, making it non-deterministic.
M1 preference data
Implement Community Influencers by doignt he following steps: - Isolate each community from the graph. - Select the node with the **maximum pagerank** within each community as the **influencer** of that community. - Break ties arbitrarily. - Hint: Useful functions: `nx.pagerank()`, `G.subgraph()`.
```python import networkx as nx def community_influencers(G, communities): influencers = {} for community in communities: # Isolate the community subgraph subgraph = G.subgraph(community) # Calculate PageRank for the subgraph pagerank_scores = nx.pagerank(subgraph)...
M1 preference data
Homer, Marge, and Lisa Simpson have decided to go for a hike in the beautiful Swiss Alps. Homer has greatly surpassed Marge's expectations and carefully prepared to bring $n$ items whose total size equals the capacity of his and his wife Marge's two knapsacks. Lisa does not carry a knapsack due to her young age. More ...
To prove that Lisa needs to carry at most one item, we consider an extreme point \( x^* \) of the linear program based on the specified constraints. 1. Recall that \( x_{iH} + x_{iM} \leq 1 \) for all items \( i \), meaning each item can either be assigned to Homer or Marge, but not both. 2. The total sizes assigned ...
M1 preference data
Implement Discounted Cumulative Gain. DCG is a retrieval metric that also takes into account the ordering of the result. The DCG accumulated at a rank $k$ is defined as: $DCG_k = \sum_{i=1}^k \frac{grade[i]}{log_2(i+1)}$ where $grade[i]$ is the relevance score given by the user for the result at position $i$. Hin...
To implement the Discounted Cumulative Gain (DCG) metric, we will follow the mathematical definition provided in the question. The DCG at rank \( k \) is calculated by summing the relevance scores of the top \( k \) results, adjusted by the logarithm of their rank position. Here's the step-by-step breakdown of the imp...
M1 preference data
Which algorithm can be typically used in order to generate a prime number?
1. Answer: C 2. Concept: The core concept here is the generation of prime numbers, specifically through probabilistic primality testing methods. 3. Elimination: - A: The Left to Right Algorithm does not pertain to prime number generation; it is not recognized as a standard algorithm for this purpose. - B: The Extende...
M1 preference data
In an automated email router of a company, we want to make the distinction between three kind of emails: technical (about computers), financial, and the rest ('irrelevant'). For this we plan to use a Naive Bayes approach. What is the main assumption made by Naive Bayes classifiers? Why is it 'Naive'? We will consider ...
To classify the emails using a Naive Bayes approach, we first need to understand the main assumption of Naive Bayes classifiers and why it is referred to as "Naive". ### Main Assumption of Naive Bayes Classifiers The primary assumption made by Naive Bayes classifiers is the **conditional independence** of features. Th...
M1 preference data
You are given the task of choosing the parameters of a hash function. What value of the output will you recommend in order to be minimal and secure against second preimage attacks?
Answer: 160 bits Explanation: This output size is considered a secure minimum for modern cryptographic hash functions, providing a sufficient level of security against second preimage attacks while balancing performance and resource efficiency.
M1 preference data