question
stringlengths
6
13.7k
text
stringlengths
1
25.8k
source
stringclasses
3 values
Which method can be used for dimensionality reduction ?
The correct answer to the question "Which method can be used for dimensionality reduction?" is: **A. PCA** (Principal Component Analysis). Now, let’s go through each option to understand why PCA is the correct choice and how the others relate to dimensionality reduction. ### A. PCA (Principal Component Analysis) P...
M1 preference data
The Kerckhoff's principle is not followed when security requires that \dots
The Kerckhoff's principle is not followed when the security of a cryptosystem relies on the secrecy of the encryption algorithm, as it implies that the system is fundamentally insecure if the algorithm is exposed. This principle asserts that a secure system should remain secure even if everything about the system, exce...
M1 preference data
Which of these attacks applies to the Diffie-Hellman key exchange when the channel cannot be authenticated?
To analyze the multiple-choice question regarding the Diffie-Hellman key exchange, we need to understand the attack types mentioned and how they relate to the security of the Diffie-Hellman protocol, especially when the channel is not authenticated. The Diffie-Hellman key exchange is a method for two parties to establ...
M1 preference data
Implement Latent Semantic Indexing by selecting the first x largest singular values of the term document matrix Hint 1: np.linalg.svd(M, full_matrices=False) performs SVD on the matrix $\mathbf{M}$ and returns $\mathbf{K}, \mathbf{S}, \mathbf{D}^T$ - $\mathbf{K}, \mathbf{D}^T$ are matrices with orthonormal column...
To implement Latent Semantic Indexing (LSI), you first need to perform Singular Value Decomposition (SVD) on the term-document matrix. This can be done using `np.linalg.svd(M, full_matrices=False)`, which will give you three outputs: the left singular vectors, the singular values, and the right singular vectors. Then, ...
M1 preference data
In the maximum directed cut problem we are given as input a directed graph $G = (V, A)$. Each arc $(i, j)\in A$ has a nonnegative weight $w_{ij} \geq 0$. The goal is to partition $V$ into two sets $U$ and $W = V \setminus U$ so as to maximize the total weight of the arcs going from $U$ to $W$ (that is, arcs $(i, j)$ w...
Certainly! Let's revise the answer to the maximum directed cut problem by incorporating the feedback from the critique. We will ensure that all key terms are defined, the logic is complete, and the method is clearly justified. --- ### Problem Definition In the maximum directed cut problem, we are given a directed gr...
M1 preference data
Data being classified as unstructured or structured depends on the:
To classify data as structured or unstructured, we must consider how the data is organized and whether it adheres to a predefined model or format. 1. **Degree of Abstraction**: This refers to the organization of data. Structured data, such as that in relational databases, is highly organized and fits a fixed schema, ...
M1 preference data
In a lottery, a bucket of 10 numbered red balls and a bucket of 5 numbered green balls are used. Three red balls and two green balls are drawn (without replacement). What is the probability to win the lottery? (The order in which balls are drawn does not matter).
To determine the probability of winning the lottery, we first need to calculate the total number of ways to draw the specified balls and then the number of successful outcomes that satisfy the winning conditions. ### Step 1: Calculate Total Outcomes 1. **Total Ways to Choose 3 Red Balls from 10:** The number of way...
M1 preference data
Following the notation used in class, let us denote the set of terms by $T=\{k_i|i=1,...,m\}$, the set of documents by $D=\{d_j |j=1,...,n\}$, and let $d_i=(w_{1j},w_{2j},...,w_{mj})$. We are also given a query $q=(w_{1q},w_{2q},...,w_{mq})$. In the lecture we studied that, $sim(q,d_j) = \sum^m_{i=1} \frac{w_{ij}}{|...
To compare the vector space retrieval model with the probabilistic retrieval model based on language models, we need to analyze the underlying principles and assumptions of each approach. ### Vector Space Model (VSM) 1. **Representation**: In the vector space model, documents and queries are represented as vectors in...
M1 preference data
Prove that √2 is irrational.
To prove that ( \sqrt{2} ) is irrational, we can use a proof by contradiction. Here are the steps in detail: Step 1: Assume the opposite Assume that ( \sqrt{2} ) is rational. By definition, this means that it can be expressed as the fraction of two integers ( a ) and ( b ) (where ( b \neq 0 )), such that: [ \sqrt{2} =...
M1 preference data
Recall that the hard-margin SVM problem corresponds to: $$ \underset{\substack{\ww \in \R^d, \ orall i:\ y_i \ww^ op \xx_i \geq 1}}{\min} \Vert \ww \Vert_2.$$ Now consider the $2$-dimensional classification dataset corresponding to the $3$ following datapoints: $\xx_1 = (-1, 2)$, $\xx_2 = (1, 2)$, $\xx_3 = (0, -2)$ ...
**Plan:** 1. Analyze the given data points and their labels to determine if the dataset is linearly separable. 2. Consider the geometrical arrangement of the points to check for the existence of a separating hyperplane. 3. Evaluate the claims made in each statement regarding the dataset and the solution of the hard-mar...
M1 preference data
Let $\mathcal{C}$ be a binary $(n,k)$ linear code with minimum distance $d_{\min} = 4$. Let $\mathcal{C}'$ be the code obtained by adding a parity-check bit $x_{n+1}=x_1 \oplus x_2 \oplus \cdots \oplus x_n$ at the end of each codeword of $\mathcal{C}$. Let $d_{\min}'$ be the minimum distance of $\mathcal{C}'$. Which of...
To analyze the options, let's start with the properties of the original code \(\mathcal{C}\) and the new code \(\mathcal{C}'\). 1. **Understanding the original code \(\mathcal{C}\)**: - \(\mathcal{C}\) is a binary linear code with minimum distance \(d_{\min} = 4\). This means that the smallest Hamming distance betw...
M1 preference data
Assume you are working on a trendy app that allows everyone to create and share quizzes! Your first task is to add a new feature. Here is a transcript from part of a conversation with a user: > Hey! So you're the developer of this quiz app? > The one where I can write questions and answers for my friends? > I think it...
As a firefighter, I want to use the app with voice commands so that I can create quizzes while busy with other household tasks.
M1 preference data
Tick the \emph{correct} assertion.
** To determine which assertion among the provided options is correct, we need to evaluate each statement based on established cryptographic principles. 1. **Assertion**: MD5 is using a compression function based on the Davies-Meyer scheme. - **Evaluation**: This assertion is **false**. MD5 employs a Merkle-Damgår...
M1 preference data
Tick the \textbf{incorrect} assertion.
To determine the incorrect assertion among the provided options, let's analyze each statement step by step. 1. **ECDSA uses elliptic curves.** - **Analysis:** This statement is true. ECDSA stands for Elliptic Curve Digital Signature Algorithm, which indeed relies on elliptic curves for its cryptographic operations....
M1 preference data
Compute $\phi(90)$.
To compute \(\phi(90)\), we start by determining the prime factorization of \(90\). The prime factorization of \(90\) is: \[ 90 = 2 \times 3^2 \times 5. \] Using Euler's totient function formula, we have: \[ \phi(n) = n \left(1 - \frac{1}{p_1}\right)\left(1 - \frac{1}{p_2}\right) \cdots, \] where \(p_1, p_2, \ldots\...
M1 preference data
What is the gradient of $\mathbf{x}^{\top} \mathbf{W} \mathbf{x}$ with respect to all entries of $\mathbf{W}$ (written as a matrix)?
To find the gradient of the expression \(\mathbf{x}^{\top} \mathbf{W} \mathbf{x}\) with respect to the matrix \(\mathbf{W}\), we start by noting that this expression is a scalar quantity. The gradient of a scalar with respect to a matrix can be computed using the properties of matrix calculus, particularly for quadra...
M1 preference data
From a corpus of \( N \) occurences of \( m \) different tokens:How many different 4-grams (values) could you possibly have?
Imagine you have a large box of colorful building blocks. The box contains \( N \) blocks in total, and there are \( m \) different colors available. Each color represents a different token. Now, you're tasked with creating 4-block structures (or 4-grams) using these blocks. Since you can use any combination of color...
M1 preference data
Why a data prefetcher could hinder a Prime+Probe cache attack? How can the attacker overcome this problem?
**Introduction**: Cache attacks, particularly Prime+Probe attacks, are a significant concern in the realm of cybersecurity, as they exploit the cache memory of computer systems to extract sensitive information. A Prime+Probe attack involves an attacker manipulating the cache by filling it (priming) and then measuring...
M1 preference data
The ElGamal cryptosystem is based on\dots
The best option is: **2. the discrete logarithm problem.** **Explanation:** The ElGamal cryptosystem is a public-key cryptosystem that relies on the mathematical difficulty of solving the discrete logarithm problem. In this context, the discrete logarithm problem involves finding an integer \( x \) such that \( g^x \...
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 Precisely define the type of grammar G is corresponding to (for that, consider at least the following aspect...
The grammar \( G \) is primarily a constituency-based grammar, as evidenced by its use of phrase structure rules that organize language into hierarchical constituents such as noun phrases (NP) and verb phrases (VP). Constituency-based grammars focus on how phrases can be formed and nested within each other, which is ev...
M1 preference data
Consider the following shellcode, which of the following statement(s) is/are correct? \begin{lstlisting}[language=nasm,style=nasm] needle: jmp gofar goback: pop %rdi xor %rax, %rax movb $0x3b, %al xor %rsi, %rsi xor %rdx, %rdx syscall gofar: call goback .string "/bin/sh" \end{lstlisting}
Let’s analyze each statement regarding the provided shellcode step by step: ### Shellcode Analysis The shellcode consists of several instructions that prepare for and invoke a syscall (specifically, to execute `/bin/sh`). 1. **Lines 2-6 are preparing arguments for the syscall invocation.** - **Analysis:** In these...
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...
When analyzing the asymptotic work of the `contains` function when called on a Vector, we consider the two different cases outlined in the code: when the size of the iterable $n$ is less than or equal to 5 and when $n$ is greater than 5. 1. **Base Case (n <= 5)**: In this scenario, the function iterates through the el...
M1 preference data
List two common types of exceptions which could possibly be implemented imprecisely. Explain why.
1. **NullPointerException**: This exception can be implemented imprecisely if developers fail to check for null references before accessing object properties or methods. This may lead to runtime crashes, making it difficult to diagnose the root cause of the error. 2. **ArrayIndexOutOfBoundsException**: This exception ...
M1 preference data
What property does the function f passed to reduce need to satisfy in order to have the same result regardless on how reduce groups the applications of the operation f to the elements of the data structure? Prove that your function f indeed satisfies that property.
To ensure that the function \( f \) passed to `reduce` produces the same result regardless of how the elements are grouped during the applications of \( f \), the function must be **associative**. This means that the way you group the inputs does not change the outcome. ### Definition of Associative A function \( f \...
M1 preference data
If process i fails, then eventually all processes j≠i fail Is the following true? If no process j≠i fails, nothing can be said about process i
To analyze the statement, we will break it down step-by-step: 1. **Understanding the Given Statement**: - The statement asserts: "If process i fails, then eventually all processes j≠i fail." - This suggests a dependency or a cascading failure effect where the failure of one process leads to the failure of others...
M1 preference data
Suppose you are using the Hedge algorithm to invest your money (in a good way) into $N$ different investments. Every day you see how well your investments go: for $i\in [N]$ you observe the change of each investment in percentages. For example, $\mbox{change(i) = 20\%}$ would mean that investment $i$ increased in valu...
To implement the "adversary" in the Hedge algorithm, you need to set the cost vector \(\vec{m}^{(t)}\) each day based on the performance of the investments. 1. **Understanding the Cost Vector**: In the Hedge algorithm, the cost vector \(\vec{m}^{(t)}\) represents the losses incurred by each investment up to day \(t\)....
M1 preference data
How many generators do we have in a group of order $13$?
To determine how many generators a group of order \( 13 \) has, we need to consider the properties of groups and, in particular, the nature of cyclic groups. 1. **Cyclic Groups and Order**: A group of prime order \( p \) (in this case \( p = 13 \)) is always cyclic. This means that the group can be generated by a sing...
M1 preference data
Select the \emph{incorrect} statement. Pedersen Commitment is
The correct answer is option 4: "based on DSA." To explain why this statement is incorrect, let's break down the relevant concepts: 1. **Pedersen Commitment**: This is a cryptographic scheme used to commit to a value while keeping it hidden (hiding) until it is revealed. 2. **Unconditionally Hiding**: This means t...
M1 preference data
Assume In the process of reworking the architecture of the project, you need to remove a method because it's too easy to use incorrectly and there's now an easier-to-use replacement. What changes should you make for upcoming releases?
To effectively remove the old method and implement the new one in upcoming releases, you should: 1. Deprecate the old method in documentation. 2. Update documentation to emphasize the new method's benefits and provide examples. 3. Refactor the codebase to replace all instances of the old method with the new one. 4. Ad...
M1 preference data
The Tonelli algorithm is
3. an algorithm for finding square roots. The Tonelli algorithm is specifically designed to compute square roots modulo a prime number. It is particularly useful in number theory and cryptography, where finding square roots in modular arithmetic is a common problem.
M1 preference data
The "Consensus-Based Total-Order Broadcast" algorithm transforms a consensus abstraction (together with a reliable broadcast abstraction) into a total-order broadcast abstraction. Describe a transformation between these two primitives in the other direction, that is, implement a (uniform) consensus abstraction from a (...
This approach effectively transforms the total-order broadcast abstraction into a uniform consensus abstraction, ensuring that all correct processes arrive at the same decision based on a consistent delivery order of proposed values.
M1 preference data
Which of the following mitigation(s) can prevent reliable exploitation of the following vulnerable code snippet? \begin{lstlisting}[language=C,style=c] #include #include void win(void) { system("/bin/sh"); } int main(int argc, char *argv[]) { char buf[128]; scanf("%126[^\n]", buf); // Reads up ...
To effectively mitigate the vulnerabilities present in the provided code snippet, ASLR (Address Space Layout Randomization) for position-independent executables and Fortify Source should be implemented. ASLR helps in preventing reliable exploitation by randomizing the memory addresses where executable code is loaded, m...
M1 preference data
Prove Hall's Theorem: \begin{itemize} \item[]``An $n$-by-$n$ bipartite graph $G=(A \cup B, E)$ has a perfect matching if and only if $|S| \leq |N(S)|$ for all $S\subseteq A$.'' \end{itemize} \emph{(Hint: use the properties of the augmenting path algorithm for the hard direction.)}
To prove Hall's Theorem, we need to show both directions of the statement: 1. **If there exists a perfect matching in the bipartite graph \( G = (A \cup B, E) \), then for every subset \( S \subseteq A \), we have \( |S| \leq |N(S)| \).** This direction is straightforward. If \( G \) has a perfect matching, it means ...
M1 preference data
In x86-64 Linux, the canary is \textbf{always} different for every?
Thread The canary is a security feature used to detect stack buffer overflows, and it is typically unique for each thread to prevent attackers from exploiting vulnerabilities in one thread affecting another. Since threads within the same process share the same memory space, having a separate canary for each thread hel...
M1 preference data
Consider a country with n ≥ 2 cities. For every pair of different cities x, y, there exists a direct route (single direction) either from x to y or from y to x. Show that there exists a city that we can reach from every other city either directly or through exactly one intermediate city.
### Step 1: Understand the structure of the problem We are given a directed graph where cities are represented as vertices and direct routes as directed edges. For every pair of different cities \(x\) and \(y\), there exists a directed edge either from \(x\) to \(y\) or from \(y\) to \(x\). This means that for any two ...
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 prove that the bipartite graph \( H \) associated with the extreme point solution \( x^* \) is acyclic, we can use the properties of extreme point solutions in linear programming and the structure of the problem. ### Key Definitions 1. **Extreme Point Solution**: An extreme point solution of a linear program is a s...
M1 preference data
Tick the \textbf{true} assertion. In a zero-knowledge interactive proof of knowledge, \ldots
In a zero-knowledge interactive proof of knowledge, the focus is on maintaining the privacy of the prover's information while still convincing the verifier of the truth of a statement. This situation can be likened to how certain species in nature use camouflage to blend into their environment; they maintain their safe...
M1 preference data
You have $1$ Euro and your goal is to exchange it to Swiss francs during the next two consecutive days. The exchange rate is an arbitrary function from days to real numbers from the interval $[1,W^2]$, where $W\geq 1$ is known to the algorithm. More precisely, at day $1$, you learn the exchange rate $x_1 \in [1,W^2]$,...
To demonstrate that any deterministic algorithm has a competitive ratio of at most \( \frac{1}{W} \), we need to analyze the performance of such an algorithm in comparison to the optimal strategy, which knows both exchange rates \( x_1 \) and \( x_2 \). Given that \( x_1 \) is the exchange rate on day 1 and can range ...
M1 preference data
Select \emph{incorrect} statement. The brute force technique against a cipher with key $256$ bits is
The statement is incorrect because even with significant computational resources, brute-forcing a 256-bit key is infeasible due to the astronomical number of possible keys (approximately \(2^{256}\)). No current or foreseeable technology can realistically exhaustively search this keyspace within a practical timeframe, ...
M1 preference data
Design and analyze a polynomial-time algorithm for the following problem: \begin{center} \begin{boxedminipage}[t]{0.83\textwidth} \begin{description} \item[Input:] a vertex set $V$. \item[Output:] vertex subsets $S_1, S_2, \ldots, S_\ell \subseteq V$ with the following property:\\[2mm] For every set of edges $E\subse...
The algorithm can be designed as follows: 1. For each vertex \( v \in V \), compute its degree. 2. Create subsets \( S_1, S_2, \ldots, S_\ell \) based on the degree ranges. 3. Output these subsets. This algorithm runs in \( O(n) \) time, where \( n = |V| \), and outputs a polynomial number of subsets. It guarantees th...
M1 preference data
Can we devise a Best-effort Broadcast algorithm that satisfies the causal delivery property, without being a causal broadcast algorithm, i.e., without satisfying the agreement property of a reliable broadcast?
To understand whether we can devise a Best-effort Broadcast algorithm that satisfies the causal delivery property without being a causal broadcast algorithm, we first need to clarify the definitions involved: 1. **Causal Delivery Property**: A message is delivered to a process only after all messages that causally pre...
M1 preference data
Which defense(s) highlight the principle of least privilege in software security?
To determine which defense(s) highlight the principle of least privilege in software security, we first need to understand what the principle of least privilege entails. This principle states that a user, program, or system process should have only the minimum privileges necessary to perform its function. This minimize...
M1 preference data
If Alice receives a message proven to be coming from Bob, we say that the message is\dots
To determine the correct option for the statement "If Alice receives a message proven to be coming from Bob, we say that the message is...", let's analyze potential answer choices typically related to concepts of message authentication and verification: 1. **Authentic**: This term generally means that the message is c...
M1 preference data
Tick the \emph{false} assertion concerning WEP
To identify the false assertion concerning WEP, let's analyze each option: 1. **A. In WEP, encryption is based on RC4.** - **Analysis:** True. WEP (Wired Equivalent Privacy) employs the RC4 stream cipher for encryption, which is well-documented and widely known. 2. **B. In WEP, IVs repeat themselves too often.** ...
M1 preference data
Which of the following is wrong regarding Ontologies?
The wrong statement regarding ontologies is option **4**: "Ontologies dictate how semi-structured data are serialized."
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.The duke were also presented with a book commemorated his visit’s mother.
Let's analyze the provided sentence step-by-step across the different levels: 1. **Lexical**: This refers to the choice of words and vocabulary. The phrase "the duke were" is incorrect because "duke" is singular and should be paired with "was" instead of "were". Therefore, at the lexical level, the sentence is incorre...
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 determine if the function \( f(v, w) = \frac{1}{2}(vw + c - r)^2 \) is jointly convex in \( v \) and \( w \), we need to analyze its second derivatives and the Hessian matrix. 1. **Compute the first derivatives**: \[ \frac{\partial f}{\partial v} = (vw + c - r)w, \quad \frac{\partial f}{\partial w} = (vw + c ...
M1 preference data
Which of the following statements are true?
To evaluate the truth of the given statements regarding the $k$-nearest-neighbor (k-NN) classifier, we analyze each option as follows: A. **The more training examples, the more accurate the prediction of a k-nearest-neighbor classifier.** - **True.** In general, having more training examples provides a richer repre...
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 \R$. For $\lambda \geq 0$, we consider the following loss: L_{\lambda}(\ww) = rac{1}{N} \sum_{i = 1}^N (y_i - \xx_i^ op \ww)^2 + \lambda \Vert \ww \Ve...
As we increase the regularization parameter \( \lambda \) in our loss function, the penalty for large weights becomes stronger, which results in higher overall loss values for any given weight vector. This means that the minimum loss \( C_\lambda \) will either stay the same or increase as \( \lambda \) increases. Ther...
M1 preference data
Assume you are working on a mobile application. Your team's graphic designer tells you: "I wanted the logo to be exactly 250 pixels wide, but on my new phone it's not. This is a bug that needs fixing!" In one sentence, explain whether you agree with the designer's assessment and why.
I agree with the designer's assessment, as inconsistent logo display may indicate a bug related to device scaling or resolution settings.
M1 preference data
Assume you are working in a company on the back-end of a mobile application. You are tasked with improving the integration of the authentication via Google in your app, but your manager tells you: "Don't run any tests today, we only have a few API calls left for today's rate limit, we need to preserve those for custome...
To improve the integration of Google authentication without running live tests, the codebase should implement **dependency injection**. This allows for the use of mock services during testing rather than making actual API calls, preserving the remaining API rate limits for customers. By decoupling the authentication lo...
M1 preference data
Choose the \emph{incorrect} statement.
The question is asking you to identify which statement among the provided options is incorrect regarding commitment schemes in cryptography. A commitment scheme is a fundamental cryptographic primitive that allows one party (the "committer") to commit to a chosen value while keeping it hidden, with the ability to revea...
M1 preference data
In JOS and x86, please select all valid options for a system call.
Id like to explain my reasoning regarding the system call statements. 1. **Understanding System Calls**: First, I understand that a system call is a way for user applications to request services from the operating system. It’s important to note that system calls are not designed to handle hardware interrupts. For exa...
M1 preference data
Let $n$ be an integer. What is the cardinality of $\mathbf{Z}^*_n$?
The cardinality of the set \(\mathbf{Z}^*_n\), which consists of integers less than \(n\) that are coprime to \(n\), is given by Euler's Totient Function \(\varphi(n)\). Therefore, the correct answer is \(\boxed{\varphi(n)}\).
M1 preference data
Let $E$ be an elliptic curve. Solving which of the following problems would help you to break Elliptic Curve Diffie-Hellman (ECDH) over $E$?
Let \( P \in E \) and \( \ell \in \mathbb{N} \). Given \( P \) and \( \ell P \), compute \( \ell \). This problem helps break ECDH because if an attacker can determine the scalar \( \ell \) from the points, they can derive the private key used in the ECDH protocol, compromising its security.
M1 preference data
Consider the following problem where we are given an edge-colored graph and we wish to find a spanning tree that contains a specified number of edges of each color: \begin{description} \item[Input:] A connected undirected graph $G=(V,E)$ where the edges $E$ are partitioned into $k$ color classes $E_1, E_2, \dots, E_k$...
To solve the problem of finding a spanning tree with a specified number of edges of each color in an edge-colored graph, we can employ the concept of matroid intersection. Here’s how we derive the solution: 1. **Feasibility Check**: First, we need to ensure that the total number of edges required from all color classe...
M1 preference data
Consider a linear regression problem with $N$ samples $\left\{\left(\boldsymbol{x}_{n}, y_{n}\right)\right\}_{n=1}^{N}$, where each input $\boldsymbol{x}_{n}$ is a $D$-dimensional vector $\{-1,+1\}^{D}$, and all output values are $y_{i} \in \mathbb{R}$. Which of the following statements is correct?
To analyze the given options regarding linear regression, let’s first provide some foundational understanding of linear regression and the implications of the dimensionality of the data. ### Factual Information: Linear regression is a statistical method used to model the relationship between a dependent variable \( y ...
M1 preference data
You are discussing coding habits with a colleague, who says: "When I code, I only write some tests in order to get the minimum coverage my team wants." In one sentence, explain if this is a good habit and why:
This is not a good habit because focusing solely on minimum coverage can lead to inadequate testing, increasing the risk of undetected bugs and reducing overall code quality.
M1 preference data
Let $f: \mathbb{Z}_{m n} \rightarrow \mathbb{Z}_m \times \mathbb{Z}_n$ be defined by $f (x) = (x \bmod m,x \bmod n)$. Then $f$ is a ring isomorphism between $\mathbb{Z}_{180}$ and:
To determine the ring isomorphism \( f: \mathbb{Z}_{180} \rightarrow \mathbb{Z}_m \times \mathbb{Z}_n \) defined by \( f(x) = (x \bmod m, x \bmod n) \), we first need to find the prime factorization of 180: \[ 180 = 2^2 \times 3^2 \times 5 \] Next, we need to choose \( m \) and \( n \) such that \( \text{gcd}(m, n) =...
M1 preference data
Mean Square Error loss:
Mean Square Error (MSE) loss is a common metric used to measure the difference between predicted values and actual values in regression problems. It is calculated by taking the average of the squares of the errors, which are the differences between the predicted and actual values. The formula for MSE is: \[ \text{MSE}...
M1 preference data
Given a document collection with a vocabulary consisting of three words, $V = {a,b,c}$, and two documents $d_1$ = aabc and $d_2 = abc$. The query is $q = ab$. Using smoothed probabilistic retrieval (with $\lambda=0.5$), is it possible to enforce both a ranking $d_1 > d_2$ and $d_2 > d_1$ by adding suitable documents t...
To analyze the problem, we need to understand the smoothed probabilistic retrieval model and how it computes the scores for documents based on a query. ### Step 1: Understanding the Vocabulary and Documents We have the vocabulary \( V = \{a, b, c\} \). The documents are: - \( d_1 = \text{"aabc"} \) - \( d_2 = \text{"...
M1 preference data
Change Karger's algorithm so that it also works for edge-weighted graphs. Also adapt the analysis to prove that it still returns any min cut $(S^*, \overline{S^*})$ with probability at least $1/{n \choose 2}$. (Hence, edge-weighted graphs also have at most ${n \choose 2}$ min cuts.)
Karger's algorithm is a randomized algorithm designed to find a minimum cut in an unweighted graph. To adapt Karger's algorithm for edge-weighted graphs, we need to modify how we select edges for contraction based on their weights. Let’s go through the steps to adapt the algorithm and its analysis. ### Step 1: Underst...
M1 preference data
Let $f_{\mathrm{MLP}}: \mathbb{R}^{d} \rightarrow \mathbb{R}$ be an $L$-hidden layer multi-layer perceptron (MLP) such that $$ f_{\mathrm{MLP}}(\mathbf{x})=\mathbf{w}^{\top} \sigma\left(\mathbf{W}_{L} \sigma\left(\mathbf{W}_{L-1} \ldots \sigma\left(\mathbf{W}_{1} \mathbf{x}\right)\right)\right) $$ with $\mathbf{w} \in ...
To analyze the number of solutions (with zero training loss) for the given multi-layer perceptron (MLP) with \( L = 1 \) and \( M \) hidden units, we can break down the problem as follows: 1. **Understanding the MLP Structure**: With \( L = 1 \), the MLP consists of a single hidden layer. The function can be expressed...
M1 preference data
In JOS, suppose a value is passed between two Envs. What is the minimum number of executed system calls?
When one Env in JOS wants to send a value to another Env, it needs to make a system call to send the value, which is one call. The receiving Env then makes another system call to receive the value sent. Therefore, the total number of system calls executed in this process is 2. Thus, the correct answer is “2. 2”.
M1 preference data
You are given a training set $S=\left\{\left(x_{n}, y_{n}\right)\right\}_{n=1}^{N}$ for classification with $y_{n} \in\{0,1\}$. Ninety percent of the labeled data has label 0. You split the data randomly into two equal parts, train on the first part, and then test on the second part. You get an accuracy of 85 percent. ...
To evaluate the situation, let's break down the information provided and analyze the implications step by step. 1. **Understanding the Dataset**: We have a dataset \( S \) with labels \( y_n \in \{0, 1\} \). It's mentioned that 90% of the labeled data has the label 0, indicating a significant class imbalance. This mea...
M1 preference data
In Itanium's procedure call and return mechanism, Still ignoring potential problems during the execution of erb+alloc+, what hardware changes are needed to the processor (compared to a more traditional and straightforward VLIW processor) to implement this functionality?
To implement Itanium's procedure call and return mechanism, compared to a traditional VLIW processor, a few hardware changes are necessary. First, an adder must be integrated into the address path of the register file to facilitate the addition of an offset from a register. This offset is determined by the parameters s...
M1 preference data
You need to debug your Stochastic Gradient Descent update for a classification of three bridge types. Manually compute the model output for the feature vector $x=(1, 0, 0, 0, 0)$ and $W$ contains only zeros. The model is logistic regression, \textit{i.e.}, $\textrm{softmax}(Wx)$. Remember: \begin{equation} \te...
Here’s a concise and coherent breakdown: 1. **Input**: You have the feature vector \( x = (1, 0, 0, 0, 0) \) and the weight matrix \( W = (0, 0, 0) \). 2. **Calculate \( Wx \)**: \[ Wx = W \cdot x = (0, 0, 0) \] 3. **Softmax Calculation**: For the zero vector, applying the softmax function gives: \[ ...
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...
**Plan:** 1. Analyze the behavior of the `contains` function when called on a Vector, focusing on the size `n` of the vector. 2. Determine the depth of the recursion based on how the function divides the input vector. 3. Calculate the time complexity for both cases: when `n` is less than or equal to 5 and when `n` is g...
M1 preference data
10 itemsets out of 100 contain item A, of which 5 also contain B. The rule A -> B has:
To analyze the rule A → B, we need to calculate both the support and confidence of this rule given the information provided. First, let's define support and confidence in the context of association rule mining: - **Support** of an itemset is the proportion of transactions that contain that itemset. Mathematically, if...
M1 preference data
Prove that x + |x - 7| ≥ 7
Alright! Let’s think about this step by step, using some simple ideas. Imagine we have a number, which we call **x**. Now, we also have this thing called **|x - 7|**. The vertical bars mean “the distance from x to 7.” So, if x is 10, the distance from 10 to 7 is 3, and we write that as |10 - 7| = 3. If x is 5, the dis...
M1 preference data
Which of the following attacks needs no precomputation.
The correct option is: **1. Exhaustive search.** An exhaustive search, also known as brute-force attack, does not require any precomputation. It systematically tries all possible keys or passwords until the correct one is found. The other options typically involve some form of precomputation: - **2. Dictionary attac...
M1 preference data
Let $\mathbb F$ be a field of cardinality $q$ and let $0<k<n\leq q$ be unspecified integers. As seen in the lecture, we generate a $(n,k,d_{min})$ Reed-Solomon code with the following mapping: $$\mathbb F^k ightarrow \mathbb F^n ~~,~~ \vec u \mapsto \vec c =(P_{\vec u}(a_1),P_{\vec u}(a_2),\ldots,P_{\vec u}(a_n))$$ fo...
The answer is B: True. To determine whether \( d'_{min} = d_{min} - 1 \) holds for the constructed code \( \mathcal C' \), we first need to recall some fundamental properties of Reed-Solomon codes and how the minimum distance is defined. 1. **Minimum Distance of Reed-Solomon Codes**: For a Reed-Solomon code generated...
M1 preference data
(Backpropagation) Training via the backpropagation algorithm always learns a globally optimal neural network if there is only one hidden layer and we run an infinite number of iterations and decrease the step size appropriately over time.
The statement is: "Training via the backpropagation algorithm always learns a globally optimal neural network if there is only one hidden layer and we run an infinite number of iterations and decrease the step size appropriately over time." ### Answer: 2. False ### Explanation: 1. **Backpropagation and Local Minima*...
M1 preference data
List two common types of exceptions which must be implemented precisely. Explain why.
Two common types of exceptions that must be implemented precisely are memory access violations and arithmetic exceptions. 1. A memory access violation occurs when a program attempts to access a memory location that it is not permitted to, such as accessing a null pointer or violating memory protection rules. This exc...
M1 preference data
Using salt for UNIX passwords \ldots
The correct answer is: - helps preventing dictionary attacks. **Justification:** Using salt in UNIX passwords involves adding random data (the salt) to the password before it is hashed. This technique primarily serves to ensure that even if two users have the same password, their stored password hashes will be diff...
M1 preference data
What is the communication complexity of the FloodSet algorithm in number of messages?
The communication complexity of the FloodSet algorithm is O(n), where n is the number of nodes in the network. In this algorithm, each node sends messages to all its neighbors to ensure that the information propagates throughout the network. This flooding continues until all nodes have received the necessary informatio...
M1 preference data
Consider a 3-gram language model. Select all possible ways we can compute the maximum likelihood of the word sequence:"time flies like an arrow"You will get a penalty for wrong ticks.
The correct answers are 1, 3, and 6: 1. **Option 1**: 'P(time flies like).P(an|flies like).P(arrow|like an)' - This option is valid because it correctly utilizes the 3-gram model by taking the likelihood of the sequence "time flies like" and then considers the conditional probabilities for "an" given "flies like" and...
M1 preference data
Consider optimizing a matrix factorization $\boldsymbol{W} \boldsymbol{Z}^{\top}$ in the matrix completion setting, for $\boldsymbol{W} \in \mathbb{R}^{D \times K}$ and $\boldsymbol{Z} \in \mathbb{R}{ }^{N \times K}$. We write $\Omega$ for the set of observed matrix entries. Which of the following statements are correc...
** Matrix factorization is a mathematical technique used to decompose a matrix into the product of two or more matrices, which can represent the original matrix in a more compact form. Specifically, in the context of matrix completion, we are interested in finding two matrices \(\boldsymbol{W} \in \mathbb{R}^{D \times...
M1 preference data
You are given three classes (Student, Exam and Course which are defined below) and the method generatePassedExams, which from a given list of students and a list of courses, generates a list of students and all their successfully passed courses together with the corresponding grade. A course is considered as successful...
To rewrite the `generatePassedExams` method using `map`, `flatMap`, and `filter`, we will break down the original for-comprehension into its components. The for-comprehension consists of iterating over students, their exams, and the courses while applying conditions to filter out the passed exams. Here is how we can a...
M1 preference data
When constructing a word embedding, what is true regarding negative samples?
To understand the role of negative samples in the context of word embeddings, let's evaluate each option provided: 1. **They are words that do not appear as context words**: - This is true. Negative samples are typically words that do not appear in the context of a target word during training. They are used to hel...
M1 preference data
In order to avoid the Bleichenbacher attack in ElGamal signatures, \ldots
'To avoid the Bleichenbacher attack in ElGamal signatures, it is essential to use **groups of prime order**. This is crucial because the Bleichenbacher attack takes advantage of vulnerabilities that can emerge when using groups of composite order. In a group of prime order, the mathematical structure is simpler and mo...
M1 preference data
Interpreting the results obtained throughout this homework, create a short text (max. 250 words) where you: Present and explain a credible causal diagram capturing the relationship between the variables below, and justify your causal diagram given the questions answered in this homework: "Skill": an individual's innat...
In the causal diagram, "Skill" influences "Success before adulthood," while "Relative Age" also impacts early success, which in turn predicts "Success as an adult." Given two equally successful child athletes—one born on March 31 and the other on April 1—the athlete born on March 31 is likely to achieve greater suc...
M1 preference data
(Minima) Convex functions over a convex set have a unique global minimum.
To analyze the question regarding convex functions and their minima, we will follow the structured approach outlined in the instructions. ### Question: **(Minima) Convex functions over a convex set have a unique global minimum.** ### Core Concepts: 1. **Convex Functions**: A function \( f: \mathbb{R}^n \to \mathbb{R}...
M1 preference data
Tick the \emph{incorrect} statement. When $x\rightarrow+\infty$ \ldots
To determine which statement is incorrect, let's analyze each one in detail. 1. **Statement 1:** \( x^3 + 2x + 5 = \mathcal{O}(x^3) \) This statement is true. The term \( x^3 \) dominates the polynomial as \( x \rightarrow +\infty \), and thus \( x^3 + 2x + 5 \) grows at the same rate as \( x^3 \). Therefore, it c...
M1 preference data
What is the function of processors in a reorder buffer?
Processors in a reorder buffer serve a critical role in the execution of instructions in out-of-order execution architectures. The reorder buffer temporarily holds the results of instructions that have been executed out of order to ensure they can be committed to the system in the original program order. This prevents ...
M1 preference data
Let $(e,N)$ be the public parameters of the RSA cryptosystem. What is the advantage of taking a \emph{small} value for $e$?
To analyze the advantages of taking a small value for \( e \) in the RSA cryptosystem, let's consider each of the provided options: 1. **The complexity of the parameters generation is smaller.** - This statement is not accurate. The generation of parameters in RSA involves selecting two large prime numbers and calc...
M1 preference data
Select the non-associative operation.
To determine the non-associative operation among the given options, let's review the properties of each operation listed. 1. **Addition ($+$)**: Addition is associative. This means that for any numbers \(a\), \(b\), and \(c\), the equation \((a + b) + c = a + (b + c)\) holds true. 2. **Subtraction ($-$)**: Subtractio...
M1 preference data
Which of the following functions \( f :\mathbb{Z} imes \mathbb{Z} o \mathbb{Z} \) are surjective?
To determine which of the given functions \( f :\mathbb{Z} \times \mathbb{Z} \to \mathbb{Z} \) are surjective, we need to verify if each function can produce every integer as an output. A function is surjective if, for every element \( y \) in the codomain \( \mathbb{Z} \), there exists at least one \( (m, n) \) in the...
M1 preference data
Consider our standard least-squares problem $$ \operatorname{argmin}_{\mathbf{w}} \mathcal{L}(\mathbf{w})=\operatorname{argmin}_{\mathbf{w}} \frac{1}{2} \sum_{n=1}^{N}\left(y_{n}-\mathbf{x}_{n}^{\top} \mathbf{w}\right)^{2}+\frac{\lambda}{2} \sum_{d=1}^{D} w_{d}^{2} $$ Here, $\left\{\left(\mathbf{x}_{n} y_{n}\right)\rig...
The correct options that represent equivalent ways of solving the least-squares problem are: - **Option 1** - **Option 3** - **Option 5**
M1 preference data
Let $G$, be a valid generator matrix of dimensions $\mathbb F^{k imes n}$. Recall that ``valid'' means that $k \leq n$ and $ ext{rank}(G) = k$. Let $D_1 \in \mathbb F^{k imes k}$ and $D_2 \in \mathbb F^{n imes n}$ be diagonal matrices with non-zero diagonal elements. True or false: $D_1 \cdot G \cdot D_2$ is also a ...
To determine whether \( D_1 \cdot G \cdot D_2 \) is a valid generator matrix, let's analyze the properties of \( G \) and the impact of the diagonal matrices \( D_1 \) and \( D_2 \). 1. **Dimensions**: - The original generator matrix \( G \) has dimensions \( k \times n \) such that \( k \leq n \) and \( \text{ran...
M1 preference data
A MAC forgery is\dots
Answer: a valid pair \((X,c)\) produced by the adversary. Reasoning steps: 1. **Understanding MAC (Message Authentication Code)**: A MAC is a short piece of information used to authenticate a message and provide integrity and authenticity assurances. It is generated using a secret key and the message itself. 2. **An...
M1 preference data
Let \(A = \{a, b, c, d, ..., z\}\) be the set of lower cased English letters. Let \(S = \{a, b, ab, cd, ae, xy, ord, ...\}\) be the set of all strings using \(A\) as an alphabet. Given \(s\in S\), \(N(s)\) is the number of vowels in \(s\). For example,\(N(algrzqi) = 2\), \(N(bebebe) = 3\). We say \((s, t)\) belongs...
**Reasoning:** 1. **Reflexive:** A relation \(R\) is reflexive if every element is related to itself. In this case, for any string \(s\), \(N(s) \leq N(s)\) is always true, since any quantity is always less than or equal to itself. Therefore, \(R\) is reflexive. 2. **Transitive:** A relation \(R\) is transitive if w...
M1 preference data
Implement Connectivity-Based Community Ranking by doing the following: - Compute a meta graph where nodes are communities and edges denote inter-connections across communities. - Add the weights of the inter-connections as weights to the edges. - Compute `pagerank` on the meta graph. - Hint: `w_matrix` is the confusio...
To implement Connectivity-Based Community Ranking using the steps you provided, we will follow a structured approach. Below is a Python implementation using libraries like `numpy` for numerical operations and `networkx` for graph operations, including PageRank computation. ### Step-by-step Implementation 1. **Compute...
M1 preference data
Your team is discussing the following code: /** Uploads images to the cloud. */ public final class ImageUploader { public void upload(Image image) { /* … */ } private boolean canUpload(Image image) { /* … */ } } One of your colleagues thinks that "canUpload" should be made public. Explain in 1 sentence whethe...
The proposal to make the 'canUpload' method public does not break backward compatibility because it does not alter the existing interface of the 'ImageUploader' class; rather, it merely extends the visibility of a method that was previously private, thereby allowing external access without affecting any existing functi...
M1 preference data
ASLR needs support from:
Address Space Layout Randomization (ASLR) is a security technique that randomizes the memory addresses used by system and application processes to make it harder for attackers to predict the location of specific functions or buffers in memory. Let's analyze each option in relation to what ASLR requires for proper func...
M1 preference data
What are the different types of morphologies that can be considered? Briefly describe the main differences between them.
Sure! Let's approach the question step-by-step as outlined: ### 1. Clarify the Question The question is asking about the different types of morphologies that exist, likely in the context of biology, linguistics, or another relevant field. Morphology generally refers to the study of the structure and form of organisms ...
M1 preference data
Let $f:\R^D ightarrow\R$ be an $L$-hidden layer multi-layer perceptron (MLP) such that \[ f(xv)=\sigma_{L+1}ig(\wv^ op\sigma_L(\Wm_L\sigma_{L-1}(\Wm_{L-1}\dots\sigma_1(\Wm_1xv)))ig), \] with $\wv\in\R^{M}$, $\Wm_1\in\R^{M imes D}$ and $\...
To analyze the given problem, we need to consider the effects of the modifications made to the multi-layer perceptron (MLP) \\( f \\) through the creation of \\( g \\), \\( h \\), and \\( q \\). 1. For \\( g \\), which involves multiplying the last layer's weights \\( \\wv \\) by 2, we can observe that this will effe...
M1 preference data
What is our final goal in machine learning? (One answer)
The final goal in machine learning is to "Generalize." Generalization refers to the model's ability to perform well on unseen data after being trained on a specific dataset. A well-generalized model captures the underlying patterns in the training data without merely memorizing it, which would lead to overfitting. Over...
M1 preference data
The Kerckhoffs principle says:
**Plan:** 1. Define the Kerckhoffs' principle and its implications for cryptographic security. 2. Analyze each option provided to determine its correctness in relation to the principle. 3. Recall the key aspects that Kerckhoffs' principle emphasizes regarding the security of cryptographic systems. 4. Select the correct...
M1 preference data
The number of plaintext/ciphertext pairs required for a differential cryptanalysis is\dots
The number of plaintext/ciphertext pairs required for differential cryptanalysis is approximately $\frac{1}{DP}$. This is because differential cryptanalysis relies on the probability of certain input differences producing specific output differences. The term "DP" refers to the differential probability, which is the li...
M1 preference data