instruction stringlengths 35 29.1k |
|---|
having problems with big oh and big omega functions when there is a $\log n$ added or subtracted. For example how do I deal with $n+\log n$ or $n-\log n$ when I have to determine whether the function is in $\Omega(n)$ or in $\Omega(n^2)$? For example, is $n-\log n$ in $\Omega(n)$ or in $\Omega(n^2)$?
I cannot ignore th... |
Support Vector Machines turn machine learning linear classification tasks into a linear optimization problems.
$$ \text{minimize } J(\theta,\theta_0) = \frac1n \sum_1^n \text{HingeLoss}(\theta,\theta_0) + \frac{\lambda}{2} ||\theta||^2 $$
My question is, what linear programming runs on the background for the minimizati... |
Let $\Sigma$ be some alphabet. We define the following operation on the set of all languages over $\Sigma$.
The operation $\mathrm{3MAJ}(L_1, L_2, L_3)$ takes in three languages $L_1$, $L_2$ and $L_3$ and outputs the language of all words that are members of the majority of the input
languages. Formally:
$$\mathrm{3MAJ... |
How would the following term in the pure untyped lambda calculus be parsed:
y λx.x y
The relevant conventions listed on https://en.wikipedia.org/wiki/Lambda_calculus_definition#Notation (as well as many texts on this subject) state:
Applications are assumed to be left associative: M N P is parenthesised as ((M N) P)
T... |
A relation on two sets $A$ and $B$ is defined as the subset of the cartesian product $$A\times B = \{(a,b),\ a \in A, b \in B\}$$
A database is also a relation and each entry is an ordered tuple respecting the cartesian product.
Now, interchanging the rows and the columns of a database does not change it. I can underst... |
I think Option C is false. Following is my thought process:
Starvation in general mean Process is waiting indefinitely for the resource or to get scheduled etc. [A/c to Galvin Book]. So, here in this question, Any process needing any resource at any point can call the OWNRESOURCE function and process will surely get t... |
I'm using the grammar scheme of Danielsson and Norell ("Parsing Mixfix Operators"). The short version is:
user defined mixfix operators such as _+_ or if_then_else_
the precedences form a DAGs
it is known that this creates an unambiguous grammar if the operators don't share lexical tokens
otherwise, input gets rejecte... |
I'm new here, and I'm currently trying to understand why mod operation can be used as a hash function.
For example, consider the function $h(x)=x\mod 2^{256}$, where $x$ can be a string of any length. The book says that this function will return a fixed size of 256 bits. To my understanding, $h(x)$ will return an integ... |
This is an overall system design and DBMS question:
If the user books a ticket or an item on a website, how do we solve the issue of confirming a ticket is sold to the user, but the main Database System breaks down, and the secondary DMBS doesn't have that information yet?
Is the most common solution just to not commit... |
Problem 1: Consider the following problem: given a binary string $w=a_1a_2\cdots a_n \in\{0,1\}^*$, decide whether $w$ contains 00000 as a substring (i.e., where $w$ contains five consecutive 0's). There is an obvious $O(n)$-time algorithm. You will investigate the hidden constant factor, concerning the number of bits... |
I started watching SICP lectures and am totally new to computer science.
SICP. LEC 1B: Procedures and Processes; Substitution Model
I don't know why the time complexity of the Fibonacci sequence is O(Fib(n)).
So, I googled about it,
he says
There's a thing that grows exactly at Fibonacci numbers. It's a horrible thing... |
I'm trying to figure out how to make the action table for a Turing Machine computing $⌈\log_{2}(n)⌉$. The input and output shall be unary (meaning $3$ should represent $111$). I can only deal with 1 tape.
Also, I would prefer having 7 transition states, 1 final state, 24 actions and 5 symbols, but any other numbers are... |
Is there some kind of "universal list" of performance of different algorithms in different situations?
I have different databases that save user input (numbers). However some of these sets of numbers are small and some of them are really big (such as the common one). There are negative numbers included.
I remember from... |
For clarity, I'll claim the supposed impossible program to be 'Code X'.
Something doesn't seem to make sense about the proof against Code X:
Consider a code that halts if you input oranges, but doesn't if you input apples. The answer to whether it halts is in this very obvious case is that 'it depends'. So either this ... |
I faced a problem that looks very hard, the problem is this:
We have 5 people putting dots on a whiteboard, each person uses colored dots with a different color (there are 5 colors, 1 for each person). My job is to find a cluster of points which contains 3 or more distinct colors. Also, we have some fixed radius $R$,... |
I have a given fully-connected undirected graph associated with (known) distances or alternatively a distance matrix, where the nodes or matrix rows/columns represent locations.
Additionally, I have a number of items smaller or equal to the number of locations, as well as a finite number of traversal paths for the item... |
Assuming I have an Oracle that takes as input a strictly 3SAT Boolean instance and states whether the instance is satisfiable or not. If it says instance is unsatisfiable then the instance is unsatisfiable. If it says instance is satisfiable there is a 57% chance the instance is satisfiable and a 43% chance that is uns... |
I'm trying to figure out if there is an algorithm which can solve the following:
Given an array of randomly generated values, for example: $$[54.6, 1.96, 5.0, 31.31]$$
Find an array of equal length, in this example $[x_1, x_2, x_3, x_4]$ such that:
$$54.6 \cdot x_1=1.96\cdot x_2=5.0\cdot x_3= 31.31\cdot x_4$$
and
$$x_1... |
How would you construct a Turing Machine that calculates log2(n)?
The process must take in an input such as 4 and output the result in a unary format such as a 11 (11 = 2 in unary)?
In the final output tape, the tape should only contain blank symbols followed by a consecutive number of 1's from the final head position.... |
I'm trying to prove the running time of heapsort on an array sorted in decreasing/increasing order is $\Theta(n\lg n)$ in order to show that the worst-case running time of heapsort is $\Omega(n\lg n)$
The site here https://courses.csail.mit.edu/6.046/fall01/handouts/ps2sol.pdf mentions :
The running time of HEAPSORT o... |
In a set system $(U, F)$, $F\subseteq \mathcal{P}(U))$, we say that a function $f: U \to \{0, 1\}$ is a coloring of $(U, F)$. A set in $F$ is split by $f$ if $F$ receives both colors.
The Set Splitting problem is defined as follows:
Given an set system $(U, F)$ and an integer $k \in \mathbb{N}$, does there exists a ... |
Suppose you are given two sets of integers L and M both having N elements. The problem is to match each number in L to a number in M. Such perfect matching has some cost given by $\sum_{i=1}^{N} l_i*m_i$.
I want to find some perfect matching with some given cost. I suspect that this is hard (i.e. NP-complete). Can you ... |
If $x \in L$ only if $x \in A$ and $x \in B$, where A is an NP problem and B is a coNP problem, I cannot place $L \in NP$ or $L \in coNP$ without implying that NP = coNP right?
|
I have the following code which I have to figure out the recurrence relation, but I am having a bit of a trouble understanding what the algorithm does exactly.
Interesting-Product(A[1..n])
if n = 1 then return
for i := 1 to n/3 do
A[i] = A[i]*A[i+(n/3)]
Interesting-Product(A[1..n/3])
for j := (n/3) + 1 t... |
I saw this question Can I simplify log(n+1) before showing that it is in O(log n)? and wanted to know if a similar situation was also true.
Namely, is $\log(n-1) \in \Omega(\log(n))$?
|
I'd like to monitor divergence/diversity in my swarm during the particle swarm optimization algorithm to measure when the swarm search space is converging.
This would be used as one metric to be recorded during the run and potentially to terminate the PSO process when not much further progress is to be expected.
Is the... |
I have been looking for a while but I cannot find an algorithm for a particular generalisation of sequence alignment.
I have two posets $(A, <)$ and $(B, <)$ and a similarity score $s(a, b)$ for all $a \in A, b \in B$. I wish to find a maximal scoring alignment such that both partial orders are respected.
An alignment ... |
The Wikipedia definition of the decision tree model says that it allows the sign functions of certain classes to be computed in constant time (and presumably also memory). My questions, still unresolved by reading the article, are:
Can those functions be fed any values computed by the algorithm (including ones of asym... |
I am learning this topic and there is a concept that LSB ( bit ) of MSB ( byte ) should be set to 1 for multicasting . But why we need to do so as multicast address is unique so why can't we assign any multicast address which is not present in that network.
|
Can someone tell me if this works? It seems to be easier to implement and also creates slightly less paths (though still O(log N) ).
The problem: given any tree of size N, find a way to split it into some disjoint paths such that from any node, you can reach the root by passing through log N paths. Heavy light decompos... |
Let's say you have a binary tree defined by a group $S=\{a:[5,6],b:[7,67],c:[45,12],...\}$ (this group is just an example). The binary tree is constructed so that there are two starting parent nodes, $a[0]$ and $a[1]$. Each of those nodes have two child nodes $b[0]$ and $b[1]$. Each of those nodes ($b[0]$ and $b[1]$ fr... |
Let's consider we want to calculate a[i]=a[i]*c for a vector the size of N=12 on some random processor.
We do assume that c is some given constant already present in the register. We do not consider any superscalarity or vectorization.
We also know the latencies for the following instructions:
Load operand to register... |
How to simulate two counters using one (FIFO) queue? (In terms of algorithms, unary stack.)
|
Let G = (V,E) be a directed graph, where V is a finite set of nodes, and E ⊆ V × V be the set of (directed) edges (arcs). In particular, we identify a node as the initial node, and a node as the final node. Let x and B be two non-negative integer variables. Further, we decorate each edge with one of the following four ... |
Suppose you're given this KB:
$$KB = (A, A ⇒ B, A ⇒ C, B ∧ C ⇒ D)$$
How would you show using a SAT solver that $KB \vDash D$?
|
Question
For any string $\sigma$ over alphabet $\Sigma$, we define the operation $\texttt{MOVE}$ as following
For $\sigma = aw$ ($a \in \Sigma, w\in \Sigma^*$), $\texttt{MOVE}(\sigma)=wa$
This is equivalent to moving the starting symbol to the end. For example, $\texttt{MOVE}(10110)=01101$.
Show that for a regular la... |
How do you go about solving the following problem that tries to match the greatest number of clients with servers with constraints? I'm trying to identify an algorithm or simulation that could help me solve this problem as optimally as possible.
Assume you are given a 2d map of servers and clients randomly scattered. E... |
I'm looking for algorithm that, for given undirected graph $G=(V,E)$, find graph $G'=(V,E')$ with minimal amount of edges that have same vertex cover as G. I mean, vertices $U$ are vertex cover of $G$ iff they are vertex cover of $G'$.
I understood that a polynomial algorithm exists, it's mean without finding the verte... |
I know why cases 1 and 2 are wrong because our language can have different numbers of 0's and 1's. But I'm not sure how case 3 can be proved wrong for our language.
Exercise 1.30:
Describe the error in the following “proof” that $0^{∗}1^{∗}$ is not a regular language. (An error must exist because $0^{∗}1^{∗}$ is regula... |
I want to know why the distances between nodes in a minimum spanning tree seems to be rooted to the node with highest degree.
A bit of context here:
I have spatial explicit weighted network that describes the physical growth pattern of a fungal colony. Most of the nodes in this network have either degree = 1 or degree ... |
I have two functions. a and b.
Both have linear complexity O(n).
fcn a (items)
loop items -> item
...
fcn b (items)
loop items -> item
...
loop items -> item
...
loop items -> item
...
Though b obviously takes 3 times longer to run than a for the same input.
Is the... |
I came up with the idea finding a k-clique through starting at a small s-clique (like 1-,2- or 3-clique) and use it to find every s+1 Clique iterative. I had some trouble finding the Time Complexity and I am not sure where I might have went wrong.
First I will show the algorithm, argue about its correctness and then wh... |
This is a follow-up to post Perfect matching problem, where nir proved weak NP-completeness.
Suppose you are given two sets of integers $L$ and $M$ both having $N$ elements. We want to match each number in $L$ with a number in $M$. Such perfect matching has some cost given by $\sum_{i=1}^{N} l_i*m_i$.
The problem is to... |
I have a question related to design, implementation of programming languages. I hope it fits here and apologize if it doesn't.
All or most programming languages version modules (aka packages, libraries, crates). All the entities in a module (types, functions, variables and other information) share the same version with... |
Suppose there's a program A that decides whether or not every program halts.
Then we could construct program B that invokes A and does the opposite. Do I halt? If so, loop. Do I loop? If so halt.
That shows we cannot construct program B.
HOWEVER, that assumes B can be embedded in A.
Could there exist a program B that d... |
The question requests to find the recurrence relation of the following algorithm and solve it using the characteristic equation.
\begin{align}
&\text{SORT}(A[0\dots n-1])\colon\\
&\quad \text{if } n = 2 \text{ and } A[0] > A[1] \text{ then} \\
&\quad\quad \text{swap}(A[0],A[1]) \\
&\quad \text{else if } n > 2 \text{ th... |
I have the following regular expression $R=ab^*(\epsilon \cup c) \cup c^*a$ and I want to construct the NFA that accepts languages defined by that regular expression.
I started by constructing the NFA that accepts $R=ab^*(\epsilon \cup c)$
Next I tried to continue the concatenation part by adding the following to the ... |
I graphed the functions and when $n_0$ is greater than $3$, $cg(n)$ is always greater than $n^2 \log n$ so it would seem to me by definition that $m^2 \log n$ is in $O (n^2) $. I tried to prove it by dividing both sides of inequality by $n^2$ . The $c \ge \log n $. As n tends to infinity there will be values of c that ... |
I have a large set of $(X)$ hospitals and $(Y)$ homes, where $(Y)$ is much larger than $(X)$, and their respective coordinates. Each hospital can handle any home within a 50 mile radius, and up to 10,000 homes. Homes can be assigned to one hospital. How do I create assignments of homes to hospitals such that as many ho... |
I am trying to come up with less than and less than or equals operators for a Map where values are Sets. These are the hints I was able to get from the Professor.
{A -> {1,2}, B -> {3,4}} < {A -> {1,2}, B -> {3,4}, C -> {5,6}}
{A -> {1,2}, B -> {3,4}} < {A -> {1,2}, B -> {3,4,5}}
My solution was this:
val v_compare ... |
Let $L\subseteq\Sigma^*$ be a language, where $\Sigma$ is a set, and let $n\in\mathbb N$.
I am wondering if there is some good terminology for
$L\cap\Sigma^n$.
Of course I could say "the set of words in $L$ of length $n$" but maybe there is some special terminology like "level set of length", "grade", "homogeneous se... |
Definition:
Let $T(V, E)$ be a rooted tree with root $r$.
If $T$ has no other vertices, then the root by itself constitutes the preorder traversal of $T$.
If $\lvert V \rvert > 1$, let $T_1, T_2, \dots, T_k$ denote the subtrees of $T$ from left to right. The preorder traversal of $T$ first visits $r$ and then traverses... |
In step 2 (expansion) of the Monte Carlo tree search algorithm, one or more child nodes are created, and one node named C is chosen among them. The simulation step is applied to C giving it a score of 0/1 or 1/1. What happens to the other newly created leaf nodes? I assume they get a score of 0/0, which will not work v... |
I have been working on the following homework question, and I just can't seem to make any progress:
Construct a finite automaton having fewer than 36 states that recognizes the language $\{s \in a^* : \operatorname{gcd}(|s|, 504) \geq 6\}$, where $|s|$ is the length of $s$.
So far I have been trying to figure out a r... |
Can anyone suggest a starter book or website where I can find information and examples of putting functions under summation signs into Big Theta. basic Arihmetic , geometric, Quadratic are fine , but I would like to work on examples like
$$\sum_{i = 1}^{\log n} i \cdot n \text{ or } \sum_{i = 1}^{\log n} 10^i$$
|
Immediate Smaller Element Problem:
Given an integer array arr of size $n$. For each element in the array, check whether the right adjacent element (on the next immediate position) of the array is smaller. If next element is smaller, update the current index to that element. If not, then update it to –1.
Input: arr[] ... |
I am doing an exercise which says that this is true:
T(n) = 2 + 2T($\frac{n}{4}$) = O($\sqrt{n}$)
So I tried to solve it by substitution, but I am getting a non-sense result.
So would really appreciate some pointer in the right direction.
So I want to show it for $\frac{n}{4}$ (sub-question, I am picking $\frac{n}{4}$ ... |
I have a question regarding the cardinality of sets and strings.
If $ \Sigma^* $ is empty, the cardinality is 1, because the empty word $ \varepsilon $ is counted.
If $ \Sigma^+ $ is empty, the cardinality is 0, because the empty word is excluded from the set.
If $ \Sigma $ includes at least one symbol, the cardinality... |
I don't understand what these function are like and why they satisfy that f(n) is not O(g(n)) and g(n) is not O(f(n)).
Where is x?
\begin{eqnarray}
f(x)=
\begin{cases}
k^{2k}, &x\in(2,2+1)& \\
k^{2k+1}, &x\in(2+1,2+2)&
\end{cases}
\end{eqnarray}
\begin{eqnarray}
g(x)=
\begin{cases}
k^{2k-2}, &x\in(2,2+1)& \... |
$\text{Consider the following ANSI C code:}$
int main(){
Integer x;
return 0;
}
$\text{What will be the type of error?}$
$\text{a) Lexical}$,
$\text{b) Syntax}$,
$\text{c) Semantic}$,
$\text{d) None}$ $\tag {GATE-CS 2021}$
According to me, Syntax Analysis phase should detect the error as there is no grammar in C whi... |
In Arthur C. Clarke's short story, "The 9 Billion Names of God", two software/hardware engineers are contracted by a monastery to generate 9 billion string permutations from a 13-character alphabet. The only rules are that no character can occur 4 times in a row and each string must be 9 characters long. They estimate ... |
While learning about computers I will read about RAM and Storage and the CPU, and while these explain the architecture of a computer and how parts of a computer work together, I still don't understand the fundamental workings of a computer program.
Let me take an example.
I'm on the web on a mac right now. When I push ... |
I have 50 polynomials $f_i$ over binary variables $(x_1,\ldots,x_{100})$. Also $f_i(0,0,\ldots,0)=0$
for any $i \in [1,50]$. I want to assign few variables so that all $f_i$ will be
identically zero. I want to assign number of variables as small as possible.
Here assign means we will fix some variable either 0 or 1. O... |
For many discrete problems, it's natural to consider their continuous relaxations. A common case is when instead of $x_i \in \{0, 1\}$ we allow $x_i \in [0, 1]$. In certain cases, the original problem is an integer linear programming (ILP) problem, and its relaxed version becomes a linear programming (LP) problem, whic... |
Assuming that the time complexity of the two algorithms $A_1$ and $A_2$ to solve the same problem are $O(n^3)$ and $O(n)$ respectively. If you write programs for these two algorithms and run them in the same environment, does the program of algorithm $A_2$ run faster than algorithm $A_1$ for sure? why?
|
This is the desired result which I want:
|
I am facing the task of designing an algorithm to rank some hundred of images (around 300). The ranking is to be based on pairwise comparison judged by human (done through Amazon mechanical Turk). I have read many papers on ranking inference based on a subset of all possible pairwise comparisons (e.g. Jamieson and Nowa... |
I have found a problem on my Computer Architecture textbook which I have some issues with:
We have a process which spends its time in the following way:
50% of the time, it executes common arithmetic (non-floating point) instructions
10% of the time, it executes floating point instructions
40% of the time, it execute... |
Suppose I have an ode that involves infinitely many variables, with the property that at any given time, only finitely many of them are large enough to be of interest (say $>10^{-10}$). However, at different times, different variables may become large.
It is also the case that given such a set of interesting variables,... |
I think, Preemption can easily be done in kernel mode, where it just have to call the Context-Switch procedure. Also, based on algorithm we can select the new process from the ready queue as well...
I'm unable to think and find Why and where the role of timers come and what exactly are significance of Hardware in preem... |
Imagine a N by M 2D array of random positive integers and two coordinates (i1,j1), (i2,j2), which represent the upper-left bound and bottom-right bound of a subarray, respectively. Is there a efficient algorithm to calculate all the minimum values of each subarray?
[[4, 10, 9, 7],
[9, 8, 1, 2],
[1, 21, 3, 1]]
In t... |
I'm working on creating a rather difficult CFG and I am getting stuck on finishing it. The CFG in question is meant to contain all valid regular expressions using the alphabet {0, 1, (, ), *, +, e} (e for epsilon).
Some examples I know that should be accepted are things like:
e
0
01
1010
0*1*0*1*
0*11+(10)*+(e+1*0*)
(... |
I've implemented longest common substring in python. I know the usual way to reconstruct the path. But, I am reading my algorithm many times, I don't understand why it doesn't work for some test-cases. I am trying to construct the solution while the longest path is being made through dynamic programming.
def lcs(s1, s2... |
Given a function $f$ of $n$ variables, is there a reasonable way to generate all integer points on the hypersurface given by $f(x)=0$?
To be more specific, let us assume that $f$ is a polynomial with integer coefficients and $S=\{x\in\mathbb{R}^n\mid f(x)=0\}$ is bounded. If one knows a bound for the elements of $S$,... |
For any context free grammar, there is a parser that takes atmost n^3 time to parse a string of length n.
Doubt: I marked it false in a national level exam.I think it should be any null-free context free grammar and not any cfg because we first have to convert cfg to cnf but only null free cfg can be converted to cnf.
... |
Given the below ambiguous grammar how can I make it inambiguous and how can I prove the new modified unambiguous grammar is unambiguous? S -> S + S | S − S | S ∗ S | S / S | (S) | x | y
My attempt: The ambiguity can be corrected by
S -> S + T | T , T ->T - M| M, M * N|N , N / Q | Q , Q-> (I) | x| y|
But I'm unsure how ... |
I am trying to understand SVMs in depth watching lectures from MIT.
The professor to reduces the classification problem into an optimization problem. To do that, he first defines the decision and margin boundaries as following:
Note that $\frac1{||\theta||}$ is the distance between the margin boundaries and the decisi... |
For a Finite State Automaton / Finite State Machine (FSM) $F$, that has an input alphabet, a set of possible states, an initial state, a set of possible final states and a state transition function, let a finite input sequence $S$ is given, such that at the end of this sequence the FSM enters a final state and stays in... |
Consider the following program fragment:
var x, y: integer;
x := 1;
y := 0;
while y < x do
begin
x := 2*x;
y := y+1
end;
For the above fragment, which of the following is a loop invariant?
(A)x=y+1
(B)x=(y+1)^2
(C)x=(y+1)2^y
(D)x=2^y
(E)None of the above, since the loop does not terminate
As per my solution, ... |
Is there a polynomial algorithm that can compute the diameter (the distance between the furthest points) of a convex set?
It is possible to do it efficiently for a set of points, but imagine that the set is described by the intersection of linear equations in high dimensional space, so the number of vertices of the set... |
I'm interested in a variant of minimum set cover where some sets are ``incompatible'' (they can't be chosen simultaneously).
To state it more formally:
We have a finite base set $X$ and a family $\mathcal{R}$ of subsets of $X$. We also have an undirected graph $G$ with vertex set $\mathcal{R}$ and edges representing in... |
I am working through the book "Parameterized Algorithms" https://www.mimuw.edu.pl/~malcin/book/parameterized-algorithms.pdf and at the chapter about tree decomposition I am trying to understand the choice of using 2/3 separations instead of 1/2 separators.
It has also been stated in the exercise 7.33 that there would b... |
I was recently working on an old qualifying exam problem asking us to generalize Karger's randomized global min cut algorithm to that of a global min $k$-cut. I recalled the strategy of running a recursive version of the randomized edge contraction algorithm to help with the shrinking the error probability and ultimate... |
I have an NFA, and the question I am asked is :
Let < < . Now in simple English, express the language of the NFA to explain what type of strings are accepted by it.
In simple English, my answer is
The NFA accepts strings over alphabet {a, b, c} such that the last symbol appears twice.
Which I know is correct, however... |
I'm looking for a textbook or reference material to learn about the theory of abstract data types, the ways in which they are specified (axiomatic specification vs abstract model), imperative vs functional definitions, etc.
I'm looking for a theoretical book that gives a good introduction to how they are discussed and ... |
For a CFG with the production rules that can represent a regular expression. How can one calculate all the set of strings that regular expression would produce.
For T = {a, b,*,(,)}
and an arbitrary production rule I created to represent a simple regular expression
S->SS | S* | (S) | a | b | ∅
What would be an attribut... |
I'm trying to solve the following problem :
A tile results of a number and a color.
a tile can be black, red, orange or blue.
a tile number is >= 1 and <= 15.
Given a random set a tiles (a same tile cannot be present more than twice in the set, so we have 15 * 4 * 2 = 120 tiles maximum), find if all the tiles can be ... |
What I tried first was to find the equation of the line and then compare its y-intercepts with the y-intercepts of each point. I just need the proper approach to this algorithm.
|
Suppose for a given optimization problem, $A$, the size of the search space $S$ is |$S$|.
If the fitness landscape defined by $A$ is unimodal, then there is clearly only one global optimum. Given that $G$ is the event "reach the global optimum", can we then infer that $P(G) = \frac{1}{|S|}$, where $P(G)$ denotes the pr... |
From this answer, and the comments that follow:
To clarify, this machine T′ with the fixed output for all inputs is a Turing machine? – Shashank V M
@ShashankVM, Yes, T′ is a Turing machine. – D.W.♦ (When can a deterministic finite-state-automata (DFSA) along with its input sequence be said to be a part of another D... |
I have been looking at the question as to which grows faster asymptotically; $\log \sqrt n$ or $4 \log n$. I have applied L'Hopitals rule and ended up with 1/8. This would imply that they grow at same rate.
Graphically $4 \log n$ is always above $\log \sqrt n$. Also from a perspective that $4 \log n$ is $\log n^4$ w... |
I'm trying to understand what LDA exactly does when used as a classifier, i've understood how the dimensionality reduction works and i've understood that the classification task is carried out with the application of Bayes' theorem, but i still can't figure out if LDA executes both operation when used as a classificati... |
I want to learn computer science, SO is discrete math enough for computer science ? Or there other Math topics that I should also learn With it ?
I don’t have specific topic that I care more about than others (like cryptography) ,Just CS.
|
I saw people use DAGs to represent the search space of a search problems like the travelling salesman problem. Why is this better than the tree representation? Is the reason to save memory space on the computer or can it reduce the computation time in some way?
I googled but I didn't find an answer, it would be great t... |
I understand deterministic as a function for some input will always give the same output, and these inputs and outputs can be sets of values represent by a predicate.
I understand confluent as convergence of a rewriting system, ie the rewritten terms always converge to some term, which could also represent a predicate.... |
As $-1 <\sin(n) < 1$, So $n^{\sin(n)}$ is bounded, but square root of $n$ tends to infinity. Is my logic correct? But from the other perspective, $1/n \leq n^{\sin(n)} \leq n$. I am confused.
|
I have the language $L = \{ dkd\space \mid d \in \{a,b\}^*, k \in \{a,b\} \}$ and i have to show that it's non-regular using the pumping lemma.
The structure of the language i think can be explained as (based on definition above) $\{a^{n}b^{n}ca^{n}b^{n} \mid c \in \{a,b\}\}$
Based on pumping lemma, it must have this 3... |
What would happen in the variant of the Josephus problem in which people in odd-numbered positions are killed in each round?
For example, with $N=10$ people:
$$
1, 2, 3, 4, 5, 6, 7, 8, 9, 10 \to 2, 4, 6, 8, 10 \to 4 ,8 \to 8.
$$
As you can see in the above example the killing starts from position $1$.
I was just curiou... |
I have an array of N symbols written on a cyclic tape. I read a sequence of M symbols starting from a random place on the tape. What error correcting scheme and even a coding scheme should I use for such "channel"?
Also will this problem be simpler if tape is not cyclic?
|
In the wikipedia page on pure type systems, it gives the following inference rule:
$\frac{\Gamma \vdash A : s \quad x \notin \text{dom}(\Gamma)}{\Gamma, x : A \vdash x : A }\quad \text{(start)}$
What does $\text{dom}(\Gamma)$ mean here? These are string rewriting systems, so $\Gamma$ is supposed to be a string of sym... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.