instruction stringlengths 35 29.1k |
|---|
i want to prove the reduction from $\#permanent _{-1,0,1}$ to $\#permanent _{0,1,2,3,\dots,n}$ and from $\#permanent _{0,1,2,3,\dots,n}$ to $\#permanent _{0,1}$ ( to prove that $\#permanent _{0,1}$ is$\#pcomplete$) but i dont see how to do that
?The permanent of a matrix $A=\{A_{i,j}\}$ is defined as
\begin{equation*}... |
I'm asked to categorize the language $L=${$a^nb^m : n\neq 7m, \ n,m\in \mathbb{N}$}, therefor I need to distinguish if it's regular, context free, or non context free (in $P$)
We know CFLs are closed under union, and I belive $L_1=${$a^nb^m : n<7m$} can be represented by the CFG $S\rightarrow Ab | aAb | aaAb | ... |aa... |
What's the state of the art for a durable, distributed worker queue on top of a consistent, transactional database (such as SQL)? More concretely, the problem I'm trying to investigate is the following:
worker picks queue item
worker starts processing
worker dies (eg machine reboot)
How can a eg: worker supervisor pr... |
The problem goes as follows:
Given a graph G with a set of Vertices V, each having some capacity u, and edges between them E (not fully-connected) associated with some cost c (cost to send a unit of traffic across), some nodes want to send data of some size D to someo ther node (which they may not be connected to) with... |
As part of programming a game, I'm trying to generate all the paths through an NxN matrix that touch every cell once without revisiting any, starting from (0,0). Considering the matrix as a graph, each such path in a 4x4 matrix would then contain 16 vertices and 15 edges. Each step of the path can only move 1 matrix ce... |
I am aware of bubble sort correctness proof. But what is wrong with following argument while using induction.
Proof: Assume correctness of array size $1$ and $n$ (base and hypothesis). Then for induction step: remove one element out of $n+1$ elements array, which makes array with $n$ elements. According to hypothesis a... |
I'm trying to decide whether $L_c=${$w=uxu, | \ u,x\in \Sigma ^* \ and \ |u|=c $} for some constant $c\in \mathbb{N}$ is context free or not.
initialliy, I've thought about choosing $x=\epsilon$ which will lead to $w=uu, \ u\in \Sigma ^* $ but I've been told that since $c$ is a constant, it wont be the same language ... |
In the classic 0-1 knapsack problem, I am using the following (dynamic programming) algorithm to construct a "dp table":
def knapsack(weights, values, capacity, n):
n = len(weights)
weights = np.concatenate(([0], weights)) # Prepend a zero
values = np.concatenate(([0], values)) # Prepend a zero
... |
You are given a binary pattern p. Problem is to construct a binary sequence of length n such that by sliding p over our sequence there is always at least one position where two 1s align (one in the pattern and other in our sequence).
The goal is to minimize the number of ones in the sequence.
For example let p = 101,th... |
How can we prove that for $\\\\$ every $\\\\$ 2-connected graph G with an odd number of vertices, the unsatisfiable Tseitin formula for it is minimally unsatisfiable, that is, if we remove even a single clause, it becomes satisfiable?
|
The cut and cycle properties of the minimum spanning tree are well-known. It is easy to use similar arguments to prove them. But I wonder if one property be derived from the other.
Cut property: Suppose edges X are part of an MST of G=(V, E). Pick any subset of nodes S for which X does not cross between S and V-S, and... |
Let $[0,100]$ denote the interval of real numbers between $0$ and $100$. Given a function $f:[0,100]^n \rightarrow \mathbb{R}^+$, I want to implement the following simple algorithm to search for the point in $[0,100]^n$ maximizing $f$:
1.- Observe the value of $f$ at $k$ random points chosen uniformly in $[0,100]^n$. L... |
I'm trying to understand the proof of undecidability of the halting problem. Some resources give a short proof based on a proof by contradiction. There is no mention of diagonalization. But some others also mention diagonalization in the proof. I'm rather confused about the role of diagonalization in this proof. Is it ... |
I have implemented an N-dimensional Non-Uniform Discrete Fourier Transform (in this case it's specifically an inverse NUDFT) using PyTorch. My goal with this implementation is to have a function which is given an N-dimensional array of values and a list of non-grid-aligned, non-uniform points to interpolate its value a... |
I have found out how to find the maximum of a "bitonic" array. The problem is as follows.
An array is bitonic if it is comprised of an increasing or decreasing sequence of integers followed immediately by a decreasing or increasing (respectively) sequence of integers. Write a program that, given a bitonic array of n di... |
Give a positive $m$ by $n$ matrix as input, choose a set of elements such that for any 2 by 2 submatrices, at most 2 elements are chosen. Return the maximum sum of chosen elements among all possible choice.
For instance, for input [[1,3,4,3],[2,5,6,7]], the answer is 2 + 5 + 6 + 7 = 20.
I feel like this is a DP algorit... |
The language is :
$3COLORHC = \{<G> | \text{ G is an undirected 3-colorable graph that contains Hamiltonian cycle} \}$
I was asked to show that this language is NP-Complete.
Showing that the language is in NP is easy, but I got stuck showing a reduction from an NP-Complete language.
I tried reducing from UHAMPATH probl... |
I was studying about Moore and Mealy machines but having hard time connecting with them because 1) they are different from typical normal machines.what is the need of "output" and 2) My text book doesn't cover it (Michael Sipser). What are the application for Moore and Mealy machines? I would like some resources.
|
Consider a nondeterministic TM $M$ that takes as input another TM $M'$, a string $x$ and integer $k$. $M$ decides if there exists a string y s.t. $|y| \leq |x|^2$ and $M'(x, y)$ accepts in $k$ steps. Show that $M$ runs in exponential time.
I don't see why it is exponential time. $M$ guesses $y$ with length $|x|^2$, the... |
Consider the parity function $MOD_2(x) = x_1 \oplus \cdots \oplus x_n$ for $x \in \mathbb{F}_2^n$. I am concerned about the degree bounds for a real polynomial $f$ which approximates $MOD_2$ well in the L1-norm i.e. $\frac{1}{2^n}\sum_{x \in \mathbb{F}_2^n} |f(x)-MOD_2(x)|$ is as low as possible.
I am aware of the fact... |
So, this is a snippet of a C code:
for (i = 0; i < 20; i++) {
a[i] = rand() & 0xFF;
printf("a[%d]: %d\n", i, a[i]);
}
Now, imagine "i" is a local variable stored in the stack. How many times would "i" be called from the stack for each iteration? Is it:
A. Once at the beginning of the loop
or
B. Three times:... |
The provided recurrence relation is as follows:
$$ T(n) = 8T\left(\frac{n - \sqrt{n}}{4}\right) + n^2 $$
The goal is to express the solution in terms of the asymptotic notation $\Theta$. Unfortunately, the Master's Theorem and Akra-Bazzi methods do not apply directly to this recurrence. Drawing a recursion tree would b... |
I'm attempting to solve the recurrence relation:
$$ T(n) = 4T\left(\frac{n}{2}\right) + \frac{n}{\lg n} $$
in terms of its asymptotic behavior ($\Theta$), specifically using the first case of the Master's Theorem. We know that if $O(n^{2-\epsilon}) = \frac{n}{\lg n}$ is correct, then $T(n) = \Theta(n^2)$. However, is t... |
Given an unsorted array $A$ that contains $n$ elements of numbers. Also $A$ partitioned to $k$ lists $A_1,A_2,A_3,\dots,A_k$, each contains at most nearly $\frac{n}{k}$ elements. We choose exactly one elements from each $A_i$ so that difference between maximum and minimum element minimized. Can this be done in $O(n\log... |
Note: I have read a similar post, but my problem seems different from that. Read my attempts to understand the problem for why I believe they are different.
My problem:
I know that (see this and this)
A subtype of another type should give stronger or the same specifications of the supertype.
Spec $A$ is stronger than... |
Given an undirected graph $G$ and two vertices $s$ and $t$, i want to find a minimum set of edges $E$ in $G$ such that every (simple) $s$-$t$-path contains at least 2 edges from $E$.
Is this problem solvable in polynomial time? What if the paths should not contain 2, but $r$ edges in $E$?
I know that for $r=1$, this is... |
I work in the fields of theoretical CS, formal verification, and symbolic AI. Here's my DBLP link to have a picture of my background: DBLP
Can you suggest me resources (good graduate-level textbooks) to learn modern machine learning in a principled way sufficient to get up and running to understand current research on ... |
The info I am given : block_ID, block_width, block_height as well as how the cuts between the rectangles are(horizontal or vertical); for example two rectangles can be joined by a horizontal cut or a vertical cut. See above picture for greater clarity(H symbolizes horizontal cut and likewise V for vertical cuts). Th... |
Given a SAT instance such that:
Each clause is of length at most 4.
Negative literal occurs only in clauses of length=2.
Each length 2 clause has at most 1 negative literal.
Is this version of SAT NP-Complete?
|
Let $\Sigma$ be the set {a,b} of letters. For a language $L\subset\Sigma^{*}$ over $\Sigma$, we define $\Gamma(L)$ as follows; $\Gamma(L)=\{v\in\Sigma^{*}|\exists w\in \Sigma^{*}.(|v|=|w|\wedge vw\in L)\}$. Here, $|x|$ denotes the length of the string $x$.
Then, for every context-free language $L\subset \Sigma^{*}$, $\... |
I have the following ternary constraint that needs to be converted into a set of binary constraints in order to be used for a constraints solving problem:
A = max(b,c)+1
How can I do this?
I am allowed to introduce a new variable X to do this.
|
$ L = \{ <G,k> |\ G \ has \ a \ simple \ cycle
\ at \ length \ k \} $
I think this language is in NP but my friend thinks this language is in P.
NP proof:
if a graph has a simple cycle of a specific length can be verified quickly if we are given the cycle as a certificate.We can check in polynomial time that the give... |
So, we are given a 100 long array, with 97 0s and 3 1s of which we do not know the locations. We must find them using only a compare function, which I managed to write (in Python):
def compare(i, j):
comparisons.append((i, j))
if data[i] == data[j]:
return 0
else:
return 1 if data[i] > data... |
I am currently writing an LL(1) parser. At several places (Engineering a Compiler book, Dragon book, or this discussion), I have seen two ways to go about this, either with a table driven parser (using FIRST, FOLLOW sets) which is basically a large 2D array that predicts which rule should be called or the recursive des... |
Given a knowledge base and a proposition alpha we can check if our knowledge base entails alpha using a model checking algorithm that functions as such : we generate a set of all the possible models ,and if for each model where our knowledge base is true alpha is also true we can conclude that our knowledge base entail... |
Say that a PDA is $\varepsilon$-free if it contains no $\varepsilon$ transitions (that is to say, $\varepsilon$ is not in the recognized string symbols even if it still is a stack symbol), but it may instead push any finite number of symbols to the stack during a single transition. Does every PDA have an equivalent $\... |
The question asks to write down a regular expression $r$ indicating the language of all the words above $\Sigma = \{a, b\}$ , in which the number of $a$ is even and there is no sub-word $aab$ in them.
I am aware of the fact that there is an algorithm that converts a finite automaton into a regular expression.
I want to... |
I know that exponential time complexity is $ O(k^n) $, where $k$ is some constant and $n$ is the input size, and that subexponential time is anything slower than that, $o(k^n)$ . If we define superexponential time complexity as anything faster than exponential time, $\omega(k^n)$, and given $O(n^{f(n)})$, where $f(n)$ ... |
In my script I have the following term:
x => y => both (x) (y)
This is reduced to
both
My interpretation is that this function (the whole term) takes two arguments and returns a function and two variables, but these aren't used by the function thus we can remove them? Is this interpretation correct?
|
I am reading this Wikipedia article:
https://en.wikipedia.org/wiki/Memory_segmentation
And I am in this paragraph:
Segmentation with paging
Instead of a memory location, the segment information includes the
address of a page table for the segment. When a program references a
memory location the offset is translated to... |
I'm reading about the Atlas operating system and I came across this:
The Atlas system used a British computer with 48-bit words. Addresses were 24 bits but were encoded in decimal, which allowed 1 million words to be addressed.
Why is it 1 million here if it's encoded in decimal?
|
In a directed graph, if you find scc (strongly connected components), then for each negative edge, if its 2 vertices are in the same scc and that scc has size > 1, then there is a negative cycle with that edge, and is easy to find it with a simple dfs.
Is this approach correct?
|
I'm currently implementing a RISC prozessor in a HDL and realized that I seem to have a somewhat incorrect understanding of how pipeling works for control signals. Here's my general understanding:
Ideally, each phase should take exactly one clock cycle (this is the case in my implementation)
The pipeline registers hol... |
I mean why value of 0 value in binary is not used by ascii encoding , it would have been used to represent char 0 or anything else why they used it to represent NULL
|
How we can prove that $2n−1$ comparisons are sometimes necessary to correctly merge two sorted sequences of $n$ elements each into one sorted sequence? I tried to prove it with binary decision tree, but it was not working.
|
How we can prove that the largest element in a min-heap using a comparison-based algorithm takes Ω(logn) time?
Is this useful that worst running time for comparison based sorting is >= longest path from root to leaf = height of the tree >= log(n!) = Ω(logn)?
|
Suppose I have a decision problem $\mathcal{L}\subseteq\Sigma^*$ and a verifier $V$ that recognizes $\mathcal{L}$, i.e. $L(V)=\mathcal{L}$. Let's arbitrarily choose some certificate $c(w)$ for $w \in \mathcal{L}$ such that $V$ accepts $(w,c)$. Let's consider the functions that bound the size of the certificate $|c(w)|$... |
Problem Statement
My wife's business runs a summer camp for 68 students. The students are divided
into cabins:
27 students in 3 groups of 7 and one group of 6 belong in one set of 4 cabins;
41 students in 5 groups of 7 and one group of 6 belong in the other set of 6
cabins.
Which set of cabins a student belongs in is ... |
Let $G=(V, E)$ be a directed network with a set $V$ of vertices and a set $E$ of edges. Two vertices are distinguished, $s,t$ which are the source and sink respectively. Each edge $(i, j)$ has an associated cost $c_{ij} \in \mathbb{Z}$ and a capacity $u_{ij} \in \mathbb{N}$. The objective is to achieve a flow of value ... |
Let's say we are given some CFG, maybe in SSA-form, and we want to "collapse" each top-level loop into s single node, whose successors would be all exit blocks of the original loop. So we get an acyclic CFG with loops replaced by nodes.
I tried finding such a construction in the literature but without success.
Are ther... |
Since SAT is np-complete, there is a polynomial algorithm to check if a given solution for any particular formula is correct. Just substitute the values and solve. But what if one claims that the given formula is unsatisfiable, is there a polynomial way to check if the claim is true... Am i missing something ?
|
I don't understand how to solve this problem. I understand the concept of bottleneck links but I can't seem to solve this specific question type.
For Question 3, I know the answer is 31 and that is achieved by adding the connections from A - B and the connections from C - D. I have absolutely no idea why that is needed... |
I'm working on understanding the backpropagation process in convolutional neural networks (CNNs) and am having some trouble comprehending how to calculate the partial derivatives of the output of a CNN layer with respect to both the input (x) and the filter weights (W). Specifically, I'm looking at a simple 1D convolut... |
I read almost everything I can find for count min sketch. Also look at most of the videos in Youtube, but did not found answer of a simple question -
What is the proper way to calculate dimensions of count min sketch
In both ChatGPT and Bing AI, if you ask how big a count min sketch needs to be in order to be able to "... |
This question appeared in my data structures examination :
You are given that GDCBFAHEJ is an in-order traversal and GCDBHJAEF is a post-order traversal. Either build the unique tree for which these are traversals or argue that they are traversals of different trees.
Why are we unable to build a unique tree, despite o... |
Let $DECIDE=${$<M> :\ M\ halts\ on \ all \ inputs$} and I wish to show its unrecognizable using a reduction from $ALL=${$<M> :L(M)=\Sigma ^* $}
using a deterministic turing machine $R$ which runs in polynomial time:
$<M>\in ALL \rightarrow _R R(<M>)=M'\in DECIDE$
R(<M>):
M'(x):
run M on x, if M accepts, halt o... |
I have been trying to find a multitape Turing Machine in order to accept a input string which consists on 0's and whose length is a power of 2:
However, Im getting troubble finding it, because I dont really know how to take the procedure with, for example, 2 tapes. I have found one solution for singletape, which is:
... |
I am currently taking a course on algorithms, and when reading about the 0/1 Knapsack Problem on Wikipedia I came across a technique which uses dynamic programming and supposedly runs in $O(nW)$ time, which makes sense to me after studying the algorithm. But to my understanding, the 0/1 Knapsack Problem is NP-complete,... |
I have a Windows 10 desktop (6 years old - Dell Optiplex) and a new Windows 11 laptop (maybe last years model - Lenovo Thinkpad P16 Gen2).
I am running scripts in R to compare their compute times. The new machine is roughly twice as fast on average, but a significant portion of that time is occurring outside of user+sy... |
Most of the sources about count min sketch say it usage is to give counts for several "items" stored "inside".
However in the following this question
What is the proper way to calculate dimensions of count min sketch
I made valid point if count min sketch is very saturated, it will always return wrong overestimated cou... |
I am trying to understand how to approach the question below which is a coursework question. I understand that each memory request is 32 bits and so there will be 262144 requests. There are 42 blocks in the cache. I am not sure how to think about this in terms of cache hits and misses. Is this question even well define... |
Do we know anything about the hardness of the optimization version of the multiway number partitioning problem when the set of numbers to partition consists of the reciprocals of the first $n$ integers? That is, for $n, k\in \mathbb{N}$, find sets $S_1,\dots,S_k$ such that
$\bigcup_{i=1}^k S_i = \{1, \frac{1}{2}, \fra... |
In Catan you can calculate the longest road by finding the longest (most roads) path which does not repeat any edges/roads, and does not cross through a vertex controlled by another player.
I started doing an algorithm that:
sorts the roads into connected networks (note there is only one of these above)
for each road... |
I've been looking online for quite some time for some 'general' rules on this.
for example, there's a 'rule' that claims that if a language is like $$L={w\in {a,b,c}^* : count_\alpha (w) =count_\beta (w) \pm count_\gamma (w) }$$ where $\alpha , \beta , \gamma $ could take on the form of one of the characters in $\Sigma... |
I can't find space complexity of this problem with search engines.
I think I have NL algorithm for it (just a basic "one by one non-deterministically accept values if possible"), but I wonder what other research was done on it.
Any references and/or ideas?
|
This question is from CLRS (3rd Edition).
So, I know that this is true, but I can't seem to prove it.
My approach was the following:
Let $f(n) = o(g(n)) \Rightarrow 0 \le f(n) < c_2g(n)$ for some $c_2 > 0$ and for all $n \ge n_1 \ge 0$
Similarly, $f(n) = \omega(g(n)) \Rightarrow 0 \le c_1g(n) < f(n)$ for some $c_1 > ... |
The problem:
Given two boolean formulas in 2-CNF, decide if they are equivalent.
I know that the problem is $\mathsf{coNP}$-hard when at least one formula is in 3-CNF. However, the same proof of $\mathsf{coNP}$-hardness does not apply when both formulas are in 2-CNF.
Conversely, I don't see a straightforward way to s... |
I am a mathematician that is going to switch subjects to theoretical computer science. From maths I am used to reading papers and books very slowly (almost as slow as possible) and I usually expect to need an hour per page, so reading a book of 500pages is almost impossible (and I never did). But now I am reading a boo... |
Given a set of points $S$ which is a subset of a vector space $V$ I want to want the smallest subspace of $A$ of $V$ such that $|A \cap S| \geq k $.
I suspect some variant of this problem would have already been studied but I have not been able to find it. Have anyone seen this or something similar before?
|
any (heuristic) algorithm for non-metric symmetric TSP that works on a complete weighted undirected graph with 100-1000 vertices?
|
i'm designing a CPU from scratch so i want it to be small. i decided to go with 4 bits registers. but 16 words of memory is a bit too small and i want more so i guess i need wider address bus (ie. 6). that raises a few questions:
how should i set address to memory address register?
using multiple data registers at th... |
The picture below shows how to reduce the Boolean Satisfiability problem in CNF to the circulation problem in undirected graph (see here).
As you can see, a[i] are the variables and C[j] are the clauses of a formula in the conjunctive normal form. If there is an edge between a variable (or negated variable) and a claus... |
I'm creating a plagiarism detection algorithm in Python, which scores how much of document A has been plagiarised in document B, and returns all the copied sections in B that were plagiarised from A.
Here's my working version:
from textdistance import LCSStr
DEFAULT_MIN_SUBSTRING_LEN = 30
def get_doc_lcs_matches(
... |
Is a reference type (agnostic of PL) the object being pointed at, or the object doing the pointing?
I'm having a hard time wrapping my head around the concept fundamentally (of course, I have backgrounds in pointers, C, C++, Java, Prolog, Ocaml, etc. and am familiar with the implementations in all of them).
I mean fund... |
When given one grammar, we can formally prove that it can recognize one language using QA_1
Since Kleene's Theorem gives the equivalence between the regular grammar and the NFA, we can also use QA_1 to prove that one NFA can recognize one language by transfroming the NFA to the grammar firstly.
Then how to prove that o... |
As title says, what I am trying to do is to find a way to sum integers and later compare them with another integer W, in a manner that when the sum of integers is less or equal than W, using only CNF.
My best approach to the sum was to convert every integer in its binary form and use a XOR to perform the addition. Howe... |
I'm studying asymotic analysis and i encounter this problem:
Given a recurance relation: $$T(n)= aT(n/b)+cn^a (n>0;a>=1;b>=1)$$
prove that
if $a>a^b$ then Tn=$\mathfrak\theta(n^{log_b(a)})$
if $a=a^b$ then Tn=$\mathfrak\theta(n^alog(n))$
if $a<a^b$ then Tn=$\mathfrak\theta(n^a)$
This problem scream master theorem to me... |
I'm trying to write a grammar for w being a nonempty word and z any word. That is, these are words that start with a nonempty word and end with its reverse. I've seen a very similar grammar before but it uses the alphabet {a,b}* rather than just {a,b}. Could anyone help me come up with this grammar or give me some advi... |
I've been trying to get a deeper understanding of how dynamic programming works and came across how it can be represented as directed acyclic graphs (DAGs). It's easy to see why, nodes represent the subproblems and directed edges represent which problem the subproblems help solve. Similar to a recursion tree but with r... |
I attempted this question and I do not understand why the last option is necessary in order to get the right answer.
My logic/thought-process:
In this question, only two scenarios can occur:
Scenario 1: Data was sent from the receiver but was corrupted. The Data is sent again and it is not corrupt this time.
For Scenar... |
One of my undergraduate math professors used to say "we'll always be drawing a picture, even when it is impossible", and I came to strongly sympathize with his witty point. Some recursion theory proof techniques are rather easy to visualize: diagonalization argument is easily pictured as filling out a table, and subse... |
I have asked one similar question QA_1 "The formal proof that one Turing Machine recognizes one specific language" and the answer fills the part "It does not generate any string that is not in $L$." of this QA_2 answer.
For one general function, the Halting Problem tells us it is impossible to "prove that the machine ... |
I want to construct a regular expression for strings over the alphabet {a, b, c} that don’t contain the contiguous substring "baa". I tried to follow the same procedure as in all the words that don't have both substring bba and abb, where the goal was to find a regular expression that matches all words that do not cont... |
In Theory of Computation lessons, the limits of computation are usually analyzed within the framework of Turing machines, so if something isn't solvable with Turing Machine, then we consider this problem as undecidable.
I know computational models like Lambda Calculus are equivalent due to Turing-completeness, but why ... |
I'm trying to prove a statement "given a graph G=(V,T) and that no cycle C exists that contains only edge "e" and other edges that their weight is smaller than that of "e", prove that "e" must be in some mst".
I tried to proof by contradiction, but I'm not sure what I can say about "e" when it never belongs to any mst.... |
Let $G=(V,E)$ be an undirected connected graph with a set of vertices $|V|$ and a set of edges $|E|$. A set cover $D$ satisfies $D \subseteq V$ and $uv \in E \implies u \in D \lor v \in D$. A variant of the vertex cover requires that exactly one vertex, $u$ or $v$, not both, is in $D$. In this sense, no vertices in $D$... |
I'm trying to prove that the algorithm for subset sum, that is the algorithm that given a set of numbers $\\{x_1, \dots, x_n\\}$ and a number $K$ find if there is a subset $\\{x_{1_k}, \dots, x_{n_k}\\}$ that adds up to $K$.
Now one of the typical backtracking algorithm is of the form (I know there are better ways of w... |
Consider the related problems of, given a strongly normalizing lambda term, computing the longest and shortest paths ending in a normal form.
In terms of bits of input the optimal complexity is some uncomputable function (since the input can be a Busy Beaver etc.). But the complexity of brute force is still quite large... |
In the context of linear integer programming, we have a branch and bound algorithm described here. This involves solving the non-integer constrained linear program and successively introducing additional constraints, thus getting a bunch of integer solutions. Then picking the best among those.
And then there is also a ... |
I ran into this exercise that says:
With a given binomial heap with n elements and n is divisible by 8, split the heap into 2 binomial heaps, one with 3n/8 elements and the other with 5n/8 elements.
I tried using another heap as a helping heap that saves the heaps I need to merge, but I didn't exactly know how to spl... |
I am quite new to Regular Expressions, and I'm trying to solve this problem:
Design a regular expression that accepts the language of all binary strings which their length is odd with no occurrences of 11.
At first, this is what I have:
(0(00) * 1 + 1(00) * 0) * (0 + 1)
However, I am told that this is wrong. A quick ... |
I am only familiar with binary implementations of information, though I am aware other implementations (ternary etc.) exist. I was wondering, if a code over $\mathbb{F}_q^n$ is used in practice, where $q\neq 2$, how is this done really? Do we use chunks of bits to encode elements of $\mathbb{F}_q$, for example $\{00, 0... |
Let $\Sigma_{1}=\{a,b\}$ and $\Sigma_{2}=\{t,f\}$.
Define the function $f_{w}:\Sigma_{1}^{*}\rightarrow\Sigma_{2}^{*}$ for every $w\in\Sigma_{1}^{*}$; $f_{w}(w')\in\Sigma_{2}^{*}$ is the word obtained from $w'\in\Sigma_{1}^{*}$ by replacing the start position of each subword that matches $w$ with $t$ and any other posi... |
Given an array of positive integers and a positive integer K, I need to find the minimum subset sum S greater than K, and the size of the smallest subset that sums to S.
I have attempted to first find the minimum subset sum greater than K with a 0-1 knapsack approach, then finding the smallest subset that sums to that ... |
I have many 3D boxes. All boxes are rectangular cuboids (they can rotate 90° so dimensions are interchangeable). The goal is to pack those boxes one into each other to minimize occupied space. There is no limit how deep boxes can be nested into each other. Single box can have multiple smaller boxes inside, and they can... |
If P = DTIME(n^c) and EXP = DTIME(2^n), and we prove that NP = EXP, then it means that NP = DTIME(2^n).
According to the time hierarchy theorem, the set of languages decided in O(f(n)) is bigger than those decided in o(f(n)). So does that not imply P != NP?
|
I need to implement a solution where I will have an image and other text variables as temperature, humidity and precipitacion. I wish to preview the inflow as output based on these inputs.
I suspect that I'd need a CNN to classify the image and combine it with the other variables (precipitacion,temperature and humidity... |
Are there languages L1 ⊆ L2 ⊆ L3 where L1 and L3 are NP-Complete languages and L2 ∈ P? Would this imply P=NP?
Thanks
|
Can you provide the transition table along with the solution for better understanding?
|
In C it's well known to use simple routine for turning integer rng into float rng. Something like that
float frand( float min, float max ) {
float scale = rand()/(float)RAND_MAX; // [0, 1.0]
return min + scale * (max - min); // [min, max]
}
So the core random number generation is happening inside integer rand(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.