Dataset Viewer
Auto-converted to Parquet Duplicate
prompt
stringlengths
37
2.3k
sft
stringlengths
1
11.2k
Let $$G= egin{pmatrix} 1 &1 &1 &0 &1 &0\ 0 &1 &1 &1 &0 &0\ 0 &1 &1 &0 &0 &0\ 0 &1 &1 &1 &0 &1 \end{pmatrix}$$ be the generator matrix of a $(6,4)$ linear code $\mathcal C$ over $\mathbb F_2$. True or false: If one substitutes the last row of $G$ by $(1,0,0,1,1,1)$, the thereby obtained matrix generates the same code ...
1. False 2. True
Which mode of operation is similar to a stream cipher? 1. ECB 2. OFB 3. CFB 4. CBC
1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. ECB Answer: 1. EC...
Explain how precise exceptions are implemented in dynamically-scheduled out-of-order processors.
The exception handling mechanism in dynamically-scheduled out-of-order processors is implemented by the exception handler, which is a special instruction that is executed when an exception is detected. The exception handler is responsible for saving the state of the program counter (PC) and the program counter register...
Devise an algorithm that, without consensus, implements a weaker specification of NBAC by replacing the termination property with weak termination. Weak termination: Let p be a distinguished process, known to all other processes. If p does not crash then all correct processes eventually decide. Your algorithm may use ...
Let p be a distinguished process, known to all other processes. If p does not crash then all correct processes eventually decide. Your algorithm may use a perfect failure detector. Let p be a distinguished process, known to all other processes. If p does not crash then all correct processes eventually decide. Your alg...
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...
The CTO's objective is not to minimize bugs, but to minimize the number of bugs. The CTO's objective is to minimize the number of bugs, not to minimize the number of paths. The CTO's objective is to minimize the number of paths, not to minimize the number of bugs. The CTO's objective is to minimize the number of paths,...
You are responsible for a project aiming at providing on-line recommendations to the customers of a on-line book selling company. The general idea behind this recommendation system is to cluster books according to both customers and content similarities, so as to propose books similar to the books already bought by a g...
d1: [0, 1, 0, 0, 0, 0] d2: [0, 0, 1, 0, 0, 0] d3: [0, 0, 0, 1, 0, 0] d4: [0, 0, 0, 0, 1, 0] d5: [0, 0, 0, 0, 0, 1] d6: [0, 0, 0, 0, 0, 0] The vector representation of a document is the vector of the words that appear in it. In this case, the vector representation of d1 is [0, 1, 0, 0, 0, 0], the vector representation ...
Which of the following statement(s) is/are true about Safe Exception Handling (SEH)? 1. Neither SafeSEH nor SeHOP checks the order and number of exception handlers. 2. The implementation of SEH is compiler specific. 3. SEH is a defense that protects C/C++ programs against control-flow hijack attacks through changing ...
1, 2, 3, 4 Answer: 1. True. SEH does not check the order or number of exception handlers. 2. True. SEH is a compiler-specific feature. 3. True. SEH is a defense against control-flow hijack attacks. 4. True. SafeSEH provides stronger protection than SeHOP.
Design an algorithm that implements consensus using multiple TRB instances.
The algorithm is as follows: 1. Initialize the TRB instances with the same initial state. 2. For each iteration, update the state of each TRB instance using the consensus algorithm. 3. If the state of all TRB instances is the same, the algorithm terminates. Otherwise, it continues to the next iteration. 4. Repeat step...
Explain why any fail-noisy consensus algorithm (one that uses an eventually perfect failure detector ◇P) requires a majority of the processes to be correct. More precisely, provide a “bad run” in the case where the majority of processes is faulty.
Suppose that the majority of processes is faulty. Then, by the definition of consensus, there is a run in which the majority of processes are faulty, and the majority of processes are not in consensus. This is a “bad run” because the majority of processes are faulty, and the majority of processes are not in consensus.
(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. 1. True 2. False
1.
Tick the \textbf{false} assertion. For a Vernam cipher... 1. SUPERMAN can be the result of the encryption of the plaintext ENCRYPT 2. CRYPTO can be used as a key to encrypt the plaintext PLAIN 3. SERGE can be the ciphertext corresponding to the plaintext VAUDENAY 4. The key IAMAKEY can be used to encrypt any message...
1. 2. 3. 4. Answer: 1. False. The key is the same as the plaintext. 2. True. The key is the same as the plaintext. 3. False. The key is the same as the plaintext. 4. True. The key is the same as the plaintext.
Prove that if a^2 is even, a is even.
If a^2 is even, then a is even. If a is odd, then a^2 is odd. If a is even, then a^2 is even.
In the χ2 statistics for a binary feature, we obtain P(χ2 | DF = 1) > 0.05. This means in this case, it is assumed: 1. That the class labels depends on the feature 2. That the class label is independent of the feature 3. That the class label correlates with the feature 4. None of the above
2. That the class label is independent of the feature
Which of the following graph analysis techniques do you believe would be most appropriate to identify communities on a social graph? 1. Cliques 2. Random Walks 3. Shortest Paths 4. Association rules
1. Cliques Answer: 2. Random Walks Answer: 3. Shortest Paths Answer: 4. Association rules
Tick the \emph{incorrect} assertion. A cipher $C$ perfectly decorrelated at order 2 implies\dots 1. perfect secrecy when used twice. 2. security against differential cryptanalysis. 3. security against linear cryptanalysis. 4. security against exhaustive search.
4.
You have been hired to evaluate an email monitoring system aimed at detecting potential security issues. The targeted goal of the application is to decide whether a given email should be further reviewed or not. Give four standard measures usually considered for the evaluation of such a system? Explain their meaning. B...
The four standard measures for evaluating an email monitoring system are: 1. **False Positive Rate (FPR)**: This measures the proportion of emails that are incorrectly flagged as potential security issues. A low FPR is desirable as it minimizes unnecessary further review of legitimate emails. 2. **False Negative Rate...
Consider a bipartite graph $G=(V,E)$ where $V$ is partitioned into $A$ and $B$. Let $(A, \mathcal{I})$ be the matroid with ground set $A$ and \begin{align*} \mathcal{I} = \{ A' \subseteq A: \mbox{ $G$ has a matching in which every vertex of $A'$ is matched}\}\,. \end{align*} Recall that we say that a vertex is matched ...
The first axiom is trivially satisfied. For the second axiom, suppose that $A' \subseteq A$ and $A'' \subseteq A$ are two sets such that $A' \cup A'' = A$. Let $M$ be a matching in $G$ such that every vertex in $A'$ is matched. Then $M$ also matches every vertex in $A''$ since $A' \cup A'' = A$. Therefore, $M$ is a mat...
The encryption in GSM is done by ... 1. A3. 2. A8. 3. E0. 4. A5.
4. A5. Answer: The encryption in GSM is done by A5.
Why a data prefetcher could hinder a Prime+Probe cache attack? How can the attacker overcome this problem?
A data prefetcher could hinder a Prime+Probe cache attack because it can cause the attacker to miss the target data. The attacker can use the data prefetcher to prefetch data from the target memory location, which can cause the attacker to miss the target data. The attacker can overcome this problem by using a techniqu...
Birthday attacks \dots 1. are used to break Google Calendars. 2. can be used to find collisions in hash functions. 3. are equivalent to exhaustive search. 4. imply that a majority of people is born in Spring.
2.
Consider the following snippet used to produce a high-performance circuit using a statically scheduled HLS tool, such as Xilinx Vivado HLS. Assume that a erb+double+ multiplication takes several cycles (latency) to compute. egin{verbatim...
The code snippet is fundamentally problematic for a tool aimed at producing statically scheduled pipelined circuits. The code is not properly pipelined, as it does not take advantage of the parallelism inherent in the multiplication operation. The multiplication operation is performed in parallel, but the code does not...
Which of AddressSanitizer (ASan), MemorySanitizer (MemSan), UndefinedBehaviorSanitizer (UBSan) or ThreadSanitizer (TSan) can detect bugs (if any) in the following code snippet? \begin{lstlisting}[language=C,style=c] int sum_up_to(int x) {} // Return sum of integers up to x int result = x; for (...
6.
One of the following ciphers is a \emph{block} cipher. Which one? 1. AES 2. RC4 3. A5/1 4. MD5
1. AES 2. RC4 3. A5/1 4. MD5 Answer: 1. AES 2. RC4 3. A5/1 4. MD5
Consider the following case class definitions: case class Node(id: Int) case class Edge(from: Node, to: Node) Let us represent a directed graph G as the list of all its edges (of type List[Edge]). We are interested in computing the set of all nodes reachable in exactly n steps from a set of initial nodes. Write a reach...
The reachable function can be implemented as follows: def reachable(n: Int, init: Set[Node], edges: List[Edge]): Set[Node] = { val reachable = Set.empty[Node] for (edge <- edges) { if (edge.from in init && edge.to in reachable) reachable += edge.to } if (n == 0) reachable else reachable +: reachable(reachable(n - 1, in...
Implement Item-based collaborative filtering using the following formula: \begin{equation} {r}_{x}(a) = \frac{\sum\limits_{b \in N_{I}(a)} sim(a, b) r_{x}(b)}{\sum\limits_{b \in N_{I}(a)}|sim(a, b)|} \end{equation} You will create a function that takes as input the ratings and the similarity matrix and gives as outp...
1.5
When compressing the adjacency list of a given URL, a reference list 1. Is chosen from neighboring URLs that can be reached in a small number of hops 2. May contain URLs not occurring in the adjacency list of the given URL 3. Lists all URLs not contained in the adjacency list of given URL 4. All of the above
4. All of the above
The elements of $\mathbf{Z}_{14}^*$ are 1. $\{ 0, 1, 3, 5, 9, 11, 13\}$ 2. $\{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13\}$ 3. $\{ 1, 3, 5, 9, 11, 13\}$ 4. $\{ 1, 2, 3, 9, 11 \}$
2.
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...
The algorithm \textsc{FindDisconnectedSet}$(v_2)$ is as follows: 1. Let $S$ be the set of vertices $i$ such that $v_2(i) = 1$. 2. If $S \neq \emptyset$, then return $S$. 3. Otherwise, let $S$ be the set of vertices $i$ such that $v_2(i) = 0$. 4. If $S \neq \emptyset$, then return $S$. 5. Otherwise, return $\emptyset$....
A sequential object is a tuple T = (Q, q0, O, R, ∆), where: ● Q is a set of states. ● q0 ∈ Q is an initial state. ● O is a set of operations. ● R is a set of responses. ● ∆ ⊆ (Q × Π × O) × (Q × R) is a relation that associates a state, a process, and an operation to a set of possible new states and responses. Processes...
The object is defined as follows: T = (Q, q0, O, R, ∆), where: ● Q = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,...
Check the correct statement concerning a standard-array-based decoder. 1. For the same input, the decoder output depends on the choice of the coset leader. 2. The syndrome of a specific coset depends on the choice of the coset leader. 3. All the other statements are incorrect.
3.
Which of the following statements is correct concerning the use of Pearson’s Correlation for user- based collaborative filtering? 1. It measures whether different users have similar preferences for the same items 2. It measures how much a user’s ratings deviate from the average ratings I 3. t measures how well the re...
1. It measures whether different users have similar preferences for the same items 2. It measures how much a user’s ratings deviate from the average ratings I 3. t measures how well the recommendations match the user’s preferences 4. It measures whether a user has similar preferences for different items Answer: 1. It m...
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...
Let $G = (V, A)$ be a directed graph with $|V| = n$ and $|A| = m$. Let $U$ be a random partition of $V$ into two sets, each of size $n/2$. Let $W = V \setminus U$. Let $X$ be the set of arcs $(i, j)$ with $i \in U$ and $j \in W$. Let $Y$ be the set of arcs $(i, j)$ with $i \in W$ and $j \in U$. Let $Z$ be the set of ar...
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
No. If process i fails, then eventually all processes j≠i fail. If no process j≠i fails, then process i must have failed.
Can we implement TRB with an eventually perfect failure detector ◇P, under the assumption that at least one process can crash?
Yes, we can implement TRB with an eventually perfect failure detector ◇P, under the assumption that at least one process can crash.
We will analyze the $K$-means algorithm and show that it always converge. Let us consider the $K$-means objective function: $$ \mathcal{L}(\mathbf{z}, \boldsymbol{\mu})=\sum_{n=1}^{N} \sum_{k=1}^{K} z_{n k}\left\|\mathbf{x}_{n}-\boldsymbol{\mu}_{k}\right\|_{2}^{2} $$ where $z_{n k} \in\{0,1\}$ with $\sum_{k=1}^{K} z_{n...
The $z_{n k}$ are the probabilities of the $n$-th data point belonging to the $k$-th cluster. The closed-form formula for the $z_{n k}$ is: $$ z_{n k}=\frac{\left\|\mathbf{x}_{n}-\boldsymbol{\mu}_{k}\right\|_{2}^{2}}{\sum_{k=1}^{K}\left\|\mathbf{x}_{n}-\boldsymbol{\mu}_{k}\right\|_{2}^{2}} $$ The $z_{n k}$ are the prob...
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...
1. False Let $M$ be a uniformly distributed binary message of length $2n$. Let $K_1$ be a uniformly distributed binary key of 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$ denote the concatenation of the two keys. Encryption with the key $K_6 = ( K_1|| K_3 )$, $...
(Neural networks) Training only the first layer of a deep neural network using the logistic loss is equivalent to training a logistic regression over a transformed feature space. 1. True 2. False
1. True Explanation: Training only the first layer of a deep neural network using the logistic loss is indeed equivalent to training a logistic regression over a transformed feature space. This is because the first layer of a deep neural network typically represents the input features, and the logistic loss function i...
There are N philosphers sitting around a circular table eating spaghetti and discussing philosphy. The problem is that each philosopher needs two forks to eat, and there are only $N$ forks, one between each pair of philosophers. We want to design an algorithm that the philosophers can use, that ensures that no one star...
No. The philosopher p%n will eat for a while, but then he will take the fork p%n+1 and will eat for a while again. This will continue until the philosopher p%n+1 eats for a while, and then he will take the fork p%n and will eat for a while again. This will continue until the philosopher p%n+1 eats for a while, and then...
Fill the missing line of code: (one answer)\\ \hspace*{.5cm} \#code missing\\ \hspace*{.5cm} np.mean(np.random.randn(1000))\\ 1. import np 2. import numpy 3. import numpy as np 4. import np.mean\\ import np.random
1. import np 2. import numpy 3. import numpy as np 4. import np.mean
Once paging is enabled, load instruction / CR3 register / Page Table entry uses Virtual or Physical address? 1. Physical / Physical / Physical 2. Physical / Physical / Virtual 3. Virtual / Physical / Physical 4. Virtual / Virtual / Virtual 5. Virtual / Virtual / Physical
3.
Write modular code (i.e., a function) to divide your training data into 𝑁 folds and perform cross-validation. For each possible combination of the two hyperparameters (see below for the range of values that you should try for each hyperparameter), train your model in a cross-validation setup with 𝑁=20 folds.
The code is given below. The function is called cv_train() and it takes as input the hyperparameters 𝑎 and 𝑏 and the number of folds 𝑁. The function returns the training and test errors for each combination of the two hyperparameters. The function cv_train() is called with 𝑁=20 and the hyperparameters 𝑎=0.5 and 𝑏...
Which of the following hold(s) true about update deployment in the secure development lifecycle? 1. Updates may bring new code that may be buggy, so additional monitoring is required after deploying an update. 2. One motivation for automatic updates is for manufacturers to ensure that users...
1, 2, 4
Which of the following arguments is correct? 1. All students in this class understand math. Alice is a student in this class. Therefore, Alice doesn’t understand math. 2. Every physics major takes calculus. Mathilde is taking calculus. Therefore, Mathilde is a physics major. 3. All cats like milk. My pet is not a ca...
1. 2. 3. 4.
If process i fails, then eventually all processes j≠i fail Is the following true? If no process j≠i fails, then process i has failed
No. Consider the following example: there are two processes, A and B. Process A is the one that fails. Then process B is the one that fails.
The inverse document frequency of a term can increase 1. by adding the term to a document that contains the term 2. by removing a document from the document collection that does not contain the term 3. by adding a document to the document collection that contains the term 4. by adding a document to the document col...
3. by adding a document to the document collection that contains the term The inverse document frequency (IDF) of a term is a measure of how rare a term is in a document collection. It is calculated as the logarithm of the total number of documents in the collection divided by the number of documents that contain the ...
In the setting of EM, where $x_{n}$ is the data and $z_{n}$ is the latent variable, what quantity is called the posterior? 1. (a) $\square p\left(\mathbf{x}_{n} \mid z_{n}, \boldsymbol{\theta}\right)$ 2. (b) $\square p\left(\mathbf{x}_{n}, z_{n} \mid \boldsymbol{\theta}\right)$ 3. (c) $\square p\left(z_{n} \mid \math...
(a) $p\left(\mathbf{x}_{n} \mid z_{n}, \boldsymbol{\theta}\right)$, (b) $p\left(\mathbf{x}_{n}, z_{n} \mid \boldsymbol{\theta}\right)$, (c) $p\left(z_{n} \mid \mathbf{x}_{n}, \boldsymbol{\theta}\right)$
A leftist min heap is a tree that satisfies the following properties: P.1 Min heap: For any given node C, if P is a parent node of C, then the value of P is less than or equal to the value of C. P.2 Leftist heap: For any given node C, if L is a left child of C and R is a right child of C, then the rank of R is less tha...
E
Assume your colleague wants to wait until the next minor release to include a major bugfix instead of making a bugfix release. Explain why this is not a good idea.
The next minor release is not a good idea because it will not fix the bug. The next major release will fix the bug.
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...
1. $\operatorname{argmin}_{\boldsymbol{\alpha}} \frac{1}{2} \boldsymbol{\alpha}^{\top}\left(\mathbf{X X}^{\top}+\lambda \mathbf{I}_{N}\right) \boldsymbol{\alpha}-\boldsymbol{\alpha}^{\top} \mathbf{y}$ 2. $\operatorname{argmin}_{\mathbf{w}} \sum_{n=1}^{N}\left[1-y_{n} \mathbf{x}_{n}^{\top} \mathbf{w}\right]_{+}+\frac{\...
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?
The concatenative morphology is a type of morphological structure in which morphemes are added to a word by joining them together. This type of morphology is characterized by the fact that the morphemes are added to the end of the word, and the resulting word is the concatenation of the morphemes. For example, in the w...
README.md exists but content is empty.
Downloads last month
12