question
stringlengths
6
13.7k
text
stringlengths
1
25.8k
source
stringclasses
3 values
Let $G$ be a group generated by $g$. What is the discrete logarithm problem?
To understand the discrete logarithm problem, we need to analyze what it involves in the context of a group \( G \) generated by an element \( g \). 1. **Understanding the notation**: In the group \( G \), the element \( g^x \) represents the result of applying the group operation to \( g \) with itself \( x \) times....
M1 preference data
Tick the \textbf{false} statement. GSM anonymity is broken by ...
The false statement regarding GSM anonymity is: **3. using A5/1.** Explanation: The A5/1 encryption algorithm is used to secure the communication between the mobile station and the network, but its use does not break anonymity directly. On the other hand, replaying an A3 challenge (Option 1) can allow an attacker to ...
M1 preference data
What is the time complexity to perfom a left-to-right multiplication of two $\ell$-bit integers?
The time complexity to perform a left-to-right multiplication of two $\ell$-bit integers is $\sqrt{\ell}$. This is because when multiplying, we can take advantage of the fact that the number of bits reduces significantly with each multiplication step, allowing us to only need a square root amount of operations. Thus, a...
M1 preference data
Tick the \emph{false} assertion. Two-keys triple DES\dots
To determine the false assertion about Two-keys triple DES (3DES), let's analyze each option step by step: 1. **Is more secure than double encryption**: - Two-key 3DES applies DES encryption three times, but using only two keys. It is more secure than simple double encryption using DES, as it effectively mitigates...
M1 preference data
In this week's lecture, you have been introduced to the aggregate method of ParSeq[A] (and other parallel data structures). It has the following signature: def aggregate[B](z: B)(f: (B, A) => B, g: (B, B) => B): B Discuss, as a group, what aggregate does and what its arguments represent. Implement aggregate using the...
The `aggregate` method in the context of parallel data structures, such as ParSeq[A], allows us to process a collection of elements (of type A) in a way that combines them into a single result of a different type (B). This method is particularly useful for operations that can be divided or split into smaller tasks that...
M1 preference data
Consider an HMM Part-of-Speech tagger, the tagset of which contains, among others: DET, N, V, ADV and ADJ, and some of the parameters of which are: $$ \begin{gathered} P_{1}(\mathrm{a} \mid \mathrm{DET})=0.1, \quad P_{1}(\text { accurately } \mid \mathrm{ADV})=0.1, \quad P_{1}(\text { computer } \mid \mathrm{N})=0.1, ...
To tackle the question about the possible taggings of the sentence "a computer process programs accurately" using a Hidden Markov Model (HMM) Part-of-Speech (POS) tagger, we need to define some key terms and then analyze the problem step by step. ### Definitions 1. **Hidden Markov Model (HMM)**: A statistical model u...
M1 preference data
Given the following function sums: 1 def add(c: Int, acc: List[(Int, Int)]): List[(Int, Int)] = acc match 2 case Nil => List((c, 1)) 3 case x :: xs => if x._1 == c then (c, x._2+1) :: xs else x :: add(c, xs) 4 5 def sums(digits: List[Int]): List[(Int, Int)] = 6 digits.foldRight(List[(Int, Int)]())(add) Your task is to ...
The function `mystery2(digits: List[Int])` returns `List(1)` if the input list `digits` contains exactly one digit `1`, and an empty list otherwise. ### Justification: 1. **Counting Occurrences**: The `mystery1` function (not shown but implied) likely counts the occurrences of each digit in the input list `digits`. F...
M1 preference data
Let $n \geq 2$ be a positive integer, and $M$ a uniformly distributed binary message of length $2n$. Let $P_K(M)$ denote the one-time pad encryption of $M$ with key $K$. Let $K_1$ be a uniformly distributed binary key length $n$. Let $K_2$ be the complement of $K_1$. Let $K_3$ be the reverse of $K_1$. Let $K_i||K_j$ de...
To determine whether the encryption using the key \( K_6 = (K_1 || K_3) \) provides perfect secrecy, we need to consider the properties of perfect secrecy in the context of one-time pad encryption. **Perfect Secrecy**: An encryption scheme provides perfect secrecy if, for every plaintext message \( M \) and every poss...
M1 preference data
Tick the \textbf{false} assertion. In order to have zero-knowledge from $\Sigma$-protocols, we need to add the use of \ldots
To help you understand how we arrive at the conclusion that the false assertion is option 4, we need to break down the concepts involved in this question, particularly focusing on $\Sigma$-protocols and their relationship to zero-knowledge proofs. ### Step 1: Understanding $\Sigma$-protocols - **What is a $\Sigma$-pr...
M1 preference data
The complexities of the encryption and decryption in RSA with a modulus of $s$ bits are respectively within the order of magnitude \ldots
Answer:** 1) \( s^3 \) and \( s^3 \) **Explanation:** The encryption and decryption processes in RSA both rely on modular exponentiation, which has a complexity of \( O(s^3) \) for \( s \)-bit numbers. While optimizations like the Chinese Remainder Theorem can improve the efficiency of decryption, they do not change t...
M1 preference data
Implement a Rocchio classifier
To implement a Rocchio classifier, we will follow a structured approach. The Rocchio classifier is a vector space model used for text classification. It operates by calculating the centroid of each class and classifying new documents based on their proximity to these centroids. The steps are as follows: 1. **Define th...
M1 preference data
Consider a $d$-regular undirected graph $G = (V,E)$ and let $M$ be its normalized adjacency matrix. As seen in class, $M$ has $n= |V|$ eigenvalues $1=\lambda_1 \geq \lambda_2 \geq \ldots \geq \lambda_n\geq -1$ and the corresponding eigenvectors ${v}_1, {v}_2, \ldots, {v}_n \in \mathbb{R}^n$ can be selected to be orthog...
Answer: S = {i ∈ V | v_2(i) < 0} Reasoning: Drawing from the properties of eigenvectors and the spectral graph theory, we can logically infer that since λ_2 = 1, the second eigenvector v_2 will have both positive and negative entries, and thus we can partition the vertex set into two disjoint subsets based on the ...
M1 preference data
Suppose we use the Simplex method to solve the following linear program: \begin{align*} \textbf{maximize} \hspace{0.8cm} & \hspace{0.4cm}4x_1 - 6x_2 + 4x_3 \\ \textbf{subject to}\hspace{0.6cm} & x_1 - 3x_2 + x_3 + s_1 = 1 \\ \hspace{0.8cm} & \hspace{1.90cm}x_1 + s_2 = 8 \\ \hspace{0.8cm} & \hspace{0.65cm} 3x_2 + 2...
Answer: egin{align*} x_1 &= 1 + 3x_2 - x_3 - s_1 \ x_2 &= rac{1}{3} + rac{1}{3}x_3 + rac{1}{3}s_1 \ s_3 &= 5 - rac{1}{3}x_3 \ \cline{1-2} z &= rac{14}{3} + 2x_3 + rac{4}{3}s_1 \end{align*} Reasoning: We select \(x_2\) as the entering variable (since it has the highest coefficient in the objective function), an...
M1 preference data
A Carmichael number is
A
M1 preference data
Consider the (toy) grammar $G$ consisting of the following rules: R1: S --> NP VP R2: NP --> NN R3: NP --> Det NN R4: NN --> N R5: NN --> NN NN R6: NN --> NN PNP R7: PNP --> Prep NP R8: VP --> V R9: VP --> Adv V What type of rules does the provided grammar $G$ consist of? What type of rules should $G$ be complemented w...
The provided grammar \( G \) consists primarily of context-free grammar (CFG) rules. In a CFG, each rule has a single non-terminal symbol on the left side that can be replaced by a sequence of terminals and/or non-terminals on the right side. To make the grammar \( G \) exploitable in practice, it should be complement...
M1 preference data
A model predicts $\mathbf{\hat{y}} = [1, 0, 1, 1, 1]$. The ground truths are $\mathbf{y} = [1, 0, 0, 1, 1]$. What is the accuracy?
To calculate the accuracy step by step: 1. **Compare Predictions**: We compare each element of $\mathbf{\hat{y}}$ with the corresponding element in $\mathbf{y}$: - Index 0: Predicted 1, Actual 1 (Correct) - Index 1: Predicted 0, Actual 0 (Correct) - Index 2: Predicted 1, Actual 0 (Incorrect) - Index 3: Pre...
M1 preference data
Can we devise a broadcast algorithm that does not ensure the causal delivery property but only (in) its non-uniform variant: No correct process pi delivers a message m2 unless pi has already delivered every message m1 such that m1 → m2?
To answer your question regarding the feasibility of a broadcast algorithm that does not ensure the causal delivery property but only its non-uniform variant, we need to analyze the properties of causal delivery and consider the implications of your requirements. ### Definitions 1. **Causal Delivery Property**: A mes...
M1 preference data
For a $n$-bit block cipher with $k$-bit key, given a plaintext-ciphertext pair, a key exhaustive search has an average number of trials of \dots
The question asks how many attempts, on average, it would take to find the correct key for a block cipher given a plaintext-ciphertext pair. Evaluating the options helps clarify the answer: 1. **$2^n$** is incorrect because it pertains to the size of the block (the length of the plaintext and ciphertext) rather than t...
M1 preference data
Consider the task of classifying reviews as positive or negative. To create a reference for this task, two human annotators were asked to rate 1000 movie reviews as positive or negative.The first annotator rated {a} reviews as positive and the rest as negative. The second annotator rated {b} reviews as positive and the...
To calculate the raw agreement between the two annotators, we can use the following formula: \[ \text{Raw Agreement} = \frac{\text{Number of agreements}}{\text{Total number of reviews}} \] 1. **Identify the total number of reviews**: In this case, it is given that there are 1000 movie reviews. 2. **Identify the numb...
M1 preference data
We saw in class that we can quickly decrease the spatial size of the representation using pooling layers. Is there another way to do this without pooling?
Increasing the stride in a convolutional layer effectively reduces the spatial dimensions of the output, similar to pooling, without using pooling layers. Therefore, the correct answer is option 2. 2
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 3 new...
To create the new fields in your pandas DataFrame, you can use the following code: ```python import pandas as pd # Assuming df is your DataFrame df['authors_citations_median'] = df['authors_citations'].apply(lambda x: pd.Series(x).median()) df['authors_publications_median'] = df['authors_publications'].apply(lambda x...
M1 preference data
In the context of superscalar processors, what is the function of a Load Store Queue (LSQ)?
In the context of superscalar processors, the Load Store Queue (LSQ) plays a critical role in managing memory access operations, ensuring both efficiency and correctness. Here’s a breakdown of its function: - **Out-of-Order Execution Management**: The LSQ allows the processor to execute load and store instructions out...
M1 preference data
Which of the following primitives \textit{cannot} be instantiated with a cryptographic hash function?
A public key encryption scheme requires complex mathematical operations involving key pairs (public and private keys) to securely encrypt and decrypt messages, which cannot be achieved using just a cryptographic hash function. Hash functions are designed to produce fixed-size outputs from inputs but do not support the ...
M1 preference data
If for the χ2 statistics for a binary feature, we obtain P(χ2 |DF = 1) < 0.05, this means:
To evaluate the question regarding the χ² (chi-squared) statistic for a binary feature, let's analyze each option based on the provided information that P(χ² | DF = 1) < 0.05. 1. **Understanding the χ² Test**: The chi-squared test is used to determine if there is a significant association between two categorical varia...
M1 preference data
& \multicolumn{3}{c}{ extbf{ProofWriter}} & \multicolumn{3}{c}{ extbf{CLUTRR-SG}} \ \cmidrule(lr){2-4} \cmidrule(lr){5-7} Consider the following code snippet: 1 type Logger[T] = T => Unit 2 def log[T](s: T)(using log: Logger[T]): Unit = log(s) 3 var count = 0 4 given countingLogger: Logger[String] = s ...
In the provided Scala code snippet, the `Logger[T]` type alias represents a function that takes a parameter of type `T` and returns `Unit`. The `log` function is designed to take a value of type `T` along with an implicit `Logger[T]`, allowing it to invoke the logger with the provided value. The variable `count`, initi...
M1 preference data
You just started an internship in an IT services company. Your first task is about maintaining an old version of a product still used by a large customer. A bug just got fixed in the latest version of the product, and you must fix it in the old version. You ask where the source code is, and a developer shows you a repo...
To handle old versions of a product more effectively, we can implement a more structured version control strategy. Here’s a step-by-step approach: 1. **Assess the Current Repository Structure**: Start by understanding the current repositories for both the latest and old versions. Document how the old version was branc...
M1 preference data
In deep learning, which of these are hyper-parameters?
Answer: The learning rate and the number of layers are examples of hyper-parameters, but not all options qualify. Explanation: While the learning rate and the number of layers are indeed hyper-parameters, the type of weight initialization is also a hyper-parameter, and weights and biases are typically learned parameter...
M1 preference data
How is data integrity ensured in WEP?
Data integrity in the context of wireless network security refers to the protection of data from unauthorized alteration during transmission. It ensures that the data received is exactly what was sent, without any modifications or tampering. WEP (Wired Equivalent Privacy) is an early security protocol designed to prov...
M1 preference data
(Robustness) The $l_{1}$ loss is less sensitive to outliers than $l_{2}$.
Yes, that's correct! The \( l_1 \) loss, also known as the absolute loss or Manhattan loss, is defined as the sum of the absolute differences between predicted and actual values. Mathematically, for a set of predictions \( \hat{y} \) and actual values \( y \): \[ L_1 = \sum_{i=1}^n |y_i - \hat{y}_i| \] On the other h...
M1 preference data
The Fermat Test outputs `maybe prime' with probability which may be high given though $n$ is composite when ...
The correct answer is that the Fermat Test outputs 'maybe prime' with high probability when \( n \) is a Carmichael number. Carmichael numbers are composite numbers that pass the Fermat primality test for all bases \( a \) that are coprime to \( n \). This means they can falsely appear to be prime, which is a significa...
M1 preference data
In the following let $\kappa_{1}\left(\mathbf{x}, \mathbf{x}^{\prime}\right)$ and $\kappa_{2}\left(\mathbf{x}, \mathbf{x}^{\prime}\right)$ be two valid kernels. Show that the following is also valid kernel: $\kappa\left(\mathbf{x}, \mathbf{x}^{\prime}\right)=\kappa_{1}\left(f(\mathbf{x}), f\left(\mathbf{x}^{\prime}\rig...
To show that \(\kappa(\mathbf{x}, \mathbf{x}') = \kappa_1(f(\mathbf{x}), f(\mathbf{x'}))\) is a valid kernel, we need to demonstrate that it satisfies the properties of a kernel function, specifically symmetry and positive definiteness. 1. **Symmetry**: \[ \kappa(\mathbf{x}, \mathbf{x'}) = \kappa_1(f(\mathbf{x}...
M1 preference data
Let $S$ be a random variable taking values in $\{a,b,c,d,e\}$ with the following probabilities. $$egin{array}{|c|c|c|c|c|c|} \hline & a & b & c & d & e \ \hline p_S(\cdot) & 1/3 & 1/3 & 1/9 & 1/9 & 1/9\ \hline \end{array}$$ Let $\Gamma_D$ be the $D$-ary Huffman code for $S$. Let $L(S,\Gamma_D)$ be the average codeword...
To determine whether the statement is true or false, we need to analyze both the average codeword length \( L(S, \Gamma_D) \) of the Huffman code and the \( D \)-ary entropy \( H_D(S) \) of the random variable \( S \). ### Step 1: Calculate the \( D \)-ary entropy \( H_D(S) \) The \( D \)-ary entropy of a discrete ra...
M1 preference data
Which of the following hold(s) true about update deployment in the secure development lifecycle?
The best answer among the provided options is: **"Updates may bring new code that may be buggy, so additional monitoring is required after deploying an update."** Justification: 1. **Understanding of Updates**: In any software deployment, updates can introduce new functionalities, bug fixes, or security patches. Ho...
M1 preference data
You have data with lots of outliers. Everything else being equal, and assuming that you do not do any pre-processing, what cost function will be less effected by these outliers?
To evaluate which cost function is less affected by outliers, let's consider both options: ### Option (a): Mean Squared Error (MSE) The cost function is defined as: \[ MSE = \frac{1}{n} \sum_{i=1}^{n} (y_i - f(x_i))^2 \] **Merits:** - MSE squares the error term, which means that larger errors (i.e., outliers) have a ...
M1 preference data
The company in which you work has just hired a new CTO, freshly graduated from a theoretical university. The CTO decides that in order to minimize bugs in the product, all new code must now be covered at least 80% in terms of paths in the code. Is this a good idea, and why? Can you suggest something better, given the C...
Sure! Let's break this down into simpler terms. ### What is Path Coverage? Path coverage is a way to test your code by making sure that a significant number of different paths through the code are executed when you run your tests. A "path" is essentially a route that the program can take from the beginning to the end...
M1 preference data
Let $n \geq 2$ be a positive integer, and $M$ a uniformly distributed binary message of length $2n$. Let $P_K(M)$ denote the one-time pad encryption of $M$ with key $K$. Let $K_1$ be a uniformly distributed binary key length $n$. Let $K_2$ be the complement of $K_1$. Let $K_3$ be the reverse of $K_1$. Let $K_i||K_j$ de...
To evaluate whether encryption with \( K_4 = (K_1 || K_1) \) provides perfect secrecy, we need to understand the requirements of one-time pad encryption. Perfect secrecy requires the key to be as long as the message and independent for each bit. While \( K_4 \) matches the length of the message \( M \), it uses the sam...
M1 preference data
Which is NOT a mobile telephony protocol?
To identify which option is NOT a mobile telephony protocol, let's analyze each of the provided options step-by-step. ### Step 1: Define Each Protocol 1. **WPA (Wi-Fi Protected Access)**: - WPA is a security protocol designed to secure wireless networks, specifically Wi-Fi networks. It provides encryption and auth...
M1 preference data
Church booleans are a representation of booleans in the lambda calculus. The Church encoding of true and false are functions of two parameters: Church encoding of tru: t => f => t Church encoding of fls: t => f => f What does the following function implement? b => c => b (not c) c
Answer: 2) b xor c** **Explanation:** The function evaluates to `not c` when `b` is true, and it evaluates to `c` when `b` is false. This creates the behavior of an XOR operation, yielding true only when one of `b` or `c` is true but not both.
M1 preference data
Consider we use the set of transformations: insertion, deletion, substitution, and transposition. We want to compute the edit distance between words execution and exceuton, i.e. D(execution, exceuton).When computing the above, what is the value you get for D(exec,exce)?Give your answer as a numerical value.
The edit distance D(exec, exce) is 2.
M1 preference data
Are VLIWs capable of speculative execution? Explain precisely your answer and provide examples for Itanium, if appropriate..
Very Long Instruction Word (VLIW) architectures can support speculative execution, although they do so differently compared to superscalar architectures due to their design characteristics. In VLIW architectures, multiple operations can be encoded into a single instruction word, allowing for instruction-level paralleli...
M1 preference data
In this week's lecture, you have been introduced to the aggregate method of ParSeq[A] (and other parallel data structures). It has the following signature: def aggregate[B](z: B)(f: (B, A) => B, g: (B, B) => B): B Discuss, as a group, what aggregate does and what its arguments represent. Consider the parallel sequence...
The `aggregate` method is a fundamental operation in functional programming, particularly in the context of parallel data structures such as ParSeq. Its signature, `def aggregate[B](z: B)(f: (B, A) => B, g: (B, B) => B): B`, reveals the dual nature of its operation: it combines elements of type `A` in a parallel sequen...
M1 preference data
A multiset is an unordered collection where elements can appear multiple times. We will represent a multiset of Char elements as a function from Char to Int: the function returns 0 for any Char argument that is not in the multiset, and the (positive) number of times it appears otherwise: type Multiset = Char => Int Ass...
To analyze the function `secret` and determine what it computes, we need to break down the logic of the implementation. 1. **Function `diff(a, b)`:** - `diff` computes the absolute difference between the counts of each character in the two multisets `a` and `b`. For each character `x`, it calculates `Math.abs(a(x) ...
M1 preference data
Select \emph{incorrect} statement. The birthday paradox
The incorrect statement is: 4. implies that majority of people is born at full moon. This statement does not relate to the birthday paradox, which is primarily about the probability of shared birthdays in a group and does not imply anything about the specific distribution of birthdays like being born on a full moon.
M1 preference data
You have been publishing a daily column for the Gazette over the last few years and have recently reached a milestone --- your 1000th column! Realizing you'd like to go skiing more often, you decide it might be easier to automate your job by training a story generation system on the columns you've already written. Then...
A model-based metric can provide a more nuanced evaluation of generated text quality by leveraging pre-trained models that understand language context and semantics, leading to insights beyond simple surface-level comparisons. This approach can help better capture the coherence and relevance of the generated columns re...
M1 preference data
I want to send a value to Bob without him knowing which value I sent and such that I cannot change my mind later when I reveal it in clear. I should use \dots
The correct option for the scenario described in the question is **"a commitment scheme."** ### Explanation of Commitment Scheme: A commitment scheme is a cryptographic protocol that allows a sender to commit to a specific value while keeping it hidden from the receiver until a later time when the value is revealed. T...
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: The word 'mouse' appears at two different places in the toy onto...
To analyze the presence of the word 'mouse' in two different places within the toy ontology, we need to consider the implications of this duplication in terms of lexical semantics and ontology design. ### Step 1: Understanding the Ontology Structure The ontology categorizes nouns into two main groups: animate and non-...
M1 preference data
Implement kNN function (finding k nearest documents for a given document)
To implement a k-Nearest Neighbors (kNN) function for finding the k nearest documents for a given document, we need to follow a series of steps. The kNN algorithm is a type of instance-based learning where the classification of a data point is determined by the majority class among its k nearest neighbors. In the conte...
M1 preference data
& \multicolumn{3}{c}{ extbf{ProofWriter}} & \multicolumn{3}{c}{ extbf{CLUTRR-SG}} \ \cmidrule(lr){2-4} \cmidrule(lr){5-7} What does the following function implement? 1 a => b => (not a) (not b) fls
The function `1 a => b => (not a) (not b) fls` checks the values of `a` and `b`. It negates both `a` and `b`, which leads to a logical outcome. Essentially, it tells us something about the values of `a` and `b`, and it relates to operations in boolean logic. Therefore, it implements `not (a or b)`.
M1 preference data
We have a collection of rectangles in a plane, whose sides are aligned with the coordinate axes. Each rectangle is represented by its lower left corner $(x_1,y_1)$ and its upper right corner $(x_2,y_2)$. All coordinates are of type Long. We require $x_1 \le x_2$ and $y_1 \le y_2$. How can the result be computed in para...
In order to compute the union of rectangles in parallel, it is essential that the operation we use, referred to as hull2, satisfies certain properties. Specifically, hull2 must be both associative and commutative. This means that the way we group the operations should not affect the final result, and the order in which...
M1 preference data
Which one of these is a closed set?
<1>, $\mathbb{Z}$ with the addition. The integers $\mathbb{Z}$ form a closed set under addition as the sum of any two integers is also an integer.
M1 preference data
Who invented linear cryptanalysis?
To determine who invented linear cryptanalysis, we need to analyze the contributions of each individual mentioned in the options. 1. **Mitsuru Matsui**: He is known for his work on the development of linear cryptanalysis. In 1993, Matsui introduced this method as a cryptanalysis technique that exploits linear approxim...
M1 preference data
In this exercise, we will see how to combine the Principal Component Analysis (PCA) and the kernel method into an algorithm known as kernel PCA. We are given $n$ observations in a low dimensional space $\mathbf{x}_{1}, \cdots, \mathbf{x}_{n} \in \mathbb{R}^{L}$ and we consider a kernel $k$ and its associated features $...
To approach this problem, we first need to understand how the empirical covariance matrices are derived from the given matrices, $\mathbf{X}$ and $\boldsymbol{\Phi}$. 1. **Covariance Matrix $\boldsymbol{\Sigma}$**: We start with the definition of $\boldsymbol{\Sigma}$, which is given as: $$ \boldsymbol{\Sig...
M1 preference data
What is the name of the encryption threat that corresponds to \emph{force the sender to encrypt some messages selected by the adversary}?
To determine the correct option that corresponds to the threat of forcing the sender to encrypt messages selected by the adversary, we can analyze each option systematically. 1. **Chosen Ciphertext Attack (CCA)**: - In a chosen ciphertext attack, the attacker can choose arbitrary ciphertexts and obtain their corres...
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$. Is it possible to enforce a ranking $d_2 > d_1$ with vector space retrieval and $d_1 > d_2$ with probabilistic retrieval ($\lambda=0.5$), by adding the same doc...
To analyze whether it's possible to enforce a ranking \( d_2 > d_1 \) with vector space retrieval and \( d_1 > d_2 \) with probabilistic retrieval by adding the same documents to the collection, let's first define how both retrieval models work. ### Vector Space Retrieval In vector space retrieval, documents and queri...
M1 preference data
Considering the transaction below, which one is WRONG? |Transaction ID |Items Bought| |--|--| |1|Tea| |2|Tea, Yoghurt| |3|Tea, Yoghurt, Kebap| |4 |Kebap | |5|Tea, Kebap|
Answer: 4 Reasoning: The statement “{Yoghurt} has the lowest support among all itemsets” is incorrect. Yoghurt appears in transactions 2 and 3, giving it a support of 2/5 = 40%, which is not the lowest. For example, {Yoghurt, Kebap} appears only once, with a support of 1/5 = 20%, which is lower.
M1 preference data
You need to quickly find if a person's name is in a list: that contains both integers and strings such as: list := ["Adam Smith", "Kurt Gödel", 499, 999.95, "Bertrand Arthur William Russell", 19.99, ...] What strategy can you use?
To determine if a person's name is in a list that contains both integers and strings, we need to consider the nature of the data and the operations we can perform: 1. **Data Type Compatibility**: The list contains both strings (names) and non-string types (integers, floats). This mixed data type means we cannot sort t...
M1 preference data
Provide a precise definition of concatenative morphology and illustrate your answer with concrete examples in English or French. Is this type of morphology relevant for all languages? More generally, is morphology of the same complexity for all languages?
### Definition of Concatenative Morphology **Concatenative morphology** is a type of morphological process where morphemes (the smallest units of meaning) are joined together in a linear sequence to form words. This process involves the addition of prefixes, suffixes, infixes, or other morphological elements to a base...
M1 preference data
Using a 4-gram character model, comparing "banana" and "ananas"...
Let's eliminate the wrong options: 1. **is the same as comparing "aaabnn" to "aaanns"**: This option compares the frequency of characters rather than the actual sequences of 4-grams, which is not relevant to the model being discussed. 2. **is the same as comparing P(bana) to P(anan)**: This option incorrectly compare...
M1 preference data
Tick the \textbf{\emph{correct}} assertion. A random oracle $\ldots$
The correct assertion is that a random oracle answers with random values that are always independent of the previous queries. This means that each query to the oracle produces a response that does not depend on any other queries made previously.
M1 preference data
Assume that you are part of a team developing a mobile app using Scrum. When using the app, you identified multiple bugs and features which you think should be implemented, and took some notes. You want to share these with the Product Owner. Your backlog of tasks includes the following task: - [ ] As a registered user,...
The item is a user story, making it suitable for the Product Backlog. 1. **User Story Format**: It follows the As a [user], I can [action], so that [benefit] format. 2. **User Perspective**: It focuses on the user experience, which is essential in Agile. 3. **Specificity**: It clearly describes what the user can do, ...
M1 preference data
Let $\mathcal{C}$ be the $(6,3)$ linear code on $\mathbb{F}_3$ whose parity-check matrix is egin{equation*} H = egin{pmatrix} 2 &0 &1 &1 &1 &0 \ 1 &2 &0 &0 &1 &1 \ 0 &0 &0 &1 &1 &1 \end{pmatrix}. \end{equation*} True or false: The sequence $\mathbf{y} = 111000$ is a codeword of $\mathcal{C}$.
To determine whether the sequence \(\mathbf{y} = 111000\) is a codeword in the linear code \(\mathcal{C}\) defined by the given parity-check matrix \(H\), we need to use the properties of linear codes and the parity-check matrix. A sequence \(\mathbf{y}\) is a codeword of the code generated by the parity-check matrix ...
M1 preference data
Select the \emph{incorrect} statement. Euler Theorem
To identify the incorrect statement about Euler's Theorem and its implications, we will analyze each option in detail. ### Overview of Euler's Theorem Euler's Theorem states that if \( a \) is an integer coprime to \( n \), then: \[ a^{\varphi(n)} \equiv 1 \pmod{n}, \] where \( \varphi(n) \) is Euler's totient functi...
M1 preference data
Consider a regression task. You are using your favorite learning algorithm with parameters w and add a regularization term of the form $\frac{\lambda}{2}\|\mathbf{w}\|^{2}$. Which of the following statements are correct for a typical scenario?
Let's revise the answer by incorporating the feedback from the critique, ensuring clarity, completeness, and proper definitions of key terms. --- ### Question: Consider a regression task. You are using your favorite learning algorithm with parameters \( \mathbf{w} \) and add a regularization term of the form \( \frac...
M1 preference data
Let $\xv_1, . . . , \xv_N$ be a dataset of $N$ vectors in $\R^D$. Write down the covariance matrix of the dataset $\Xm = (\xv_1, . . . , \xv_N) \in \R^{D imes N}$, \emph{and} state its dimensions. Data is centered.
1. **Overview**: The task is to derive the covariance matrix of a centered dataset consisting of $N$ vectors in $\mathbb{R}^D$. The covariance matrix is a crucial statistical tool that captures the relationships and variances of different dimensions in the dataset. In this case, the data is centered, meaning the mea...
M1 preference data
Which statement about extit{black-box} adversarial attacks is true:
Black-box adversarial attacks do not require access to the model's gradients, which means attackers can estimate these gradients using methods like finite difference approximations, where they slightly change the input and observe the output. This allows them to create adversarial examples without knowing the model's i...
M1 preference data
In this problem, we consider a generalization of the min-cost perfect matching problem. The generalization is called the \emph{min-cost perfect $b$-matching problem} and is defined as follows: \begin{description} \item[Input:] A graph $G = (V,E)$ with edge costs $c: E \rightarrow \mathbb{R}$ and degree bounds $b: V \ri...
To suggest that every extreme point solution to the linear programming relaxation of the min-cost perfect \( b \)-matching problem in a bipartite graph is integral, we can cite the characteristics of bipartite graphs and the nature of the linear program. In bipartite graphs, the vertices are divided into two sets such ...
M1 preference data
What is the inverse of 28 in $\mathbf{Z}_{77}$?
To find the inverse of 28 in \(\mathbf{Z}_{77}\), we need to find an integer \(x\) such that: \[ 28x \equiv 1 \pmod{77} \] This means we want to find \(x\) such that when \(28x\) is divided by 77, the remainder is 1. The inverse exists if and only if 28 and 77 are coprime (i.e., their greatest common divisor (gcd) is...
M1 preference data
Which of the following is WRONG about inverted files? (Slide 24,28 Week 3)
To determine which statement about inverted files is wrong, let's analyze each option step by step: 1. **The space requirement for the postings file is O(n)**: - This statement is generally true. The size of the postings file is proportional to the number of postings (or occurrences of terms in documents). As the n...
M1 preference data
Tick the \textbf{non-commutative} operation.
The non-commutative operation from the given options is: 3. $-$ (subtraction) over $\mathbb{Z}$. **Explanation:** - An operation is said to be commutative if changing the order of the operands does not change the result, i.e., for an operation \( \ast \), it holds that \( a \ast b = b \ast a \) for all \( a \) and \(...
M1 preference data
Let $H$ be a hash function. Collision resistance means that \dots
To determine which option best describes the concept of collision resistance in the context of hash functions, let's analyze each option:\n\nA. **given \( y \), it is hard to find \( x \) such that \( H(x) = y \)** \nThis describes pre-image resistance, not collision resistance. Pre-image resistance means that for a g...
M1 preference data
A bag contains the letters of LETSPLAY. Someone picks at random 4 letters from the bag without revealing the outcome to you. Subsequently you pick one letter at random among the remaining 4 letters. What is the entropy (in bits) of the random variable that models your choice? Check the correct answer.
To determine the entropy of your choice, we first need to understand how many letters remain after 4 have been picked from the letters of "LETSPLAY." The original set has 8 unique letters (L, E, T, S, P, A, Y). After 4 letters are picked, 4 letters remain. The random variable representing your choice has 4 possible ou...
M1 preference data
You share an apartment with friends. Kitchen, living room, balcony, and bath room are shared resources among all parties. Which policy/policies violate(s) the principle of least privilege?
To determine which policy violates the principle of least privilege, let's analyze each option step-by-step: 1. **Different bedrooms do not have a different key.** - **Analysis:** If all roommates have the same key for each other's bedrooms, then anyone can enter any bedroom, regardless of whether they need to. T...
M1 preference data
In the following let $\kappa_{1}\left(\mathbf{x}, \mathbf{x}^{\prime}\right)$ and $\kappa_{2}\left(\mathbf{x}, \mathbf{x}^{\prime}\right)$ be two valid kernels. Show that the following is also valid kernel: $\kappa\left(\mathbf{x}, \mathbf{x}^{\prime}\right)=\kappa_{1}\left(\mathbf{x}, \mathbf{x}^{\prime}\right) \kappa...
To show that the product of two valid kernels \(\kappa_{1}(\mathbf{x}, \mathbf{x}^{\prime})\) and \(\kappa_{2}(\mathbf{x}, \mathbf{x}^{\prime})\) is also a valid kernel, we need to demonstrate that the function \(\kappa(\mathbf{x}, \mathbf{x}^{\prime}) = \kappa_{1}(\mathbf{x}, \mathbf{x}^{\prime}) \kappa_{2}(\mathbf{x}...
M1 preference data
Consider a hash function $H$ with $n$ output bits. Tick the \emph{incorrect} assertion.
To determine which assertion about a hash function \( H \) with \( n \) output bits is incorrect, let's analyze each option with respect to the properties of hash functions and the implications of the birthday paradox. 1. **Due to the birthday paradox, an output collision of \( H \) can be found much faster than with ...
M1 preference data
When computing HITS, the initial values
The answer is that the initial values for the HITS algorithm are set all to 1, offering a uniform starting point that aids in the convergence of the iterative calculations for authority and hub scores.
M1 preference data
Select the \emph{incorrect} statement. The brute force attack \dots
The incorrect statement is: "can break a cipher with a 128 128-bit key on your PC today." This statement is incorrect because, as of my last training data, breaking a cipher with a 128-bit key through brute-force means exhausting all possible key configurations, which is computationally infeasible with current techn...
M1 preference data
In x86, select all synchronous exceptions?
To analyze the question regarding synchronous exceptions in the x86 architecture, we first need to clarify the core concepts involved. ### Core Concepts - **Synchronous Exceptions**: These are exceptions that occur as a direct result of executing an instruction. They are predictable and occur at the point of instruct...
M1 preference data
In Itanium's procedure call and return mechanism, What problem might arise when the processor executes erb+alloc+? Which mechanisms could be used to handle the problem? Feel free to mention what Itanium actually does (if you recall it), but list any effective solution th...
In Itanium architecture, the procedure call and return mechanism leverages a stack-based approach for managing function calls and local variables. The problem that may arise when executing `berb+alloc+` (a hypothetical function call) could be related to stack management, particularly stack overflow or corruption. ### ...
M1 preference data
Consider the source $S_1, S_2, \dots$ such that $S_1$ is uniformly distributed on $\mathbb{Z}/10\mathbb{Z}^*$, and for every $n\geq 1$, $S_{n+1}$ is distributed uniformly on $\mathbb{Z}/(S_n+1)\mathbb{Z}^*$. Let $H(\mathcal{S}) = \lim_{n o\infty} H(S_n)$. True or false: $H(\mathcal{S}) = 0$.
1, True. The entropy approaches zero as the sequence converges to deterministic values, leading to lower uncertainty in the distribution over time.
M1 preference data
Which of the following apply to recent Android-based mobile systems but not to Linux-based desktop systems?
The correct options that apply to recent Android-based mobile systems but not to Linux-based desktop systems are A, B, and C. A. Apps should use the binder interface to communicate with other apps: This is specific to Android's architecture, where the binder IPC (Inter-Process Communication) mechanism is used for effic...
M1 preference data
ASLR stands for
The question asks for the meaning of the acronym ASLR, which is essential in the context of computer security. 1. **Analyze each option**: - **0. Address Space Layout Randomization**: **Correct.** ASLR is a security technique that randomizes memory addresses used by processes, making it harder for attackers to expl...
M1 preference data
Consider the LP-rounding algorithm for Set Cover that works as follows: \begin{enumerate} \item Solve the LP relaxation to obtain an optimal solution $x^*$. \item Return the solution $\{S: x^*_S >0\}$, i.e., containing all sets with a positive value in the fractional solution. \end{enumerate} Use the complementarity sl...
To establish that the LP-rounding algorithm for Set Cover is an $f$-approximation algorithm using complementarity slackness conditions, we start with the formulation of the Set Cover problem and its linear programming relaxation. ### Step 1: LP Formulation The Set Cover problem can be formulated as follows: - Let \(...
M1 preference data
Implement a function that takes a lists ls as argument and returns the length of the longest contiguous sequence of repeated elements in that list. For this second question, you are required to use foldLeft in your solution, and your solution should not be recursive. For example: longest(List(1, 2, 2, 5, 5, 5, 1, 1, 1)...
To solve the problem of finding the length of the longest contiguous sequence of repeated elements in a list using `foldLeft`, we need to define a few steps and concepts in our implementation. ### Steps to Approach the Problem: 1. **Define the State**: We need to maintain a state that keeps track of: - The current...
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: "Do I have to do one "commit" each day with my day's work?" What would be ...
To address your colleague's question about whether they should make one commit each day with their day's work, we need to break down the concept of version control and the purpose of commits in a modern development workflow. ### Understanding Version Control Version control systems (VCS), like Git, are used to manage...
M1 preference data
The Merkle-D{\aa}mgard construction is
To determine the correct answer regarding the Merkle-D{\aa}mgard construction, follow these steps: 1. **Understand the Purpose**: The Merkle-D{\aa}mgard construction is designed to create a hash function from a compression function. 2. **Identify the Components**: The construction uses an iterative approach where a f...
M1 preference data
Consider a Generative Adversarial Network (GAN) which successfully produces images of goats. Which of the following statements is false?
The false statement among the options provided is: - **After the training, the discriminator loss should ideally reach a constant value.** **Justification:** In a well-trained GAN, the goal is for the generator to produce images that are indistinguishable from real images to the discriminator. If the discriminator re...
M1 preference data
Your colleague wants to improve the performance of a web application by caching common results in an in-memory LRU cache, where the least recently used results are evicted when the cache is full, and wants your opinion on the best way to implement it. He has already implemented the "Cache" interface, which he will use ...
Imagine you're trying to grab a snack from a cupboard. If the cupboard is well-organized, you can quickly find your favorite snack without much hassle. However, if every time you reach for that snack, you have to wait for someone else to hand it to you, it becomes frustrating and slows down your snacking process. This ...
M1 preference data
You are using a 3-layer fully-connected neural net with \textbf{ReLU activations}. Your input data has components in [0, 1]. \textbf{You initialize all your weights to -10}, and set all the bias terms to 0. You start optimizing using SGD. What will likely happen?
To analyze the situation, let's break down the components of the question: 1. **Network Structure**: You have a 3-layer fully-connected neural network with ReLU (Rectified Linear Unit) activations. The ReLU activation function outputs the input directly if it is positive; otherwise, it outputs zero. 2. **Weight Initi...
M1 preference data
Tick the \textbf{incorrect} assumption. A language $L$ is in NP if\dots
The incorrect assumption about a language \( L \) being in NP is: - \( L \) is NP-hard. ### Explanation: 1. **\( x \in L \) can be decided in polynomial time.** - This statement is incorrect for languages in NP. While languages in P (which can be decided in polynomial time) are also in NP, not all languages in NP...
M1 preference data
Implement the recall at k metric
Answer:** Here is the correct implementation of the recall at k metric in Python: ```python def recall_at_k(retrieved, ground_truth, k): """ Compute the recall at k metric. :param retrieved: List of retrieved items (e.g., tweets). :param ground_truth: List of relevant items (e.g., ground truth tw...
M1 preference data
Let $y_1, y_2, \ldots, y_n$ be uniform random bits. For each non-empty subset $S\subseteq \{1,2, \ldots, n\}$, define $X_S = \oplus_{i\in S}\:y_i$. Show that the bits $\{X_S: \emptyset \neq S\subseteq \{1,2, \ldots, n\} \}$ are pairwise independent. This shows how to stretch $n$ truly random bits to $2^n-1$ pairwise in...
To show that the random bits \( \{X_S: \emptyset \neq S \subseteq \{1, 2, \ldots, n\} \} \) are pairwise independent, we need to demonstrate two key properties: 1. **Expectation of \(X_S\)**: We need to show that \(\mathbb{E}[X_S] = \frac{1}{2}\) for any non-empty subset \(S\). 2. **Expectation of the product \(X_S X_...
M1 preference data
Tick the \emph{minimal} assumption on the required channel to exchange the key of a Message Authentication Code (MAC):
To determine the minimal assumption required for a channel to exchange the key of a Message Authentication Code (MAC), we can analyze the options provided: 1. **Nothing**: This option suggests that no assumptions are needed, which is unrealistic since exchanging a key requires at least some level of security. 2. **Au...
M1 preference data
Which of the following is true?
Let's analyze the question step by step: ### Step 1: Define precision and recall - **Precision** is defined as the ratio of true positives (TP) to the total number of predicted positives (TP + false positives (FP)): \[ \text{Precision} = \frac{TP}{TP + FP} \] - **Recall** (also known as sensitivity or true pos...
M1 preference data
Consider the following toy corpus: the cat cut the hat What is the probability of the following sequences, if the parameters are estimated using MLE (maximum-likelihood estimation) on the above corpus (make use of a calculator or even a short program): - cutthechat - cut the chat Fully justify your answer.
To calculate the probabilities of the sequences "cutthechat" and "cut the chat" using Maximum Likelihood Estimation (MLE) based on the given corpus "the cat cut the hat", we will follow these steps: ### Step 1: Preprocess the Corpus We first remove spaces from the corpus for bigram analysis: - Corpus without spaces: *...
M1 preference data
We represent $GF(2^8)$ as $\mathbb{Z}_2[X]/P(X)$ where $P(X) = X^8 + X^4+X^3+X+1$. Then, $(X^7+X^6)\times (X + 1)=$\dots
To solve the multiplication \((X^7 + X^6) \times (X + 1)\) in \(GF(2^8)\) where the coefficients are taken modulo 2, we can proceed with the following steps: 1. **Distribute the terms**: \[ (X^7 + X^6) \times (X + 1) = X^7 \cdot (X + 1) + X^6 \cdot (X + 1) \] This gives us: \[ = X^7 \cdot X + X^7 \c...
M1 preference data
Consider the following definition of trees representing higher-order functions, as well as a recursive function subst0. 1 enum Expr: 2 case C(c: BigInt) 3 case N(name: String) 4 case BinOp(op: BinOps, e1: Expr, e2: Expr) 5 case IfNonzero(cond: Expr, trueE: Expr, falseE: Expr) 6 case Call(fun: Expr, arg: Expr) 7 case Fu...
To solve the problem of substituting a variable in the given expression using the `subst0` function, we will analyze the expression step-by-step, ensuring clarity in each part of the process. ### Step 1: Understanding the Expression The expression we have is: ```scala Call(N("exists"), Fun("y", Call(Call(N("less"), ...
M1 preference data
Assume your team is considering adding support for the SwengPhotos cloud service, which provides upload and download of photos on private cloud storage. Each photo is associated with a unique name. SwengPhotos's documentation for the "upload new photo" interface describes the following error responses: 1. I/O error 2. ...
In Java, exceptions are categorized into two main types: checked exceptions and unchecked exceptions. Checked exceptions are those that must be either caught or declared in the method signature, as they are anticipated during normal operation of the application. Unchecked exceptions, on the other hand, represent progra...
M1 preference data
Which of the following congruence classes has a multiplicative inverse?
To determine which of the given congruence classes has a multiplicative inverse, we need to analyze each option in terms of their respective modulus and check if they are coprime to their moduli. A number has a multiplicative inverse modulo \( n \) if and only if it is coprime to \( n \) (i.e., their greatest common di...
M1 preference data
The needed number of DES operations to attack DES is about ...
The answer is option 1: $2^{54}.$ The Data Encryption Standard (DES) employs a key size of 56 bits, which theoretically allows for $2^{56}$ possible keys. However, due to certain known vulnerabilities and effective attack strategies, the practical effort required to break DES through brute force is estimated to be arou...
M1 preference data
The number of term vactors in the matrix K_s, used for LSI
To answer the question regarding the number of term vectors in the matrix \( K_s \) used for Latent Semantic Indexing (LSI), we need to consider how LSI operates and the relationship between the term-document matrix \( M \) and the reduced matrix \( K_s \). 1. **Understanding the term-document matrix \( M \)**: - T...
M1 preference data