instruction stringlengths 35 29.1k |
|---|
I recently got the following question in my exam.
Q1) In the banker's algorithm, if the total number of resources in the system is 20 and the maximum resource allocation for a process is 5, what is the maximum number of processes that can be running simultaneously?
Options
1
4
5
20
The answer is given as 5.
I believe... |
Is it possible for the hyperplane method for loop parallelization, to return more than one hyperplanes whose points are scheduled to be executed at the same time? In an example I studied (Shang & Fortes, 1991), I found nine hyperplanes, parallel each other and grouped in three sets, with the three hyperplanes of the fi... |
What is the complexity class of the following variant of the SSP problem:
Input: set of integers $\{x_1,\ldots,x_n\}$, integer $k$ and integer $T$.
Output: Yes, if there exists a subset $S\subseteq \{x_1,\ldots,x_n\}$ for which: $|S|= k$ and $\forall S'\subseteq \overline{S}$ it holds that: $\sum_{x_i \in S}x_i + \sum_... |
Given CNF-SAT reduce it to the following decision problem:
Given n items, m groups (and for each group a set of items) and a parameter k. The problem outputs yes/no if there exists k or less groups such that every item is at least in one of the selected groups.
How can I reduce the CNF-SAT to this problem?
I get stuck ... |
By the winning instruction I mean a string that a deterministic polynomial time Turing machine can use in order to win the opponent in a competitive game. The difference from a certificate is that the winning instruction does not have to prove its own correctness, you just trust it.
A naive winning instruction for TQBF... |
Let us consider the case where $p > 0$ exists and a string $|w| ≥ p$ can be divided into $uv^{i}xy^{i}z$ for each $i ≥ 0$.
When we say that
$|vy| > 0$ do we mean that at least one of the two must be greater than zero? or both? is it possible to demonstrate this condition with a practical example?
Similarly why $|vxy| <... |
Given an input NFA, can one construct an NFA that is universal (that is, accepts all its inputs) if and only if, the input NFA isn't universal?
I tried to use the fact that NFA-universality is PSPACE-complete, and the fact that PSPACE = coPSPACE. I am also interested in the details of a simple construction.
|
I am a soon-to-be physics graduate student with a background in theoretical and experimental cosmology. In my work, I've often found myself applying machine learning models and techniques for the purposes of performing data analysis tasks. I, as many do, find the field to be fascinating, but have little more than a sup... |
Reading through https://en.wikipedia.org/wiki/Timeline_of_operating_systems to decide where to port some library software—network|crypto|archive abstracting—I'm writing in C (C89).
DOS is definitely still in use today; and that takes us back to the 1980s.
Perhaps V6 UNIX (1975)? - One of the early BSDs?
|
I am trying to find a way to automate solving for all possible numerical values in a large multivariable system of equations. By this I mean equations such as
k(90)*g(-3)=434
and
k(47)*g(-5)=237
Essentially I want to solve for variables such as g and k in the context of one another and all the equations (the equati... |
I had the following question in an exam:
Which of the following best describes the concept of concurrency in an operating system?
Options:
The ability to execute multiple programs simultaneously.
The ability to perform multiple I/O operations concurrently.
The ability to execute multiple threads simultaneously
The abi... |
From the wikipedia of Free variables and bound variables
In computer programming, the term free variable refers to variables used in a function that are neither local variables nor parameters of that function. The term non-local variable is often a synonym in this context.
Since local variables and parameters are bou... |
foo:
addi $t0,$zero,1
addi $v0,$zero,0
outer:
beq $t0,$zero,exitout
sll $t0,$t0,0
addi $t1,$zero,0
add $t2,$zero,$a0
addi $t0,$zero,0
inner: addi $t8,$a1,-1
slt $t9,$t1,$t8
beq $t9,$zero,outer
sll $t0,$t0,0
addi $v0,$v0,1
lw $t8,0($t2)
lw $t9,4($t2)
slt $t7,$t9,$t8
beq $t7,$zero,skip
sll $t0,$t0,0
lw $t8,0($t2)
lw $t9,... |
Exercise 14.1 of Elements of Information Theory asks us to prove that there is a constant c such that
$$K(x,y)\leq K(x) +K(y)+c$$
for all binary strings $x,y$. Intuitively this seems true. Just write a program that first runs the program that $p_x$ that outputs $x$. Then the program $p_y$ that outputs $y$. Finally, out... |
I am struggling to solve the following excercise:
Design an assignment of a group of n students to m classes. Student i
should take a minimum of $l_i$, and a maximum of $u_i$ within a set C1
of classes. Class j should be attended by a minimum of $m_j$ and a
maximum of $M_j$ students in order to be activated.
Design a... |
In practice, it seems that many NP-hard problems "usually" lead to easy instances, in the sense that a commercial solver can handle them reasonably. A few past questions on this topic (see here and here) have been answered by saying they are not well-posed
Here's a shot at a asking a question which might have a non-tri... |
I'm currently preparing for a final exam in Networks and Internet Systems. I don't have a large background knowledge on the topics, so I'm attempting to use python to approach the majority of question in the exam. I had an original series of code written out but when I try to use it for this question, it runs, but give... |
I am trying to understand the background literature on regular language inference in the TTT paper ("The TTT Algorithm: A Redundancy-Free Approach to Active Automata Learning" by Isberner, Howar and Steffen). In it, they say in Related Work, "Maler and Pnueli[22] suggested adding all suffixes of the counter examples to... |
This is the pseudocode for insertion sort.
My question is this: suppose I have the array [5,2,4,6,1,3].
key = 2 and i = 1. Then A[i+1] = A[i] is A[2] = A(1) = 5. So now isn't the new array [5,5,4,6,1,3]? Where in the pseudocode does it write the 2 into the first place, i.e: A(1) = A[2]?
Edit: I think I realised my mi... |
After "speaking" with ChatGPT, I decided to test Z Order Curve.
The code interleaves 2D data, then search for range x: [2..4], y: [2..4]
Programming code using C/C++ should be as follows:
#include <cstdint>
auto interleave_bits_2d(uint8_t x, uint8_t y) {
using Result = uint16_t;
constexpr auto size = 8;
... |
I'm relatively new to computational complexity and am trying to use the time hierarchy theorem to show that $Time(n^7)$ is strictly contained in P. I understand that the time hierarchy theorem says that if the limit as n tends to infinity of $\frac{T_1(n)}{T_2(n)}=0$ then $Time(T_1(n))$ is strictly contained in $Time(T... |
Question 1: L = { 0^n 1^n | n > 0 }
My answer = S -> 0 S 1 | 10
Question 2: L = { 101^n0^2n | n > 0 }
My answer = S -> 101 S 00 | 100
Can anyone correct this if there is any issue with this CFG?
|
From the round-robin wikipedia
In the absence of time-sharing, or if the quanta were large relative to the sizes of the jobs, a process that produced large jobs would be favored over other processes.
Isn't that obvious? I mean if burst time of $P_1 > P_2$, then $P_1$ will remain in the running $\Longleftrightarrow$ r... |
I had an exam question which says how many segments the user accessible part of the 8086 memory contains?
I have count it using this:
Since from $00000$ to $0007F$ and $FFFE0$ to $FFFFF$ are made for a reserved and dedicated parts of the memmory we will take it out from the actual size of the memory which is $1MB$.
For... |
I have designed a C++ program to recognize the digits on an ID card based on OpenCV. First I preprocess the ID card image and then segment it based on contours. The segmentation results are as expected. Then I use the matchTemplate function with templates stored in the template path. However the recognition is inaccura... |
I am working on parts of my master-thesis and got to a problem which I would like to solve and develop some algorithm for. Basically I am dealing with 2d-geometry which I would like to represent using a 2d grid.
Task
My grid represents a density of my structure which should eventually converge to my final result. My no... |
How do i show that Double Dominanting Set is NP-Complete by reducing Dominating Set to it i have thought by adding a edge but my solution is not correct
Input is an undirected graph and a target. The question is whether it is possible to find a subset with a maximum
vertices that doubly dominate all vertices in the gra... |
I'm curious about the viability of creating memory isolated processes on a processor without an MMU.
While it would be inefficient I'm wondering if it's possible to basically create a virtual machine with an MMU and process each instruction on the emulator. In essence the VM would keep track of the current processes me... |
In the context of Shared Memory Multiprocessor (SMP) systems with different cache levels, if a cache miss occurs in the first private cache but is followed by a hit in the second shared cache, would this situation lead to a penalty or delay in data retrieval?
So far all question's I've solved involve a data or instruct... |
Context:
I was reading a tutorial on polyhedral optimization. But got confused while trying to translate the iteration domain (i.e. loop bound) to set builder notation.
Problem Description:
A code snippet from the article;
for (int i = 0; i <= 2*N; ++i)
S: Z[i] = 0.;
The iteration domain for the statement 'S' is d... |
Precedence graph of 6 processes and each number of resources they need to be fully executed is as follows:
Process
Resource A
Resource B
P1
4
2
P2
2
3
P3
3
2
P4
4
1
P5
3
2
P6
2
1
What is the least amount of each resource which prevents deadlocks?
The worst case scenario for resource A is when P4,... |
Let $\mathbb{F}=\mathbb{Z}/p\mathbb{Z}$ a cyclic field. Where $p$ is fixed
Let $(H)_{n\in\mathbb{N}} \in \mathbb{Z}[x_1,\dots]^{\mathbb{N}}$ a family of polynomials with $H_n\in \mathbb{Z}[x_1,\dots,x_n]$
Let $\varphi : \mathbb{Z}\rightarrow \mathbb{F}$ the ring isomorphism defined by $\varphi(x)=x\bmod p$
Let $f$ a p... |
I'm working on a problem where I need to find specific order statistics in a set of numbers. Given n numbers, I want to determine the k-th smallest, the 2k-th smallest, and so on, up to the ⌊n/k⌋-th smallest element. I'm looking for a method to accomplish this with a time complexity of O(n log(n/k)).
My Attempt:
So far... |
A question I am to answer wants me to find the big O of a recurrence, I am doing it with the iteration method. For the base case, which we get after applying the recurrence $i$ times, can we make this any number as long as we assume it will be in constant time? Such as $T(5)$, $T(100)$ etc. I can't give anymore info to... |
A CNF formula is Horn-renamable if you can invert variables in such a way that each clause has at most one positive literal. There is an algorithm based on a reduction to 2-SAT given in Renaming a Set of Clauses as a Horn Set.
It seems, however, that by applying the standard reduction from CNF to 3-CNF, one could achie... |
In most descriptions of monte-carlo tree search, I see the simulation step described as:
Play out a game from the leaf node until a terminal node is reached and get the result.
And the backpropagation step is described as:
Use the result of the simulation to update information in
the nodes on the path from the leaf ... |
Under mod 2 arithmetic ($\mathbb{Z}$={0,1}), given a set $V$ of $n$x$1$ linearly independent vectors $\{x_1,...,x_n\}$ I'd like to find a $n^2$ binary matrix $M$ such that $Mv=v$ where $v \in V$ and $M\bar{v}\neq \bar{v}$ for $\bar{v}\not \in V$.
I supposed it would also be helpful to know the technical term for a mat... |
I know an unlabeled unrooted tree normalization algorithm that uses parentheses:
label each vertex with ()
while there are more than two leaves repeat:
remove each leaf placing its label within the ( and ) of the parent so that within the ( ) of the parent, the strings representing the children are sorted;
if there... |
I'm not sure if I'm posting in the correct section, but I wanted to learn about CDVs, how the weightings work, and the computation.
I'm reviewing how a system is configured and looking to add a new range of numbers, but it fails validation, someone mentioned that it's probably linked to the weightings.
The CDV is using... |
Given an $n \times n$ matrix of integers, I would like to find the optimal dividing line that maximizes the sum of the integers on the same side as the top left corner. The dividing line should be connected and made up of only vertical and horizontal parts. For example:
The complication is that the number of horizon... |
Say I have N points sampled on a surface in 3 dimensions (ie. points on the surface of a sphere, 1-torus etc.). Is there an algorithm that would be able to count the number of holes in the surface formed by those point (ie. zero holes for the sphere, 1 hole for the 1-torus etc)?
Edit:
As a constraint, the points that m... |
Could someone explain to me, through an example, how the McNaughton–Yamada–Thompson algorithm works in a way that I can understand?
Thank you in advance for your helpful response!
|
Consider an undirected graph $G = \langle V, E\rangle$, and a set $S\subseteq V$ of vertices. We say that $S$ is a dominating set, if for every vertex $v\in V$, it holds that $v\in S$, or $v$ has a neighbor in $S$. We say that $S\subseteq V$ is a disconnected dominating set if it is a dominating set and the subgraph of... |
I want to make a Galaxy schema of a Restaurant. There are 2 fact tables sales and purchases. sales are related to customer and purchases to supplier of ingredients.
Now my question is how can i make galaxy schema
and from where i can find large dataset for my dataware house project
|
I have been stuck on a task in class. I have to find a context-sensitive grammar for the language $L=\{a^{n}b^{2^{n}}|n \in \mathbb{N}\}$ and I just cannot figure it out. Any help would be very much appreciated!
|
I was watching a presentation related to the MuJoCo simulator (and other topics which were more relevant for the presentation itself) and at one moment in the presentation it is mentioned that MuJoCo has thread safety due to not having memory allocation in runtime.
Why is thread safety ensured because of this? Memory m... |
TQBF is a canonically PSPACE-complete problem. It consists of boolean formula such that all its variables are quantified. The question is whether a given TQBF instance is TRUE or FALSE.
https://en.wikipedia.org/wiki/True_quantified_Boolean_formula
My query is regarding the formula part. No source explicitly mentions th... |
I’m definitely not a computer science expert, but I find this topic extremely interesting - due to this interest, I’ve recently enrolled in a class about Turing Machine.
The lecturer assigned to us an exercise and one of the questions is: ‘Write down a program of a Turing Machine with just two states that, when given t... |
I'm currently working on a problem to come up with ideas to solve a stable flow problem but unlike the traditional stable flow problem where every node has preferences on its incoming and outgoing edges, I only care about preferences on outgoing edges. The paper "Stable Flows over Time" presents a nice simple solution ... |
In my PhD, I will work with ML models. However, I will only use ready-made models as a tool, but I want to delve deeper into Artificial Intelligence not just to use ready-made models, but to understand how it works and create my own AI.
I noticed that most of the content I found talked more about how to use ready-made ... |
Given an undirected graph $(V,E)$ with weights on edges $\in Z$ is it possible to find a negative cycle of even length (not the weight of the cycle, but the number of edges contained in the cycle) in polynomial time?
Formally:
Find a sequence of vertices $\{v_1,v_2,...,v_k,v_1\}$ such that
For every $i$, edge $(v_i,v_... |
I have a very strange (arbitrary) problem that I have been trying to wrap my head around, but have been struggling to figure out how to accomplish this. I'll use Rust but in a pseudo-code fashion, these probably won't compile.
Background
The library function takes a &[u64] (a slice/array/list of unsigned, 64-bit intege... |
I was studying the dining philosopher problem (See problem description) and its solution using semaphores, and I came across this :
**Code for the ith philosopher:**
while(1)
{
take_chopstick[i];
take_chopstick[ (i+1) % 5] ;
EATING THE NOODLE
put_chopstick[i] );
put_chopstick[ ... |
What is the smallest 3-CNF system of equations possible that enforces the boolean expression: a = b + c for boolean variables a, b, c?
'Smallest' can be defined as: (1) Number of 3 CNF clauses. (2) Number of new variables introduced in the clauses.
We are interested in both cases.
|
We have shown that any comparative sorting algorithm has the worst-case complexity of $\Omega(\log (n!)) = \Omega(n \log n)$, as it has to cover all the ways a permutation can be, and according to the pigeonhole principle, there is a case where more than or equal to half of the currently unknown permutations would be u... |
Consider the halting problem $HALT_{TM} = \{\langle M, w\rangle: M \text{ is a TM that halts on input } w\}$,
and some undecidable Language $L$ of the form $L = \{\langle M\rangle: M \text{ does a thing} \}$.
If I want to reduce the halting problem to $L$, from what I understand, I have to construct a Turing Machine $M... |
You have n types work items. Each work item must be distributed to at least m processors. There are k processors (n > k > m) available. You want to distribute work as fairly as possible.
Finally, you want to minimize the number of repeating pairs of work items across processors. I don't know how to express it well, nee... |
Context:
While exploring the fundamentals of polyhedral optimization and attempting to explore a connection from the input Static Control Part (SCoP) to the iteration domain from birds eye view, I am confused about whether I am making the correct connections or not.
Explored connection map:
Example case:
Let's see a c... |
Having a complete bipartite graph with parts $A$ and $B$, which is edge-weighted, is there a way to compute a subgraph with the maximum sum of all weights and:
Only a constant number $n$ of vertices from $A$ are used.
At most one edge points to each of the vertices in $B$.
In essence, which nodes from $A$ and which r... |
To borrow part of a description from a similar but distinct question: there exist 2^(2^N) different functions which accept N binary inputs and return a 1 bit output. For the purposes of my question I am calling these N-input-gates.
I want to know if there exists a general algorithm which can always describe an optimal ... |
I have a function $f$ such that is the sum of big O terms, such as
$$f=\left[\sum_{i=1}^x \frac{1}{i}\right] +O\left(\frac{\ln^4 x}{x}\right)+O\left(\frac{\ln^4 x-1}{x-1}\right)+O\left(\frac{\ln^4 x-2}{x-2}\right)+\ldots$$
where $x$ is a positive integer. Am I correct in that I can simply write
$$f=\left[\sum_{i=1}^x \... |
Given an undirected graph $G=(V,E)$, and a parameter $k\in \mathbb{N}$ such that $k\geq 2$, how can I show that if $|E|\geq |V|^{1+\frac{1}{k}}$, a cycle $C$ exists in $G$ such that $|C|\leq 2k$?
The only initial idea I have is that as $|E|\geq |V|^{1+\frac{1}{k}}$, I know that the maximal degree of a vertex is at leas... |
I need to show that assuming $NP \neq coNP$ then there are 2 non-trivial languages $A$ and $B$ ($A,B \neq \emptyset, \Sigma^*$) in $NP \cup coNP$ such that there's no polynomial time reduction from A to B and there's no polynomial time reduction from B to A.
I tried doing this:
Let $A$ be non-trivial language such that... |
The binary extension field, usually denoted as $\textsf{GF}(2^n)$ or $\mathbb{F}_{2^n}$, is a finite field of characteristic 2.
Are there any applications of $\textsf{GF}(2^n)$ (or more broadly, $\textsf{GF}(p^n)$), for $n>1$, in computer science?
My impression is that most applications only require a sufficiently la... |
This is the question:
1.7. Give state diagrams of NFAs with the specified number of states recognizing each
of the following languages. In all parts, the alphabet is {0,1}.
a. The language {w| w ends with 00} with three states
This is how my professor answered it:
But this is the answer I found on web:
But I thin... |
Okay, so I understand implicitly why we might write f(n) = log 3n = O(log n) but I don't really understand why lets say f(n) = log 3n^2 = O(log n). Then what am I suppose to do with f(n) = log n! does this also just equal O(log n)?
Or do I need to write it out explicitly like with f(n) = 2^(2n^3 + log_2 n) = O (2^(2n^3... |
I have the following two resuts taken from the book "The Classical Decision Problem".
How does Corollary 6.3.28 follow? How can I derive PSPACE-hardness from non-membership in $NSPACE(cn / \log(n))$?
|
I need to prove if the following Language is or is not semi-decidable.
A := {w ∈ {0,1}^* | there exists an input x on which M_w produces the output 0}
Where A is the language of all the encoding w ∈ {0,1}^* of all Turing machines which at least halts on at least one input x (might also accept it) and produce the output... |
I need to use logic gates to calculate the floor of binary logarithm of a binary number $x_{n-1}, ..., x_0$.
I know that this can be computed when I find the position of the most significant bit set to 1.
So how do I find this bit and return it's position using only binary logic gates (AND, OR, XOR, NOR, NAND, NOT)?
|
The following problem has made me ask this question:
Given a boolean formula $\varphi(X)$ decide if there exists a quantification of $\varphi(X)$ with $k$ $\forall$ quantifiers that holds true. Assume that $k$ is bounded with $\mathcal O(\log n)$.
To clarify, the order of the quantifiers is arbitrary. I.e. the result... |
I just need some clarification regarding the different terms we use in theoretical computer science, especially regarding decidability.
Decidable:
A language $L$ (a set of strings) is decidable if there exists a Turing machine $M$ that, for any input string $w$, halts on w and correctly decides whether $w$ belongs to ... |
Let $B$ and $C$ be collections of finite sets. We say that $B$ is a normal basis of $C$ if for all $c\in C$ there is a pairwise disjoint subcollection of $B$ whose union is exactly $c$.
The input of the normal set basis problem is a collection $C$ of finite sets and an integer $k\geq 1$, and we need to decide whether $... |
As far as I know, the K coloring problem is NP-complete. However, I'm a bit confused about how to determine whether a problem is weakly or strongly NP-complete.
If an NP-complete problem is decidable by a pseudo-polynomial time algorithm, it is called weakly NP-complete.
If an NP-complete problem's unary version is NP... |
What data structure would be optimal in terms of time and space for the following usecase:
Given information about rectangles in the form of- {rectangle_id,left_bottom_corner_x, left_bottom_corner_y, right_top_corner_x, right_top_corner_y}.
I need to use a structure which will answer the following queries:
1... |
When a CPU needs to get more instructions from storage and copies them to RAM, how does the CPU jump to previous instructions that are no longer in the RAM? Would it have to copy the old instructions back into RAM?
I feel like that would take a very long time to do.
FOR EXAMPLE: this is storage xsxx xxax.
Pretend the "... |
I'm new to recurrence relations and master theorem so trying to learn. Say there's an algorithm $A$ whose input is the root of a binary tree $T$. $A$ recurses so that it's called on each and every node in $T$ exactly once. The time complexity of $A$ called on a node $X$ is $O(number\:of\:nodes\:in\:subtree\: rooted\:at... |
Motivation. This is a variant of the subset sum problem involving the bitwise ${\tt XOR}$ operation.
Problem. Given a set $X$ of $n$ bit-strings of length $n$, determine if there is a non-empty subset $S\subseteq X$ such that the the bitwise ${\tt XOR}$ of the members of $S$ is $0$ everywhere.
For example, et $n = 4$ a... |
I struggle to understand a step in the following solution to a RISC-V exercise.
Exercise: a pipelined RISC-V processor with no data forwarding paths executes the following program. For each instruction and clock cycle, determine the stage of the processor involved.
Solution:
What I expected:
What I fail to grasp is... |
Here is my algorithm with inputs $a$, which is an integer and $n$, which is an odd natural. Is $\mathcal{O}(n)$ the time complexity of this algorithm?
My thoughts:
The if-cases in the lines $1$ up to $20$ and $32$ up to $37$ are checked in $\mathcal{O}(1)$.
In lines $21$ and $22$, the symbol is reduced.
My guess it t... |
The decision version of the problem Integar Linear Programming is the following:
Input: two matrices $A\in \mathcal{M}_n(\mathbb{Z})$ and $B\in \mathcal{M}_{n,1}(\mathbb{Z})$.
Question: is there a matrix $X\in \mathcal{M}_{n,1}(\mathbb{Z})$ such that $AX\leqslant B$? (the inequality being component by component).
Thi... |
As we know, if we want to make a $LR(0)$ (say) parsing table for a context free grammar (CFG), we prepare the $LR(0)$ itemsets with $.$ (dot) in RHS of the CFG production.
With this $.$ we keep track of characters that compiler has seen yet, and continue to make states of these itemsets, which ultimately make a determ... |
Given an undirected graph, two vertices $s$ and $t$, and two integers $k$,$l$ - what is the complexity of finding $\ell$ edge-disjoint $s$-$t$-paths such that at least $k$ of them are pairwise internally disjoint? Being internally disjoint means that the paths are vertex disjoint except for $s$ and $t$.
I know that dec... |
I recently had an interview to identify all of the hazards in the following instruction set. I was told by the interviewer that there was some hazard between instructions i3 and i4 and it's not a RAW hazard on R4 so I'm a little lost. Any insight? Thanks!
1: ADD R1, R2, R3
2: ADD R4, R5, R1
3: LOAD R4, R3(src addr)
4: ... |
Recently, when I self-learnt Discrete Mathematics and Its Applications 8th by Kenneth Rosen, I had some questions about some statements in it.
Fur-
thermore, if a polynomial worst-case time complexity algorithm were discovered for the traveling salesperson problem, many other difficult problems would also be solvable ... |
In the wikipedia page for the NP-intermediate complexity class, the following observation is made:
Under the assumption that P ≠ NP, Ladner explicitly constructs a problem in NPI, although this problem is artificial and otherwise uninteresting. It is an open question whether any "natural" problem has the same property... |
Assume that a matrix $M\in [0;1]^{n\times d}$ is given, i.e., all values in the matrix are in the range 0 to 1. I would like to compute the following function for all rows of $M$:
$$
f(m_1,m_2,...,m_d)=\frac{1}{n}\sum_{i=1}^{n} \begin{cases}1 \quad \text {if} \quad M[i,j] \le m_j \text{for all} j\\
0\quad \text{else}
\... |
(Given a graph $G$ with $|V|=n,|E|=m, max(c(a,b))=C$ and with integer capacities)
Dinic's algorithm with scaling is defined the following way:
set $\Delta = C$;
run Dinic's algorithm, only allowing augmenting $\geq\Delta$ at a time (at any point, if edge we're looking at in the created DAG is $<\Delta$, delete it).
if... |
I have to find 2 efficient ways to sort 1000 exams according to the students' last names and give the complexity. The task has to be divided between m teachers.
I think one efficient way is to give each teacher a range of letters, for example one teacher has to sort the exams with the last names from A to D, the other ... |
In a 2 by n grid there is a character in each cell. A path can start at any cell and then you can move to right or down. This way each path will denote a string written by characters on cells visited in visiting order. I wanna try finding efficient methods for pattern searching queries (number of paths resulting a stri... |
I'm curious about how much complexity is introduced to an algorithm while it's being debugged. Is there a general theory for optimal debugging algorithms and theoretically optimal debugging performance?
The curiosity is a consequence of the following question: If I mean debugging to be the process of making information... |
I found an algorithm for determining if a binary tree is height-balanced.
It Gets the height of left and right subtrees using dfs traversal. Return true if the difference between heights is not more than 1 and left and right subtrees are balanced, otherwise return false.
algorithm code:
/* CPP program to check if
a tre... |
I'm looking for a data structure that would allow storing samples (in O(1)) from a data stream in a fixed-size buffer while the stream length isn't known in advance.
Once the buffer size is exhausted it should start overwriting previous elements in a staggered manner, retroactively reducing the sampling rate of the dat... |
I am using the GraphBLAS C API (https://graphblas.org/) which provides an interface for performing mathematical operations on sparse matrices. Given an adjacency matrix $\mathbf{A}: \mathbb{R}^{n \times n}$, I would like to remove duplicate rows from the matrix. Instead of implementing this in the standard $\mathcal{O}... |
Suppose I want to introduce a new family of types $B(a)$, where $a:A$ into a type theory using inference rules. First of all, my understanding is that $B:A\to U$, where $U$ is some universe. So my first question is: should I necessarily introduce the universe $U$ before introducing the family $B(a)$?
And secondly, assu... |
I was wondering if a variation of the bin packing problem where the 'size' of a bin is calculated as the product of item sizes in a bin instead of their sum is NP-hard. It seems like it must be, but I don't know how to prove it.
More formally, the problem is as follows:
Given a list of positive integer item sizes $a_1,... |
At first I thought it is obvious, since the NOP instruction does not have any operand, we say it is zero-operand instruction. But then looking on the zero-operand instruction,
But looking after the definition I am confused to classify the instruction into $n$-operand category, where $n \in \{0, 1, 2, 3\}$ ref
These in... |
I have researched multiple solutions to the convex hull problem, but I am afraid I don't really understand some of them. For example, Graham's scan is a bit confusing as it is not very clear if the n given points are sorted at the start of the algorithm or not. And if they are, how and why? I guess I don't really know ... |
There is an exercise in a book about finite automata that I couldn't solve:
Prove that if $L \subseteq b^*$ isn't regular then $M = a^+L \cup b^*$ isn't regular either, using the fact that REG is closed under inverse morphism (paraphrase).
I think one obvious approach would be to find a Language $L'$ and morhpism $\var... |
What method(s) could be used to solve this? I am still new to this stuff and would appreciate detailed justification for every step as well as some intuition and the examination of all possible viable methods to go about this, not just one. Thanks.
|
Assume that we are given a formula in 3-CNF such that at least 1% of
the complete assignments satisfy it.
My question is how to find a satisfying assignment in polynomial time without the use of
randomness?
Prove the correctness and the upper bound on the running time for the algorithm that you suggest.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.