instruction stringlengths 35 29.1k |
|---|
As part of data science course I would like to solve particular problem with reinforcement learning algorithm.
I believe I understand general concept, however the problems I had read about up till now had no random factor included. I would like to ask if it's valid to assume that reinforcement learning algorithm will b... |
I learned that expressions are left associative while abstraction are right associative, however, while solving some examples i faced this problem.
Succ 3 Succ 2
when i applied left associativety i got (Succ 3) Succ) 2
which was extremely long to solve.
However, i saw this guy on the internet, he said that we should pa... |
I have an edge coloring problem as follows:
Suppose we have a DAG which has a source vertex s and an end vertex e, in addition, all the paths from s to e are of the same length say L. We define L colors from 1 to L. Is there an efficient edge coloring algorithm to color all the edges, such that every path from s to e u... |
Let us have a weighted graph $G$. We are interested in a subgraph, $H$ of $G$ where each vertex has a degree at least a natural number $b(v)$. I am interested in a subgraph where the sum of the edges of the subgraph is minimized. This problem is known as $b$-edge cover. The optimization formulation is as follows.
\begi... |
We have been given a graph $G$, we need to find a subset of nodes $S$ such that each node of the graph is in $S$ or is adjacent to a node from $S$. Additionally, the elements of the subset $S$ should not be adjacent to each other neither should they share a common neighbour node.
This is an example of the given problem... |
I am interested in implemented the deterministic ${O(n\log(\log(n)))}$ algorithm for the closest pair of points problem described here by Fortune and Hopcroft: https://ecommons.cornell.edu/bitstream/handle/1813/7460/78-340.pdf
In particular I would like to have a solution to the two-dimensional case.
They say: "The alg... |
Consider a string 'ABBAA'
Possible substrings with even number of characters are 4
'ABBA' : Count of 'A' is even and 'B' is even
'AA' : Count of 'A' is even and 'B' is even ($0$)
Similarly 'BB' and 'BBAA'.
So a total of $4$ substrings are possible.
If given string is 'AABCCBBCAA'
substrings possible are "AA" "BB" "AA" ... |
description of the algorithms behavior
I have two strings s1 and s2, with $len\_s1 <= len\_s2$. I would like to find the substring of s2, that has the biggest similarity to s1. The following alignments are possible:
[s2[:i] for i in range(len_s1)] + [s2[i:i+len_s1] for i in range(len_s2))]
e.g. for s1="ab" and s2="abc... |
I am going through problem 13-1 in CLRS 3rd edition. I came up with the following algorithm as a solution:
PERSISTENT-TREE-INSERT(T,z)
y= T.nil
x=T.root
while x != T.nil
y=x
if z.key < x.key
x = x.left
else x = x.right
if y == T.nil
T'.root = z
return T'
else if z.key = y.key
y'=copy(y)
... |
Lets define function $T(n)$ as
\begin{align*}
T(1) &= T(2) = 1\\
T(n) &= T(\lfloor\frac{n}{2}\rfloor+1)+1 \text{, where }n\ge 3.\\
\end{align*}
Does $T(n)=O(\log(n))$? I have no idea how to prove or disprove this, so I'll be glad for any help.
|
Show that a language is decidable iff some enumerator enumerates the
language in decreasing order.
I know a language is decidable iff some enumerator enumerates the language in the standard string order (increasing order), but I am not sure if this makes sense in decreasing order. I carefully think if some enumerator... |
I am reading the proof of Theorem 3.21 in Sipser's textbook.
Theorem 3.21 A language is a Turing Recognizable iff some enumerator enumerates it.
First direction (<==).
Given an Enumerator E that enumerates language B, then we want to construct a TM M s. t. M that recognize language B. In order to do that, we do the f... |
Today while I'm looking at definition of Algorithm from Sipser's textbook, he defined the following language:
$$D_1 = \{ p \mid\ p\text{ is polynomial over }x\text{ with integral roots}\}$$.
This language is decidable since we can bound the integral roots between two values and we can try all possible values between th... |
Question:
Given the RE (or NFA) for the set of all strings over $\Sigma ={a,b}$ such that: a occurs the odd number of times and each pair of a are separated by exactly $2n+2,n\geq 0$ b's.
Attempt:
Followed the way we construct the set of strings such that $a$ occurs the odd number of times, I got the following solution... |
Consider an example 2-SAT instance with the constraint (x1 ∨ x2).
This CNF has these two implications:
¬x1→x2 and ¬x2→x1.
"They actually mean, if x1 is false then x2 must be true, and if x2 is false then x1 must be true, respectively. Any other case would make the 2-sat problem unsatisfiable."
My doubt is rega... |
I want to find a comparison sorting algorithm that can almost sort a set of data, using the least comparisons possible.
What I mean by "almost" is that if the perfectly sorted data is $[x_1, x_2, …, x_n]$ and the almost sorted data is $[x_{i_1}, x_{i_2}, …, x_{i_n}]$, then $\forall j \in [\![1, n]\!], |i_j - j| \leq C$... |
I want to construct a regular grammar that generates words that contain both "ab" and "bc" as subwords with the alphabet of the terminal symbols {a,b,c}
My solution so far is
G=(Vn={S,X,Y},Vt={a,b,c},S,F={ S-> aS | bS | cS | abX | cbX, X-> aX | bX | cX | ε})
|
I recently thought of and managed to solve this algorithmic problem:
On a infinite 1-dimensional number line, we have N ranges specified by two distinct integers A and B, such that all A and B are unique. Each pair of integers then represents the starting and ending points of a range on the number line. How many distin... |
I am trying to solve the following problem to find big-theta. I am having a lot of trouble, if anyone can help!
T(n)=8T(√n)+log^2(e^n)?
The logarithm is base 2 and is squared.
|
Given that a graph G has only positive integer weights and its diameter D which is the greatest of the shortest paths among all pairs of vertices in G. For a single-source shortest path problem and design an algorithm runs in O(V+E+D) time.
As we know, in a single-source shortest path problem, we could use the Dijkst... |
Consider this loop:
for i = 1 to n
j = i
while j < n
j = j + j
end while
end for
How many times the while loop will execute? I was thinking that if we denote by $c$ number of time loop will execute then in each iteration $j$ would be equal to $2^{c-1}i < n$, then taking logarithm we get $c<log_2{n} - log_2{i} + 1... |
I have this algorithm:
I understand overall what's happening here, we're shrinking the blossoms (odd cycles) to end up with a bipartite matching problem, and then opening them again to get a maximum matching in this graph. But I don't understand it algorithmically, like what do the variable considered and label repres... |
I want to design a context-free grammar that generates words that either both start and end with $c$, or contain the same amount of $a$-s and $b$-s. Here is what I have. The nonterminals are $S,X,Y$, the terminals are $a,b,c$, the start symbol is $S$, and the productions are
\begin{align}
&S \to aYS \mid cXc \mid bXS \... |
Let $n,m$ be a positive integer with $m\ge 2n$. In the set $M=\{1,2,\dots,m\}$, some elements are black and others are white. Given $2n$ nonempty subsets of $M$, the task is to determine whether there exists a subset $T\subseteq M$ consisting of $n$ black and $n$ white elements such that each of the $2n$ subsets has a ... |
I want to calculate complexity for binary exponentiation of matrix of size $k$. Let's say that I'm using the simplest approach to multiply matrices (so with three for loops). The complexity of this operation would be $O(n^3)$. Now, the powering of matrix. Pseudo code (n is the power, A matrix):
power(n, A)
if n == 0
... |
I read a few "function >> imperative/OOP" articles because I heard there was a move in imperative OOP languages toward a functional style of coding, especially encouraging pure functions when possible. One recurring argument is that by not mutating state, you don't have to worry about race conditions and locking.
I do ... |
I would like to find out the Expected height of a binary tree where the insertions are based on a random function. I.e. for each node I visit, there is a $\frac{1}{2}$ probability of choosing right or left. I know that the following property holds for height $h$, but it's difficult to add the probability:$$h_{tree}= 1+... |
We have $n$ sets of $k$ points in $\mathbb R^d$ and we are trying to partition them to $k$ clusters of $n$ points such that from each set every point is mapped to a different cluster and the sum of variances of each cluster is minimized, i.e., we are trying to solve the $k$-means problem but with the constraint that po... |
After reading the question and answers on Time complexity of min() and max()? I would like to clear up some confusion on the relation between time complexity and size of input.
First, I've noticed most of the time people omit what exactly n represents in big O notation. Usually it's related to the input, but it may be ... |
I would like to create an algorithm that advises a student when they should work on certain assignments given the expected time each assignment will take, and the due date of each assignment.
Say that for a students' weekly schedule, there are class times and events that must be attended. With the remaining time slots ... |
Let $G(V,E)$ be a graph (not necessarily bipartite), where edge $e \in E$ has weight $w_e$ (non-negative real). Then one can write the LP relaxation for maximum weight perfect matching as follows
$$
\text{maximize}~~\sum_{e\in E} w_e x_e
\\
\text{subject to}~~\sum_{e\in E: v\in e}x_e=1\text{ for all }v\in V
\\
0\le x_{... |
I was wondering is it possible to create a simple circuit that detects if an input (a binary string) is a palindrome?
So my approach is to feed the input to a circuit that reverses the input, ie if the input is 0111010, I need the output to be 0101110. Is this possible to achieve with only, and/or/xor/not and these sim... |
How do I prove that $d(x,y)$, defined as the weight of the lowest common ancestor of $x,y$, satisfies the strong triangle inequality:
$$ d(x,y) \le \max(d(x,z), d(y,z)) $$
How do I even start such a proof?
|
Let $L$ be a regular language on an alphabet $\Sigma$. and let $L^{ab} = \{\sigma_1a\sigma_2b...\sigma_n \mid \sigma_1...\sigma_n \in L\}$ be the language obtained by add between any two letters of any word of $L$ the letters $a$ and $b$, except before the first and after the last. Prove that $L^{ab}$ is regular.
I t... |
I was going through the text Compilers: Principles, Techniques and Tools by Ullman et. al. where I came across the following excerpt.
Example 4.11. Consider the abstract language $L_1 = \text{ { $wcw$ | $w$ is in $(a|b)^*$}}$. $L_1$ consists of all words composed of a repeated string of $a$'s and $b$'s separated by a ... |
I am reading about consistent hashing for system design and I understand the application of consistent hashing and the use of virtual nodes. I want to understand how to calculate the optimum number of virtual nodes and how to place them on the unit circle.
https://youtu.be/zaRkONvyGr8?t=433
in the above video the autho... |
Are $O(n+m)$ and $O(n+2m)$ the same?
If $m>n$, then both complexities are $O(m)$. Likewise, if $n>m$, then they are $O(n)$. Is this correct?
|
A Von Neumann Architecture bottleneck is a limit on the amount of data a computer can process due to limited bandwidth between the CPU and RAM. Possible mitigations to the problem according to Wikipedia are...
Providing a cache between the CPU and the main memory
Providing separate caches or separate access paths for... |
In the context of P/poly complexity class, an advice function is mentioned.
How is the advice function different than an oracle(/certificate)?
https://en.wikipedia.org/wiki/Advice_(complexity)
https://en.wikipedia.org/wiki/P/poly
|
When working with recursion it is often useful to find the least or greatest fixed points of a morphism, often using a fixed-point combinator. When working with recursion schemes, the inverse operation — finding a morphism for which a value is a fixed point — is also very useful, in which case the operation is sometime... |
Consider the recurrence
$$T(n)=T(\tfrac{n}{a}) + T(\tfrac{n}{b})+O(n^c).$$
What is the condition on $a,b$ that guarantees $T(n)=O(n^c)$?
With substitution I get
$$T(n)=T(\tfrac{n}{a}) + T(\tfrac{n}{b})+O(n^c)\le (\tfrac{n}{a})^c + (\tfrac{n}{b})^c + n^c = n^c ((\tfrac{1}{a})^c + (\tfrac{1}{b})^c + 1)$$
I need $(\fra... |
The running time of the original non-weighted algorithm is $\mathcal{O}(M(n, n + m)\,log(n))$,
where $M(n, m)$ is the execution time for finding a min-cut in a network with $n$ nodes and $m$ edges and $log(n)$ is the number of times the while loop must be executed.
The changes he makes to the original solution are:
t... |
Given the following recurrence relation:
\begin{gather*}
h(A) =
\begin{cases}
0,\qquad \qquad \text{ }\text{ }\text{ }A=0\\
1+h(A-1),\text{ }\text{ }A\text{ is odd} \\
1+h(\frac{A}{2}),\qquad \text{otherwise}
\end{cases}
\end{gather*}
which of the following choices best describes its complexity?
A) $h(A)\in\t... |
I'm looking for an existing algorithm that would ensure that the first k elements after sorting are the top k elements but not necessarily in the right order.
To put it differently, I would like an algorithm that acts like C++ std::partial_sort but takes advantage of the fact that I don't need the first elements ordere... |
Given sorted array $A[1..n]$, we want to find an element such that,
$A[i]=i^2$,Can we use binary search to find such a element?
My Attempt:
initially, I read this link, but I can't understand the comments for why we can't find that element in $O(\log n)$. Any hint be appreciated.
|
Show that a language is decidable iff some enumerator enumerates the language in decreasing order.
What does it mean by enumerator enumerating in decreasing order? I am so confused about this concept. Can you prove the above theorem? Please help me.
|
Background
The literature on succinct data structures refers often to the “information-theoretic lower bound” of encoding data, i.e., the minimum number of bits needed to store the data – a concept related to information-theory entropy. For instance, the definition of a succinct data structure is one that takes up $Z +... |
I have two questions on Kaveh's answer to Definition of uniform boolean circuit :
Kaveh mentions that the input is in unary encoding. In the definition it says the input is $1^n$, afaik $1^n$ is a sequence of 1's repeated n times, but unary encoding is a sequence of 1's and ends with 0 there is no power of 1 that gi... |
What will be a space complexity of a conversion of a sorted array to a balanced BST in case of a recursive solution?
Could you, please, check my reasoning. Is it correct?
Here is my algorithm for solving the problem:
/**
* Definition for a binary tree node.
* public class TreeNode {
* public int val;
* publ... |
I have a regular language $L$ from characters of $\Sigma_1$, we define: $\Sigma_2=\Sigma_1\cup \{+,-\}$ and
$$L^{+-}=\left\{a_1\cdot p\cdot a_2\cdot q \cdot a_3\cdot\ldots \cdot a_k\mid a_1,a_2\ldots,a_k\in L,p\in\{+,-\},q\in \{+,-\}\setminus\{p\}\right\}$$
I want to show this is still a regular language. To do so with... |
Given that cameras, computer vision and AI are constantly evolving with greater zoom, macro, processing power... is it possible that some day cameras would be able to « scan » a room and detect COVID (or any other viruses) somewhere, such as on the door knob? In other words, could evolved cameras and AI be able to see ... |
I'm struggling with the median of medians algorithm, and I think it's perhaps more of a semantics thing rather than a technical thing. I've always thought the median of medians algorithm as finding an approximate median $p$ such that $p$ is within $20\%$ of the true median $M$ in the sorted array.
However, when I look ... |
I'm having trouble approaching this average case analysis in terms of key comparisons.
The pseudo-code is as follows:
maxSort(Array) {
for (int i = Array.length - 1; i > 0; i--) {
x = i - 1
max_i = findMaxPos(x) # performs x key comparisons
swapValues(max_i, i)
}
}
findMaxPos returns po... |
I'm trying to prove a lower bound on some computational problem, but in order to do it, I need an $\Omega(n\log(n))$ lower bound on $\log(T(n))$, where $T(n)$ is a recurrence defined as follows:
$T(1) = 1$
$T(n) = \sum_{k=1}^{n-1} T(k)T(n-k)$
Does this recurrence have a known solution? If not, just giving a lower bound... |
I am reading Software Engineering 1: Abstraction and Modelling by Dines Bjørner. One of the chapters talks a little bit about call-by-value vs call-by-name. In it, the author states that most programming languages use call-by-value, rather than call-by-name. But from what I have read in the chapter, it seems that call-... |
I want to implement Martin Löf's intuitionistic type theory in a functional language such as Haskell, preferably also implementing a lexer/parser for the language. How should I start approaching it? Are there any good papers/blog posts/github repo examples that might be useful? Thanks!
|
Tabulated hashing uses tables of random numbers to compute hash values.
Suppose $|\mathcal{U}| = 2^w \times 2^w$ and $m = 2^l$, so that the items being hashed are pairs $(x,y)$ where $x$ and $y$ are $w$-bit strings (or $2w$-bit strings broken in half), and hash values are
$l$-bit strings.
Let $A[0 \cdots 2^w-1]$ and $B... |
A seven-bit Hamming code is received as 1110101. What is the correct code? Assume the parity to be one.
The problem I am facing here is I don't know how to check parity without knowing it is even or odd.
|
Say I'm given an oracle that tells me whether or not $L(M)$, the set of words accepted by a Turing Machine $M$, is finite.
By leveraging this oracle, can I solve the halting problem? That is, on an arbitrary input $<M, x>$, can I tell if M is going to halt on $x$ or will it loop forever?
My intuition says no because I ... |
I'm trying to find a cover of a surface using disks of variable sizes.
In the image, I want to cover the entire blue surface. The disks can go "out" of the blue surface and into the red part, but they cannot go outside the red area. The red area is always an "expansion" of the blue area.
I'm trying to find a solution t... |
I don't understand two parts in this paper:
The min notion on page 4 line 357 (equation 10d): I understand this as to find all the $M_{10}$, $M_{11}$, $M_{01}$ first and then try to minimize the expression in the brackets of equation 10d. Is it correct? Or does it mean to find the min first and then use that to comput... |
I'm studying Coq's core language and I found that mutual inductive type definition is in it.
https://coq.inria.fr/refman/language/core/inductive.html#theory-of-inductive-definitions
Before I read the material, I had supposed that Coq translates mutual definitions in Gallina into nonmutual ones in its core language, sin... |
Consider the below function:
Considering that print(a) and swap(a, b) are of complexity $\theta(1)$, what is the time complexity of the above code?
The answer that comes to my mind is $\theta((n-k)!)$ or $\mathcal{O}(n!)$.
However in the book that I'm reading it says it's of order $\theta(n!)$. What am I missing here?... |
I'm stuck in trying to compute an overall entropy calculation with an agent.
Let me first introduce some background of the problem. Basically, I'm doing some work with the contextual bandit problems. Let's say I have an agent with $m$ actions to select from and in different contexts (I use states in the following), it ... |
I was going through paper titled "Algorithms for Inverse Reinforcement Learning" by Andrew Ng and Russell.
It states following basics:
MDP $M$ is a tuple $(S,A,\{P_{sa}\},\gamma,R)$, where
$S$ is a finite seto of $N$ states
$A=\{a_1,...,a_k\}$ is a set of $k$ actions
$\{P_{sa}(.)\}$ are the transition probabilities ... |
Given an array $A[1..n]$. $A$ is mixed of two sorted arrays $B$ and
$C$ of equal sizes, such that $B$ is in the ascending order and $C$ is in
the descending order.
Consider the following example: $B=[2,4,6,8]$ and $C=[9,7,5,1]$. As a
result $A=[2,9,7,4,6,5,8,1]$. Interestingly, The instructor said: $A$
can be sorted i... |
I wonder if we say L ⊂ {a, b, c}* then is L an infinite language?
I think Kleene star makes me think L is an infinite language.
|
Question: Is the regular expression and regular grammar equivalent?
I've look on some examples of regular grammar however I don't think I fully understand how to convert regular expression to its equivalent grammar. So I am also asking for some help or tips to convert regular expression to regular grammar.
*Key
() -> e... |
Find an example of a regular language where the syntactic right congruence and the syntactic congruence are not identical.
I have gone through the relevant definitions and understand them, but could not figure out an example for this case.
|
I was going through the text: Compilers: Principles, Techniques and Tools by Ullman et. al where I came across the concept of viable prefix and I faced some difficultly in grasping the concept. So I present my doubts here in a systematic manner, with a hope for clarification.
Viable Prefixes: The set of prefixes of r... |
I'll pose the question in the abstract first and then describe concretely what I'm trying to do.
Suppose I have a set of 1000 000 multiple-choice questions and 10 oracles that can answer the questions. But the oracles are imperfect and don't always answer correctly. Some oracles answer more accurately than others. We d... |
Solving $T(n) = 2T(\frac{n}{2}) + n\log(n)$ without master theorem, given $T(1) = 1$
My approach with recurrence tree:
$n \sim n\log(n)$
$\frac{n}{2} \sim 2 \frac{n}{2}\log(\frac{n}{2})$
$\frac{n}{4} \sim 4 \frac{n}{4}\log(\frac{n}{4})$
Hence the summation must follow as:
$$T(n) = \sum_{i=0}^{\log(n)} n\log(\frac{n}{2^... |
So I'm reading Introduction to computing systems:From bits and gates to C and beyond, and the author states that a CPU is the mechanism that
...directs the processing of information. Which is figuring out what task should get carried out next
My question is: what exactly does he mean when he says that a processor "fi... |
I am reading Chapter 7 Linear Programming in Algorithms by Dasgupta et al.
I don't get how they switch from an equation to an inequality specifically the part highlighted in red/pink regarding the multiplier $y_1 + y_3 ≥ 1$ instead of $y_1 + y_3 = 1$
|
How does Command Z work through computer commands? What is the step by step computer commands that complete the process?
|
This is a sample of datetime field:
1615717137369
It means 2 days ago (from 16 march, 13:24)
How can I parse the number?
P.S:
These are some examples:
16 15 89 8678037 16 March 16:15 ( 5 min ago)
16 15 89 8259356 16 March 16:08 (12 min ago)
16 15 89 791 8713 16 March 16:03 (17 min ago)
16 15 89 791 4439 16... |
Given $n$ drugs such that each drug $d_i$ should maintain in interval
$[c_i,h_i]$.We want to minimize number of containers to maintain
medicines in compatible interval.
My answer is as follows:
I use following greedy algorithm:
in each iteration, for remaining drugs, find an interval that have maximum number of compa... |
Given I have an initial capital of $10,000 and i want to buy shares in 3 different companies.
Cost of a share in company 1 = $55
Cost of a share in company 2 = $68
Cost of a share in company 3 = $79
And, The trading platform charges me $30 collectively for three purchase transactions above.
And, I want to invest 70% ... |
Given two balanced binary search trees $T_1,T_2$. We want to check,
are $T_1\subseteq T_1$ or not. $T_1$ have $n_1$ nodes, and $T_2$ have
$n_2$ nodes.
Instructor say it can be done in $O(n_1+n_2)$ time complexity with
$O(\log n_1+\log n_2)$ space.
My idea:
I use in order traverse on two trees , and compare first node... |
I need to prove that Turing decidable languages are closed under reversal. I have no idea on how I would prove this. Any suggestions or clues?
|
In my course there are a number of exercises which amount to taking a trained residual network and deleting, swapping or repeating layers (without retraining).
Is there any real application for doing this? An exercise might say to swap two specific layers and I will find that the performance will increase (on a very sm... |
This is a soft, and probably also an opinion based question.
Suppose I am writing a library in C++ for the purposes of working with financial data. My goals are:
Since I work with big data, I want to make it as fast as possible by using parallel computing principle inside the functions.
I want my colleagues to use thi... |
How I understand microcode translate an instruction to microinstructions. And CPU has a unit that stores all possible of microinstructions. These microinstructions can be changed, because it load every time after boot from motherboard. Can instruction set be changed?
I am sorry if i ask strange question, if I misunders... |
Given
a rectangle defined by its corners $(0, 0)$ and $(w,h)$,
$n$ circles $\{ (x_1, y_1), (x_2, y_2), \dots, (x_n, y_n)$ with the
same radius $r$,
I need to determine the smallest possible radius r so that there is no
way to get from $(0,0)$ to $(w, h)$ without touching those circles.
What I have tried is
Use binar... |
So, I have been given a TM where the head can access and write both the character that the head is pointing at and the next character to the right.
So if we have a TM abbb and the head is pointing at a, it can access and write into the the next character also ie the first b. So it has access to both the first and secon... |
Given a graph $G(V, E)$ and two matchings $M \subset E$ and $M' \subseteq E$ with $|M'| > |M|$, how can one prove that $M\oplus M'$ ($\oplus$ denotes the symmetric difference) must contain at least $|M'|-|M|$ augmenting paths of $M$? I know that there have to exist some $M$-augmenting paths since $M$ is not a maximum ... |
I am trying to learn FPGA programming, and I would like to analyze an audio input.
I would like to know what kind of frequencies are present in the signal but without using Fourier transform - there are two reasons for this.
First one is I dont need to know the exact frequency of the incoming signal, and the second rea... |
Given an open-address hash table with $\alpha$ < 1, the expected number of probes in a successful search is at most $\frac{1}{\alpha}\ln\frac{1}{1-\alpha}$
I read this in a book and the proof starts by saying
Searching for k follows the same probe sequence as inserting it. If $k$ is the $i+1$th key inserted into the... |
When I implemented the paper Dynamic Fusion published in 2015 CVPR, I came into the trouble with how to solve the energy function:
$$E(W_t, V, D_t, \mathcal{E}) = \text{Data}(W_t, V, D_t) + λ\text{Reg}(W_t, \mathcal{E})$$
Where:
Wt is a set of 4x4 transformation matrix at time t;
V is a set of 3D vertices from canonic... |
Given the following method written in Java:
private void collatz(List<Integer> values) {
int size = values.size();
if (size == 0 ||
values.get(size=1) <= 1) {
return;
} else {
int last = values.get(size = 1);
if (last%2 == 0) {
values.add(last/2);
... |
Here is an exercise from an introduction to computation class:
Show that the following context-free grammar $G$ generates the language $L$ of words over $\{0,1\}$ with an equal number of $0$s and $1$s:
$$
S \to \epsilon \mid SS \mid 0S1 \mid 1S0
$$
How should I prove that $L⊆ L(G)$ and $L(G) ⊆ L$?
I think I should st... |
I'm trying to solve the following Time complexity recurrence relation:
$T(n,k)=T(n-1,k-1)+T(n-1,k)+1$
that come from following code:
int C(n, k) {
if (k == 0 || k == n) return 1; // stop recursion.
return C(n-1, k-1) + C(n-1, k);
}
Unfortunately, I have no idea to solve $T(n,k)$. Any hint that helpful be apprec... |
Two scenarios:
Function is called and data is computed and returned.
Data is saved in variable, updated when required, data is retrieved from variable.
So I was wondering in what kind of scenarios one would be beneficial over the other?
|
I have thousands of data points associated with users. So a single user can have 2000-10000 data points. These data points are identified by contiguous numbers (e.g. all numbers from 0 to 2000). Each data point can have 3 states: true, false, unknown.
What could I do to group these data points so that they don't take t... |
In my database I have 1500 food dishes, not all are single words, there are compound words like "cheese with dried fruit and nuts". And I have them in 5 languages (de, en, fr, es, it).
My question is how could I do it so that given a text it gives me a prediction of the 5 dishes that are closest to that text.
For examp... |
Someone there who worked with cardinal contraindications within the framework of propositional logic? I have a problem understanding the pigeon-hole method. It is a method of satisfaction. I have been trying to understand these three patterns for several days now and I am desperate. Can anyone please explain these thre... |
I've got a few questions related to the different types of memory that we can find:
To my understanding, since there are registers that are close physically to the CPU, these are much faster to access, same goes for the cache that is further to the CPU but still relatively closed, and the RAM which is further than ever... |
I understand that PCA takes a data set with input size, with output labels, and reduces the inputs to a set of principal components size r, where r < n.
My question is whether or not this can be applied beyond a simple classification problem where the outputs are not simply labels. For instance, in sheet metal forming ... |
I have been reading CLRS and came across a few examples of the Master theorem. I could not follow the reason that epsilon was chosen as 0.8 in the example from page 96 . Can I simply use the condition n^log(b) of a to determine the maximum value of epsilon? For example for case 3 where ()=Ω(log+) for some constant >0.... |
I have only heard of / seen Grobner bases in passing, but my understanding is that they are much like vector bases but for polynomials instead of linear systems. I know polynomials are used in CAD and graphics at the very least. Is there any particular reason why I haven't seen Grobner bases in application? I'm trying ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.