question
stringlengths
6
13.7k
text
stringlengths
1
25.8k
source
stringclasses
3 values
The collision resistance property of a hash function $H$ means that it is infeasible to\dots
To evaluate the options, we need to understand what collision resistance means in the context of a cryptographic hash function. **Collision Resistance**: A hash function \( H \) is said to be collision-resistant if it is infeasible to find two distinct inputs that hash to the same output. In other words, given the has...
M1 preference data
Consider a learning algorithm that has the property that it depends only very weakly on the input data. E.g., this could be SGD where we choose a very small step size and only run for very few iterations. To go to the extreme, you can imagine a learning algorithm that always outputs the same model irrespective of the t...
To analyze the situation described, let’s break down the options in relation to a learning algorithm that depends very weakly on the input data. 1. **(a) Such a learning algorithm typically has a much larger generalization error than training error.** - This is not necessarily true. If the learning algorithm output...
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 work of the `contains` function when called on a `List`, we need to consider each part of the function and how it behaves with a `List` as the input. ### Step 1: Understanding the Function The `contains` function works as follows: 1. It first checks the size of the iterable `l`. 2. If the ...
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");...
Using a checked exception for a null product in this context is not a good idea because checked exceptions are typically reserved for recoverable conditions that can be handled by the caller, while a null product indicates a programming error that should be caught early (e.g., by validating input before invoking the me...
M1 preference data
Suppose that you can prove the security of your symmetric encryption scheme against the following attacks. In which case is your scheme going to be the \textbf{most} secure?
### Restate the Question: The question asks which type of attack your symmetric encryption scheme can withstand that would make it the most secure. ### Explain Key Concepts: This question assesses your understanding of different types of attacks on encryption schemes, specifically focusing on key recovery and decrypti...
M1 preference data
Let $X$ and $K$ be two independent random variables in a group $G$ with $n$ elements and where $K$ is uniformly distributed over $G$. Let $Y = X+K$. Then, for any $y\in G$, $\Pr[Y=y]=$\dots
### Step 1: Understanding the Setup We have two independent random variables \(X\) and \(K\) defined on a group \(G\) with \(n\) elements. The variable \(K\) is uniformly distributed over \(G\), meaning that for any element \(g \in G\), \(\Pr[K = g] = \frac{1}{n}\). ### Step 2: Analyzing Y The random variable \(Y\) is...
M1 preference data
What is the asymptotic work of parGroupyBy2?
To analyze the asymptotic work of a function like `parGroupBy2`, we need to first understand what the function is doing. Generally, functions with names like `parGroupBy2` suggest that they are performing some kind of parallel grouping operation on a collection of data, possibly involving pairwise operations. ### Key ...
M1 preference data
Tick the \textbf{incorrect} assertion.
To determine the incorrect assertion, let's analyze each statement step by step: "One should use RSA-OAEP instead of plain RSA." This is correct. RSA-OAEP (Optimal Asymmetric Encryption Padding) adds padding to the plaintext, which helps to achieve semantic security. It protects against certain attacks that could be ...
M1 preference data
Recall the online bin-packing problem that we saw in Exercise Set $10$: We are given an unlimited number of bins, each of capacity $1$. We get a sequence of items one by one each having a size of at most $1$, and are required to place them into bins as we receive them. Our goal is to minimize the number of bins we use,...
### Online Algorithm for Bin Packing #### (i) Algorithm Design: We will use a **First-Fit Decreasing** strategy with a slight modification based on the parameter \(\epsilon\). 1. **Initialization**: Start with an empty list of bins. 2. **Item Arrival**: For each incoming item of size \(s_i\) (where \(0 < s_i \leq \e...
M1 preference data
Assume that some of your colleagues work on an AI-based image generation service, where a user enters a topic, and the AI generates a synthetic photo on that topic. They tell you the following about this service: "Currently, the user types in the topic they want to see images for, and the client app sends a request to ...
I apologize for any confusion in my previous response. Let me clarify: if the image generation process takes about 1 second per image and generates 9 images, the total time for this process is around 9 seconds. If optimizing the image generation can save 30% of this time, it would reduce the generation time to approxim...
M1 preference data
Given the following teleporting matrix (Ε) for nodes A, B and C:[0    ½    0][0     0    0][0    ½    1]and making no assumptions about the link matrix (R), which of the following is correct:(Reminder: columns are the probabilities to leave the respective node.)
To analyze the teleporting matrix (?) provided for nodes A, B, and C, we can represent it in a clearer format: \[ \text{Teleporting Matrix (?)} = \begin{bmatrix} 0 & \frac{1}{2} & 0 \\ 0 & 0 & 0 \\ 0 & \frac{1}{2} & 1 \end{bmatrix} \] This matrix indicates the probabilities of transitioning from one node to another: ...
M1 preference data
Let $n=pq$ be a RSA modulus and let $(e,d)$ be a RSA public/private key. Tick the \emph{correct} assertion.
To analyze the assertions provided regarding RSA and the properties of the modulus \( n = pq \), where \( p \) and \( q \) are distinct prime numbers, and the public/private key pair \( (e, d) \), let’s examine each statement one by one: 1. **Finding a multiple of \( \lambda(n) \) is equivalent to decrypt a cipherte...
M1 preference data
The worst case complexity of an exaustive search (with memory) against DES is\dots
Answer: $2^{56}$ Reasoning: The Data Encryption Standard (DES) uses a 56-bit key, meaning there are $2^{56}$ possible keys for exhaustive search. In the worst-case scenario, one would need to try all possible keys, which results in a complexity of $2^{56}$.
M1 preference data
Consider the following matrix-factorization problem. For the observed ratings $r_{u m}$ for a given pair $(u, m)$ of a user $u$ and a movie $m$, one typically tries to estimate the score by $$ f_{u m}=\left\langle\mathbf{v}_{u}, \mathbf{w}_{m}\right\rangle+b_{u}+b_{m} $$ Here $\mathbf{v}_{u}$ and $\mathbf{w}_{m}$ are v...
To address the problem of recommending movies to a new user who has not provided any ratings, one can employ several strategies that mitigate the challenges associated with cold-start scenarios. Here are some commonly used approaches: 1. **Content-Based Filtering**: This method leverages the attributes of the movies (...
M1 preference data
Which of the following properties is part of the RDF Schema Language?
In the context of the RDF Schema (RDFS) language, the correct answer is **D. Domain**. RDF Schema includes a set of classes and properties that allow you to describe the relationships between different resources. Among these properties, "domain" is used to specify that a certain property applies only to instances of a...
M1 preference data
Select all statements that are true.A penalty will be applied for any wrong answers.
To answer this multiple choice question, we need to evaluate each statement about parsers, syntax, and semantics in the context of computational linguistics and natural language processing. Let's break down each statement one by one. ### Understanding the Statements 1. **Statement 1**: "The analyzer functionality of ...
M1 preference data
Consider the following code transformation: egin{verbatim} r3 = r3 << 4 r4 = r4 << 4 st [r3] = r2 ld r1 = [r4] r5 = r3 + 4 r1 = r1 + 1...
To correct the given code transformation while maintaining the intended operations and order, we need to ensure that the operations are performed in a way that prevents data hazards, particularly when using data that may not be ready. The original code performs a store operation followed by a load operation that depend...
M1 preference data
Your aim is to evaluate a Tweet analysis system, the purpose of which is to detect whether a tweet is offensive. For each Tweet processed, such a system outputs one of the following classes: "hateful", "offensive" and "neutral".To perform your evaluation, you collect a large set of Tweets and have it annotated by tw...
To evaluate a Tweet analysis system that classifies tweets as "hateful," "offensive," or "neutral," we need to choose metrics that effectively measure the performance of the system, especially given the class imbalance in the dataset (1% "hateful" and 4% "offensive" tweets). Here’s a breakdown of the metrics provided a...
M1 preference data
Tick the \textbf{false} statement.
The false statement is: **'The CRT states $\mathbb{Z}_{mn} \equiv \mathbb{Z}_{m} \cup \mathbb{Z}_{n}$.** **Explanation:** 1. **RSA can be accelerated by using CRT (Chinese Remainder Theorem).** - True. The CRT can be used in RSA to speed up the decryption process by allowing calculations modulo smaller numbers. 2. ...
M1 preference data
Which of the following is equivalent to \((10001)_2\) ? (Multiple answers can be correct)
The binary number \((10001)_2\) is equivalent to \((17)_{10}\). Calculating: \[ (10001)_2 = 1 \cdot 2^4 + 0 \cdot 2^3 + 0 \cdot 2^2 + 0 \cdot 2^1 + 1 \cdot 2^0 = 16 + 0 + 0 + 0 + 1 = 17 \] Now checking the other options: - \((F0)_{16} = 15 \cdot 16^1 + 0 \cdot 16^0 = 240\), not equal to 17. - \((23)_{8} = 2 \cdot 8^1...
M1 preference data
Thang, Jeremie and Tugrulcan have built their own search engines. For a query Q, they got precision scores of 0.6, 0.7, 0.8  respectively. Their F1 scores (calculated by same parameters) are same. Whose search engine has a higher recall on Q?
To determine whose search engine has a higher recall, we need to understand the relationship between precision, recall, and the F1 score. The F1 score is the harmonic mean of precision and recall, and it can be calculated using the formula: \[ F1 = 2 \times \frac{(Precision \times Recall)}{(Precision + Recall)} \] G...
M1 preference data
What is/are the goal/s of compartmentalization?
The goals of compartmentalization are primarily to: 1. Isolate faults to individual (ideally small) components. 2. Allow easier abstraction of functionalities across components. 4. Better performance (i.e., lower overhead) since a compartment can fail without affecting others. Option 3, "Make faults more severe as t...
M1 preference data
Professor Ueli von Gruy\`{e}res has worked intensely throughout his career to get a good estimator of the yearly consumption of cheese in Switzerland. Recently, he had a true breakthrough. He was able to design an incredibly efficient randomized algorithm \Alg that outputs a random value $X$ satisfying \begin{align*} \...
Imagine trying to find out how much cheese people eat in Switzerland, like guessing the number of jellybeans in a jar. If you only take a few samples, your guess might be way off. However, if you take more samples and apply some smart statistical tricks, you can get a much better estimate! Professor Ueli von Gruyères ...
M1 preference data
If an adversary mounts a chosen plaintext attack, it means he can\dots
To determine the correct answer about what an adversary can do in a chosen plaintext attack, let's analyze the options provided. 1. "Do nothing except for just observing the encrypted messages on the channel." - This option seems incorrect because in a chosen plaintext attack, the adversary is not limited to passive o...
M1 preference data
In this problem we are going to investigate the linear programming relaxation of a classical scheduling problem. In the considered problem, we are given a set $M$ of $m$ machines and a set $J$ of $n$ jobs. Each job $j\in J$ has a processing time $p_j > 0$ and can be processed on a subset $N(j) \subseteq M$ of the machi...
To tackle the scheduling problem, we need a concise rounding algorithm derived from the linear programming (LP) relaxation. Here’s a clear, step-by-step approach to develop this algorithm. ### Step 1: Problem Overview We have a set of machines \( M \) and jobs \( J \). Each job \( j \) has a processing time \( p_j \) ...
M1 preference data
What does it mean that a processor supports precise exceptions?
In computer architecture, a processor that supports precise exceptions ensures that when an exception (such as an interrupt or error) occurs, the state of the program can be accurately and unambiguously restored to a point just before the exception was raised. This capability is crucial for maintaining the correctness ...
M1 preference data
Select \emph{incorrect} statement. Brithday paradox
To identify the incorrect statement regarding the birthday paradox, let's analyze each option step-by-step. 1. **is a brute force technique.** - This statement is somewhat misleading. The birthday paradox itself is not a brute force technique; rather, it describes a probabilistic method for finding collisions in ha...
M1 preference data
Freshly graduated from EPFL, you have been hired as contractors for a successful and rapidly growing bank. The bank has been experiencing problems with their money management system recently, which is written in Scala, and so they hired the best and brightest young engineer they could find: you! The system had been wor...
### Understanding the Transfer Method To analyze the `transfer` method in the provided code, we will evaluate how it operates under a sequential execution environment, ensuring that the two properties—non-negativity of account balances and the invariance of total bank funds—are maintained. ### Property 1: Non-negativ...
M1 preference data
Tick the \emph{correct} statement. $\Sigma$-protocols \ldots
The correct statement is: - **consist of protocols between a prover and a verifier, where the verifier is polynomially bounded.** **Justification:** $\Sigma$-protocols are a specific type of interactive proof system that involve a prover and a verifier. In the context of cryptographic protocols, the verifier is typic...
M1 preference data
Let $\mathcal{R}_{p}(f, \varepsilon)$ be the $\ell_{p}$ adversarial risk of a classifier $f: \mathbb{R}^{d} \rightarrow\{ \pm 1\}$, i.e., $$ \mathcal{R}_{p}(f, \varepsilon)=\mathbb{E}_{(\mathbf{x}, y) \sim \mathcal{D}}\left[\max _{\tilde{\mathbf{x}}:\|\mathbf{x}-\tilde{\mathbf{x}}\|_{p} \leq \varepsilon} \mathbb{1}_{\{...
To analyze the relationships between the $\ell_p$ adversarial risks, we first need to understand the definitions and implications of the norms involved. The adversarial risk $\mathcal{R}_{p}(f, \varepsilon)$ measures the worst-case probability of misclassification under perturbations of the input $\mathbf{x}$ that are ...
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 anoth...
To create the new `reputation` field in your DataFrame, you will compute the logarithm for each last author based on their citation and publication counts. Here's a step-by-step guide to accomplish this using pandas: 1. **Access the Last Author**: First, extract the last author from the `authors` column. 2. **Get Cita...
M1 preference data
Tick the \emph{false} assertion. The ambiguity issue in the decryption algorithm of the Rabin cryptosystem can be solved by\dots
The correct answer is option 1: "encrypting the message twice." Here's why this assertion is false: In the Rabin cryptosystem, decryption can lead to multiple possible plaintexts because of the mathematical properties of the encryption function. Simply encrypting the message twice does not resolve the ambiguity; it c...
M1 preference data
Which one of these attacks is not a side channel attack?
To determine which of the given options is not a side channel attack, let's analyze each one: 1. **Sound analysis**: This is indeed a side channel attack. It exploits sound emissions from a device to gather information, such as the operation of cryptographic algorithms. 2. **Electromagnetic fields analysis**: This is...
M1 preference data
Which of the following are part of the RDF schema language?
The Resource Description Framework (RDF) Schema (RDFS) is a semantic web standard that provides a basic structure for describing the relationships between resources in RDF. Let's evaluate each of the statements you provided to determine which are part of the RDF schema language: 1. **The « type » statement for RDF res...
M1 preference data
In x86, what are the possible ways to transfer arguments when invoking a system call? For example, in the following code, string and len are sys_cputs’s arguments.
In the x86 architecture, arguments can be transferred when invoking a system call primarily using the following methods: A. **Stack**: Arguments can be passed via the stack. This method involves pushing the arguments onto the stack before making the system call. The system call handler then retrieves the arguments fro...
M1 preference data
If process i fails, then eventually all processes j≠i fail Is the following true? If all processes j≠i fail, then process i has failed
Answer: False. Explanation: The failure of all processes j≠i does not imply that process i has failed; it is possible for process i to remain operational while others have failed.
M1 preference data
Tick the \textbf{false} statement.
Let's analyze each statement to identify the false one. Statement 1: "The cardinality of ( E_{a,b}(\mathsf{GF}(q)) ) is bounded by ( q+1+2\sqrt{q} )." This statement is true. For elliptic curves defined over finite fields, the number of points on the curve ( E_{a,b} ) over ( \mathsf{GF}(q) ) is given by a result rela...
M1 preference data
In Ranked Retrieval, the result at position k is non-relevant and at k+1 is relevant. Which of the following is always true? Hint: P@k and R@k are the precision and recall of the result set consisting of the k top-ranked documents.
To analyze the situation in the context of information retrieval, let's first clarify the terms involved: 1. **Precision (P@k)**: This is the ratio of relevant documents among the top k retrieved documents. Specifically: \[ P@k = \frac{\text{Number of relevant documents in top k}}{k} \] 2. **Recall (R@k)**: This m...
M1 preference data
Which of the following is false regarding K-means and DBSCAN?
The correct option is **3. K-means does many iterations, while DBSCAN does not**. **Explanation:** 1. **K-means does not handle outliers, while DBSCAN does**: This statement is true. K-means can be significantly affected by outliers because it uses the mean of the clusters, which can be skewed by extreme values. In c...
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,...
A better alternative to the merging directive would be to require at least one or two approving reviews from colleagues before merging the PR. This approach ensures that the code has been adequately reviewed by team members familiar with the feature, thereby reducing the risk of merging buggy code and enhancing overall...
M1 preference data
Under certain conditions, maximizing the log-likelihood is equivalent to minimizing mean-squared error for linear regression. The mean-squared error can be defined as $\mathcal{L}_{m s e}(\mathbf{w}):=$ $\frac{1}{2 N} \sum_{n=1}^{N}\left(y_{n}-\widetilde{\mathbf{x}}_{n}^{\top} \mathbf{w}\right)^{2}$ and $y_{n}=\widetil...
To explore the necessary condition for the equivalence between maximizing the log-likelihood and minimizing the mean-squared error (MSE) in linear regression, we must analyze the probabilistic model provided. The model states that the observed target variable \( y_n \) is a linear combination of features \( \widetilde{...
M1 preference data
Principle Component Analysis (PCA) is a technique for...
A. Dimensionality reduction and C. Feature extraction.** Justification: PCA is primarily recognized for its role in dimensionality reduction, as it transforms high-dimensional data into a lower-dimensional space while retaining the most variance. However, it's also important to note that PCA can be viewed as a feature ...
M1 preference data
Tick the \emph{incorrect} assertion. In hypothesis testing \ldots
The correct answer is option 4: "a distinguisher with a single sample obtains always a better advantage than one that has access to $2$ samples." This statement is incorrect because having access to more samples generally increases the distinguishability between two distributions, thereby improving the advantage of the...
M1 preference data
Let $p$ be a prime number. What is the cardinality of $\mathbf{Z}_p$?
To explain the solution to the question regarding the cardinality of \(\mathbf{Z}_p\), let's first clarify what \(\mathbf{Z}_p\) means and then go through the reasoning step by step. ### Step 1: Understanding \(\mathbf{Z}_p\) The notation \(\mathbf{Z}_p\) typically refers to the set of integers modulo \(p\), which is...
M1 preference data
Tick the \textit{incorrect} assertion.
To identify the incorrect assertion, let's analyze each statement: 1. **Plain CBCMAC resists forgery attacks.** - This assertion is generally true. CBC-MAC (Cipher Block Chaining Message Authentication Code) is designed to provide authenticity and resists forgery attacks under certain conditions (e.g., it should no...
M1 preference data
For each of the sub-questions of this question (next page), tick/check the corresponding box if the presented sentence is correct at the corresponding level (for a human). There will be a penalty for wrong boxes ticked/checked.Some sentences is hard understand to.
The sentence "Some sentences is hard understand to" contains a lexical error. Specifically, the phrase "hard understand to" is an improper construction in English; the correct form should be "hard to understand." While there is also a syntactic error in the subject-verb agreement ("is" should be "are"), the primary iss...
M1 preference data
Select the \emph{weakest} algorithm.
The answer is 4, and I choose this because A5/1 represents the most basic form of the algorithm, typically characterized by a lower level of complexity and fewer operational capabilities compared to A5/2, A5/3, and A5/4, which generally incorporate more advanced techniques and optimizations that enhance their performan...
M1 preference data
It is often desirable to be able to express the performance of an NLP system in the form of one single number, which is not the case with Precision/Recall curves. Indicate what score can be used to convert a Precision/Recall performance into a unique number. Give the formula for the corresponding evaluation metric, and...
The F1 score can be used to express the performance of an NLP system as a single number from Precision/Recall curves. The F1 score is the harmonic mean of Precision (P) and Recall (R), providing a balance between the two metrics. The formula for the F1 score is: \[ F1 = 2 \times \frac{P \times R}{P + R} \] To weigh...
M1 preference data
Tonelli Algorithm is for ...
The Tonelli Algorithm is specifically designed for **finding the square-root of an integer in \(\mathbb{Z}_p^*\)**, where \(p\) is a prime number. This algorithm is used to find a solution \(x\) to the congruence \(x^2 \equiv a \mod p\) when \(a\) is a quadratic residue modulo \(p\). Thus, the correct answer is: - *...
M1 preference data
Which of the following statement(s) is/are true? To achieve memory safety for C, ...
To determine which statements about achieving memory safety for C are true, let's clarify what memory safety means in the context of C programming and evaluate each option one by one. 1. **Pointer arithmetic must be checked/restricted**: - **True**: Pointer arithmetic in C can lead to out-of-bounds access, which ...
M1 preference data
How does matrix factorization address the issue of missing ratings?
The correct answer is: **'It performs gradient descent only for existing ratings.'** **Reasoning:** Matrix factorization is a technique commonly used in collaborative filtering for recommendation systems. When dealing with a user-item rating matrix that contains missing values (i.e., not every user has rated every ite...
M1 preference data
If the first column of matrix L is (0,1,1,1) and all other entries are 0 then the authority values
1:False:Authority values must sum to 1; (0,1,1,1) does not satisfy this condition. Summary: Authority values need normalization; (0,1,1,1) does not represent valid authority scores. Reason: This vector has values summing to 2, not 1. 2:True:This vector is normalized, summing to 1, and represents a valid distributi...
M1 preference data
What adversarial model does not make sense for a message authentication code (MAC)?
To analyze which adversarial model does not make sense for a message authentication code (MAC), let’s examine each option carefully. ### 1. Key Recovery **Analysis**: Key recovery refers to an adversary's ability to recover the secret key used in the MAC scheme. This is generally not a desirable trait for any cryptogr...
M1 preference data
Consider the following context-free grammar, where S is the top-level symbol, upper-case letters denotes non-terminals and lower case letters denotes terminals:S → T A S → B A S → A B S → b A → A C A → a T → A B B → b C → c Except the first one, the next questions are based on filling the cells of the chart used b...
To determine how many parse trees can be constructed for the input string "acbac" using the given context-free grammar (CFG) with the CYK algorithm, we need to follow these steps: 1. **Identify the Grammar Rules**: We have the following production rules: - S → T A - S → B A - S → A B - S → b - A → A C ...
M1 preference data
Assume you are working on a mobile application. You meet a client while out for coffee, who tells you: "I noticed it's not possible to customize the profile picture. I know you have a lot of stuff to do this sprint, but my boss is threatening to switch to another app, could you get this fixed during this sprint?" In on...
**Plan:** 1. Acknowledge the client's concern about the inability to customize the profile picture. 2. Express understanding of the urgency due to the client’s situation with their boss. 3. Offer a realistic solution by indicating the possibility of prioritizing this feature. 4. Suggest a timeline for when the client c...
M1 preference data
Assume we have $N$ training samples $(\xx_1, y_1), \dots, (\xx_N, y_N)$ where for each sample $i \in \{1, \dots, N\}$ we have that $\xx_i \in \R^d$ and $y_i \in \{-1, 1\}$. We want to classify the dataset using the exponential loss $L(\ww) = rac{1}{N} \sum_{i=1}^N \exp (-y_i \xx_i^ op \ww )$ for $\ww \in \R^d$. Whic...
Let's analyze the exponential loss function \(L(\ww) = \frac{1}{N} \sum_{i=1}^N \exp(-y_i \xx_i^\top \ww)\) step by step: ### Step 1: Key Facts about the Exponential Loss 1. **Convexity**: The exponential function \(\exp(x)\) is convex, and since \(L(\ww)\) is a sum of convex functions (each term depends on \(-y_i \xx...
M1 preference data
Hypothesize a reason for the difference in performance between the Linear regression and the Gradient Boosting Regressor.
The difference in performance between Linear Regression and the Gradient Boosting Regressor may stem from how each model handles complexity in the data. Linear Regression assumes a linear relationship, which can limit its ability to capture intricate patterns. In contrast, Gradient Boosting can model non-linear relatio...
M1 preference data
Since exploiting the cache side-channel requires precise time measurement, many security researchers suggest reducing the precision of this time measurement. Can this proposal fully disable all possible cache side-channel attacks? Discuss.?
No. Understanding Cache Side-Channel Attacks: These attacks exploit the timing differences in accessing cached data. Time Measurement Precision: Reducing precision may obscure detailed timing, making it harder to exploit some side channels. Limitations: Attackers may still gather statistical data over many operatio...
M1 preference data
The number of parameters of the fasttext classifier and the simple self-attention classifier
Are the same. This choice is valid because both the fastText classifier and a simple self-attention classifier can have comparable parameter counts depending on their configurations. FastText uses a technique that captures semantic information through word embeddings and can vary in size based on the vocabulary and em...
M1 preference data
Consider a binary classification problem with a linear classifier $f(\mathbf{x})$ given by $$ f(\mathbf{x})= \begin{cases}1, & \mathbf{w}^{\top} \mathbf{x} \geq 0 \\ -1, & \mathbf{w}^{\top} \mathbf{x}<0\end{cases} $$ where $\mathbf{x} \in \mathbb{R}^{3}$. Suppose that the weights of the linear model are equal to $\math...
The answer is option 5: To find the minimum-norm adversarial example for the given point \(\mathbf{x} = (-1, 3, 2)\) with the linear classifier defined by \(\mathbf{w} = (4, 0, -3)\), we need to solve the optimization problem that involves finding a perturbation \(\boldsymbol{\delta}\) such that the new point \(\mathbf...
M1 preference data
For this homework you will use a dataset of 18,403 music reviews scraped from Pitchfork¹, including relevant metadata such as review author, review date, record release year, review score, and genre, along with the respective album's audio features pulled from Spotify's API. The data consists of the following columns: ...
To create a new column 'album_number' that indicates how many albums an artist has produced before the current one in the dataset, we can follow these steps: ### Step 1: Understand the Data Structure - The dataset contains multiple columns, including the artist's name, album title, and release year. Each row correspon...
M1 preference data
Implement cosine similarity between two vectors
Sure! So, let’s chat about cosine similarity. It’s a way to measure how similar two vectors are, right? You can think of vectors as just lists of numbers, like coordinates in space. Does that make sense so far? Imagine you have two vectors, A and B. For example, let’s say: - **Vector A** = [1, 2, 3] - **Vector B** = ...
M1 preference data
Let $\xv, \wv, \deltav \in \R^d$, $y \in \{-1, 1\}$, and $ arepsilon \in \R_{>0}$ be an arbitrary positive value. Which of the following is NOT true in general:
To tackle this problem, we need to analyze the given choices regarding the maximization of the function involving the log and exponential terms. We are given vectors $\xv$, $\wv$, and $\deltav$ in $\mathbb{R}^d$, along with a binary label $y$ and a positive epsilon $\epsilon$. Starting with the first choice, the equa...
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");...
### Possible Ways to Solve the Problem: 1. **Dependency Injection via Constructor** 2. **Service Locator Pattern** 3. **Factory Method for Payment Processing** 4. **Strategy Pattern for Different Payment Processors** #### Refinements: 1. **Dependency Injection via Constructor:** - Modify the `ShoppingCart` c...
M1 preference data
Assume that you are part of a team developing a mobile app using Scrum. One of your colleagues suggests that your team should organize daily Scrum meetings to discuss the progress of the tasks and how to implement complex features. He especially wants to discuss the implementation of a feature that will allow users to ...
Organizing daily Scrum meetings is a valuable practice for a team following the Scrum framework, as it encourages communication, collaboration, and transparency. Let's break down the rationale behind this suggestion, especially in the context of discussing the implementation of the QR code scanning feature. ### Benefi...
M1 preference data
Consider the following CF grammar \(G_1\) \( R_1: \text{S} \rightarrow \text{NP VP} \) \( R_2: \text{S} \rightarrow \text{NP VP PNP} \) \( R_3: \text{PNP} \rightarrow \text{Prep NP} \) \( R_4: \text{NP} \rightarrow \text{N} \) \( R_5: \text{NP} \rightarrow \text{Det N} \) \( R_6: \text{NP} \rightarrow \text{Det N PNP}...
2: This option is valid because it satisfies the requirement that the probabilities for each non-terminal's productions sum to 1. For example, for S, \(0.55 + 0.45 = 1.00\), for NP, \(0.10 + 0.15 + 0.75 = 1.00\), and for VP, \(0.50 + 0.50 = 1.00\). Each non-terminal's productions adhere to the probabilistic grammar req...
M1 preference data
What happens in the reliable broadcast algorithm if the accuracy property of the failure detector is violated?
If the accuracy property of the failure detector is not upheld, processes may send messages unnecessarily, leading to some resource consumption. However, this does not affect the overall functionality of the broadcast algorithm.
M1 preference data
Bluetooth is \dots
The answer is "a short-range wireless technology" because Bluetooth is explicitly designed for communication over short distances, typically around 10 meters, enabling seamless connectivity between various personal devices.
M1 preference data
A company active in automatic recognition of hand-written documents needs to improve the quality of their recognizer. This recognizer produces sets of sequences of correct English words, but some of the produced sequences do not make any sense. For instance the processing of a given hand-written input can produce a set...
Answer: The sentences are not grammatically correct and thus do not make logical sense. Using syntactic analysis methods could help the system identify the appropriate transcriptions. Resources needed may include a parser and some grammar rules. Explanation: These sentences lack grammatical structures, leading to their...
M1 preference data
In Text Representation learning, which of the following statements is correct?
**Plan:** 1. Analyze each statement regarding their validity in the context of text representation learning and the specific algorithms mentioned (GloVe, FastText). 2. Evaluate the first statement about GloVe vectors and SGD in a streaming fashion. 3. Assess the second statement regarding matrix factorization algorithm...
M1 preference data
In RSA, we set $p = 7, q = 11, e = 13$. The public key is $(m, e) = (77, 13)$. The ciphertext we receive is $c = 14$. What is the message that was sent? (Hint: You may solve faster using Chinese remainder theorem.).
The correct answer is \( t = 42 \). To decrypt \( c = 14 \) in RSA with \( (m, e) = (77, 13) \), we find \( d = 37 \). Using the Chinese Remainder Theorem, we calculate \( 14^{37} \mod 7 \) and \( 14^{37} \mod 11 \). This gives \( t \equiv 0 \mod 7 \) and \( t \equiv 9 \mod 11 \). Solving these congruences leads to \(...
M1 preference data
K-Means:
Final Answer: 'always converges, but not always to the same solution' Reasoning: K-Means clustering is an iterative algorithm that partitions data into K clusters. It always converges to a solution due to the way it updates cluster centroids and assigns data points to the nearest centroid. However, the final clusters ...
M1 preference data
Which of the following statements about the $\mathrm{SVD}$ of an $N \times D$ matrix $\mathbf{X}$ are correct?
In the context of Singular Value Decomposition (SVD) for an \(N \times D\) matrix \(\mathbf{X}\), it's interesting to note how the choice of computational method can greatly influence performance based on matrix dimensions. For example, the singular values can be derived from the eigenvalues of \(\mathbf{X}^{\top} \mat...
M1 preference data
Given the following classes: • class Pair[+U, +V] • class Iterable[+U] • class Map[U, +V] extends Iterable[Pair[U, V]] Recall that + means covariance, - means contravariance and no annotation means invariance (i.e. neither covariance nor contravariance). Consider also the following typing relationships for A, B, X, and...
To determine the subtyping relationship between the function types \( A => (Y => X) \) and \( A => (X => Y) \), we will analyze the parameter types and return types, applying the rules of covariance and contravariance. ### Step-by-Step Reasoning: 1. **Understanding Function Types**: - In functional types, for \( F...
M1 preference data
Create a function that parses the input documents and creates a dictionary with the terms and term frequencies.
Sure! Below is a Python function that parses a list of input documents and creates a dictionary where the keys are terms (words) and the values are their respective term frequencies. This implementation considers basic text preprocessing such as converting to lowercase and removing punctuation. ```python import re fro...
M1 preference data
Which of the following integers has the square roots $\{2,3\}$ when taken modulo $5$ \textbf{and} the square roots $\{3,10\}$ when taken modulo $13$.
To determine which integer among the options has the specified square roots modulo \(5\) and \(13\), we will analyze each option accordingly. ### Step 1: Square roots modulo \(5\) First, we need to find the integers that have square roots \( \{2, 3\} \) modulo \(5\): - The squares of integers modulo \(5\) are: - \(...
M1 preference data
You've been hired to modernize a codebase from a 50-year-old company: version control, automated builds, and continuous integration. One of your colleagues, who is not completely up-to-date with modern practices, asks you the following question: "Does adding "continuous integration" mean we no longer need to worry abou...
Certainly! Here's how I would respond to your colleague's question: --- ### Answer: No, adding continuous integration (CI) does not mean we no longer need to worry about testing. In fact, CI emphasizes the importance of testing even more. ### Explanation: Continuous integration is a development practice where deve...
M1 preference data
Use Total Order Broadcast to implement an Asset Transfer sequential object.
To understand how to use Total Order Broadcast (TOB) to implement an Asset Transfer sequential object, we need to break down the concepts involved and their relationships. ### Step 1: Understand the Concepts #### 1.1 What is an Asset Transfer? An asset transfer refers to the process of moving ownership of an asset (...
M1 preference data
Following are token counts that appear in 3 documents (D1, D2, and D3): D1 – tablet: 7; memory: 5; app: 8; sluggish: 7 D2 – memory: 5; app: 3 D3 – tablet: 3; sluggish: 3 Based on the cosine similarity, which 2 documents are the most similar?
To determine which two documents are most similar based on cosine similarity, we first need to represent each document as a vector in a multi-dimensional space. The cosine similarity between two vectors is calculated using the formula: \[ \text{Cosine Similarity} = \frac{A \cdot B}{\|A\| \|B\|} \] where: - \(A \cdot ...
M1 preference data
Tick the \emph{correct} assertion regarding GSM.
Let’s evaluate each assertion about GSM (Global System for Mobile Communications): (A) **In GSM, the communication is always encrypted.** - This is incorrect. Although GSM does support encryption, it is not universally applied to all communications, particularly in some signaling cases. (B) **The integrity of GSM mes...
M1 preference data
Consider using a parser with the following (partial) grammar: S -> NP VP VP -> V NP -> Det N VP -> VP PP NP -> N VP -> VBP VBG PP NP -> NP PP PP -> P NP and (also partial) lexicon: 2012 N from P Switzerland N in P USA N increasing VBG are VBP the Det exports N to P exports V Using the CYK algorithm, parse the follo...
To parse the sentence "the exports from the USA to Switzerland are increasing in 2012" using the CYK (Cocke-Younger-Kasami) algorithm, we first need to identify the words and their corresponding parts of speech based on the provided lexicon. ### Step 1: Lexical Analysis The words of the sentence and their correspondin...
M1 preference data
In JOS, after finishing the execution of a user-level page fault handler, how is the program control flow transferred back to the program? (You may get insights from the code snippet of _pagefault_upcall.)
To determine the correct answer, let's analyze the options based on how a user-level page fault handler works in the JOS operating system. 1. **Option 1: "The control flow will be transferred to kernel first, then to Env that caused the page fault."** - **Reasoning:** After the page fault handler finishes executing...
M1 preference data
Consider the Rabin cryptosystem using a modulus $N=pq$ where $p$ and $q$ are both $\ell$-bit primes. What is the tightest complexity of the encryption algorithm?
The tightest complexity of the encryption algorithm in the Rabin cryptosystem, using a modulus \( N = pq \) where \( p \) and \( q \) are both \(\ell\)-bit primes, is \( O(\ell^2) \). **Reasoning:** The encryption in the Rabin cryptosystem involves computing \( c = m^2 \mod N \), where \( m \) is the plaintext message...
M1 preference data
With negative sampling a set of negative samples is created for
The correct answer is: **For each word-context pair**. So, let’s break this down a bit. When we're using negative sampling, especially in the context of training word embeddings like in Word2Vec, we want to create examples that help the model learn what's not related. The idea is that for every word-context pair, we g...
M1 preference data
The Kerckhoffs principle states that the security of a cryptosystem should rely on the secrecy of\dots
The Kerckhoffs's principle is a foundational concept in cryptography that emphasizes the importance of key management in the security of cryptographic systems. According to this principle, the security of a cryptosystem should rely on the secrecy of the key only. Therefore, the correct answer is: **Selected answer: th...
M1 preference data
How many generators are there in $\mathbb{Z}_n$?
To determine how many generators exist in the group \(\mathbb{Z}_n\), we need to understand the structure of this group. The group \(\mathbb{Z}_n\) consists of the integers modulo \(n\) under addition. A generator of \(\mathbb{Z}_n\) is an element \(a \in \mathbb{Z}_n\) such that the cyclic subgroup generated by \(a\...
M1 preference data
For an item that has not received any ratings, which method can make a prediction?
Answer: 3 Reasoning: Content-based recommendation systems can make predictions using item features, even if the item has not received any ratings.
M1 preference data
Suppose we have the following function \(f: [0, 2] o [-\pi, \pi] \). \[f(x) = egin{cases} x^2 & ext{ for } 0\leq x < 1\ 2-(x-2)^2 & ext{ for } 1 \leq x \leq 2 \end{cases} \]
(f) is injective but not surjective.
M1 preference data
Recall that a matroid $\mathcal{M} =(E, \mathcal{I} )$ is a partition matroid if $E$ is partitioned into \emph{disjoint} sets $E_1, E_2, ..., E_\ell$ and \[ \mathcal{I} = \lbrace X \subseteq E : |E_i \cap X | \leq k_i \mbox{ for } i=1,2,..., \ell \rbrace\,. \] Verify that this is indeed a matroid.
To verify that a partition matroid \(\mathcal{M} = (E, \mathcal{I})\) is indeed a matroid, we need to check if it satisfies the two defining properties of a matroid: the hereditary property and the augmentation property. ### Definitions and Setup 1. **Partition Matroid**: A matroid \(\mathcal{M} = (E, \mathcal{I})\)...
M1 preference data
The number of permutations on a set of $n$ elements
The question asks how many different ways we can arrange \(n\) distinct elements in a set. To answer this, we need to understand permutations, which refer to the different arrangements of a set's elements. The number of permutations of \(n\) elements is given by \(n!\) (n factorial), which is the product of all positi...
M1 preference data
What is the encryption of the word ``SECRECY'' under the Vigen\`ere cipher using the key ``ZAB''?
To encrypt the word "SECRECY" using the Vigenère cipher with the key "ZAB", we first repeat the key to match the length of the plaintext. Thus, the key becomes "ZABZABZ". Next, we convert each letter to its corresponding numerical value (A=0, B=1, ..., Z=25). The plaintext "SECRECY" translates to the numbers [18, 4, ...
M1 preference data
What measure should you compute to estimate the quality of the annotations produced by the two annotators?
To evaluate the agreement between two annotators, use inter-annotator agreement (IAA). A popular method is Cohen's Kappa (\( \kappa \)), which is great for categorical data and accounts for chance agreement. The formula for Cohen's Kappa is: \[ \kappa = \frac{P_o - P_e}{1 - P_e} \] Where: - \( P_o \) is the observe...
M1 preference data
Which of the following are parameters involved in the choice made by an order-1 HMM model for PoS tagging knowing that its output isthis/Pron is/V a/Det good/Adj question/Nand that neither "is" nor "question" can be adjectives, and that "question" can also not be a determiner.(Penalty for wrong ticks.)
To determine which of the options are parameters involved in the choice made by an order-1 Hidden Markov Model (HMM) for Part-of-Speech (PoS) tagging, we need to consider the structure of HMMs and the relationships between states (tags) and observations (words). An order-1 HMM relies on the current state (PoS tag) and ...
M1 preference data
The objective of this question is to illustrate the use of a lexical semantics resource to compute lexical cohesion. Consider the following toy ontology providing a semantic structuring for a (small) set of nouns: Give some examples of NLP tasks for which lexical cohesion might...
Lexical cohesion refers to the way in which words in a text are related to each other through their meanings, which can enhance the coherence and semantic unity of a discourse. Understanding and leveraging lexical cohesion can be beneficial across various natural language processing (NLP) tasks. Here, we will explore s...
M1 preference data
Consider the following code transformation: egin{verbatim} r3 = r3 << 4 r4 = r4 << 4 st [r3] = r2 ld r1 = [r4] r5 = r3 + 4 r1 = r1 + 1...
(i) The pairs of instructions that have been reordered are as follows: 1. `r3 = r3 << 4` and `r4 = r4 << 4` 2. `st [r3] = r2` and `ld r1 = [r4]` 3. `r5 = r3 + 4` and `r1 = r1 + 1` 4. `st [r5] = r6` and `st [r3] = r2` In general, reordering instructions can lead to erroneous execution if: - The instructions have data...
M1 preference data
Which of the following statement(s) is/are true about Safe Exception Handling (SEH)?
To address the question regarding Safe Exception Handling (SEH) and evaluate the provided statements, we will follow a structured approach: ### 1. Factual Information about Safe Exception Handling (SEH) Safe Exception Handling (SEH) is a mechanism in Windows operating systems that provides a way to handle exceptions...
M1 preference data
(Stochastic Gradient Descent) One iteration of standard SGD for SVM, logistic regression and ridge regression costs roughly $\mathcal{O}(D)$, where $D$ is the dimension of a data point.
**QUESTION:** One iteration of standard SGD for SVM, logistic regression and ridge regression costs roughly $\mathcal{O}(D)$, where $D$ is the dimension of a data point. **OPTIONS:** - True - False ### Step 1: Identify Core Concepts The question tests the understanding of the computational complexity of one i...
M1 preference data
Consider the following case class definitions: case class Node(id: Int) case class Edge(from: Node, to: Node) Let us represent a directed graph G as the list of all its edges (of type List[Edge]). We are interested in computing the set of all nodes reachable in exactly n steps from a set of initial nodes. Given a set o...
```scala def cycles3(nodes: Set[Node], edges: List[Edge]): Set[Node] = { nodes.filter(node => reachable(3, Set(node), edges).contains(node)) } ```
M1 preference data
Which of the following statements is correct?
To determine which statement is correct, we need to analyze each option carefully. 1. The first option states that applying stochastic gradient descent (SGD) on the given objective function is roughly 30 times faster than a full gradient step. Given that SGD operates on a batch size of 1, it allows for faster updates ...
M1 preference data
Why does Intel Itanium contain more general-purpose registers (128) than most RISC instruction sets (usually 32)?
Intel Itanium contains a greater number of general-purpose registers to enhance performance through improved instruction-level parallelism and reduced memory access. With more registers available, the processor can hold more variables and intermediate results during computations, minimizing the need to frequently read ...
M1 preference data