instruction stringlengths 35 29.1k |
|---|
Suppose we have a website and you log in the website with a username and a password.During registration your computer downloads a file containing a random 32 digit number.Now when you try to log in , the website asks you 5 questions.Which is the digit at position x?(with x being a random number from 0-31).Isnt this a z... |
Alice is preparing decorations to decorate the classroom for Children's Day. She is using beads in the colors red (r), green (g), blue (b), and yellow (y) to create strings of beads. During the class meeting, it was established that two beads of the same color cannot be placed next to each other.
Help Alice design the ... |
Imagine having a number of straight and curved train track segments (e.g. 90° to the left and right, but they could have other values in the general case), how is it possible to find all complete (closed) tracks that can be built with them (not necessarily using all elements)?
I suppose with a low number of track segme... |
I'm playing around with the implementation of PEGs and it struct me that the parser generator itself isn't any different than the language it's use to construct. If fact, it has all of the hallmarks of a compiled (pure) functional programming language:
It's declarative
State is passed around to other functions and aft... |
This is a continued question from: The updated convex hull algorithms in 2023?
From Handbook of Computational Geometry (Third edition, 2018) section 26.3, Seidel mentioned the boundary and the lattice descriptions of the convex hull algorithms, and that the lattice description was less practical, where Avis-Fukuda's bo... |
Consider a very simple RAM chip that has 20 address pins and 4 data pins. I would like to know the function of the 4 data pins when only 1 data pin is enough.
What do I mean by 1 data pin is enough? If an address is applied to address pins, a memory cell is selected (which can only have value 0 or 1 — in a very basic R... |
In some languages, it is expected that a function declaration be terminated by syntax that includes the function name. For example, in MODULA-2, a function is declared as shown below:
PROCEDURE P ;
BEGIN
...
END P ;
Is it possible to verify such a requirement using a syntax analyzer? If yes, explain how to do it. If no... |
Consider the language
L = {< M >| M accepts iff input length is divisible by 3}. I'm supposed to use reduction to show that the language is undecidable. I tried proving it but didn't know what to do.
|
Please point me to the right place if this isn't the right one to ask in.
There are 2 initial integer variables (the values of the two can be changed). $a = 4$ and $b = 1$
There's a function. Each run of the function can distribute a total of $5$ to $a$ and $b$.
So any positive integer combination of $5$ is possible.
... |
I have two types of objects, X and Y, each are recursive structures, and contain different structures sets of tuples containing sets.. etc. The number of elements in X and Y are is the same.
I need to proof that for every x in X, there is a unique y in Y.
Can this be achieved by defining a bijective function which uses... |
by definition log(n)=O(f(n)) therefor if M uses O(f(n)) cells it might as well uses log(n) cells, how do I continue?
|
I was reading about star-free languages recently and a common example of a non-star free language is the one given by (aa)*.
I was wondering if (ab)* would also work (for an alphabet of two symbols let's say).
|
Definitions: Let $n \in \mathbb{N}, n \geq 1$. We write $|\alpha|$ to denote the length in characters of an expression $\alpha$ in propositional logic. We define partial evaluation in the normal way where evaluation is applied to an expression containing constants until no more evaluation is possible. So for example if... |
I am working on exact algorithms for an NP-hard problem $P$. I was able to get a $(1.75^n$) time algorithm for split graphs. When it comes to bipartite graphs, the problem becomes hard to tackle. Now, I want to prove that there is no sub-exponential algorithm for the problem on bipartite graphs. So to prove this, I hav... |
Haskell's monads are usually considered to mean strong monads in category theory, but it seems like the former is a bit stronger than the latter. With strong monads, you have a Kleisli extension operator
$-^* : C(a, Tb) → C(Ta, Tb)$
that operates outside the category $C$, whereas with Haskell's monads you can write an... |
Can the strengths of Mulitple Dispatch system of Julia language be replicated in a newly designed language like Mojo through cleverly designed mechanism? Or only Julia gets to have such a feature due to its strong type system. Can programming languages theory address this issue?
|
This question is because I think it would be fun to make an A.I.
Any programming language is acceptable. I am wondering how do I make a simple program that can associate certain things with points and learn to prefer things with more points associated with them. It is a very general question.
If you need an example, ho... |
Say that I have a plasma gun:
It's easy to compute the trajectory of the plasma ray starting from the gun.
However, another ray may come from afar:
As everybody knows, plasma rays are deviated when they collide. In fact, they are always deviated 90°, away from the other ray:
Space is discreet (like a chess board). E... |
Can any SAT problem be converted into one with only affine formulas?
Handbook of Satisfiability p. 672:
Affine formulas. A linear equation over the two-element field is an expression of the form $x_1 ⊕ … ⊕ x_k = δ$ where $⊕$ denotes the sum modulo $2$ and $δ$ stands for $0$ or $1$. Such an equation can be expressed as... |
From Discrete lizard's answer and Handbook of Computational Geometry (Third edition, 2018) Section 26, Chazelle's solution of high dimensional convex hull achieved worst case optimal. T.M. Chan's algorithm made the practical implementation, and Avis and K. Fukuda's solution was more efficient.
However, I recently came ... |
I recently came across this question, and the way I think people usually go about this is to find a certificate that answers 'yes' to the decision problem 'Is this LP infeasible?' Or, given a certificate, verify if that yields infeasibility or not. I know of the theorem that says Ax = b is infeasible if there exists y ... |
The steps to get a number in 2's complement are simple:
Flip the bits (Using NOT)
Add +1 (afaik this step is done to eliminate the duplicate 0)
Recently I've seen an ALU design that can operate negative numbers in 2's complement without the seconds step. For example, we want to perform the following operation $y-x$
T... |
Let $\Sigma$ be an alphabet. Is the set of all strings over $\Sigma$ (i.e. $\Sigma^*$) countably infinite or uncountably infinite?
|
If a virus is defined as a self-reproducing program, then Rice's theorem implies there can be no infallible virus-detecting algorithm.
Can we take that one step further, as follows? If you have the source code for a virus-detecting program, could you use it to produce a virus that the program will fail to detect?
|
I am currently watching the FreeCodeCamp Algorithms and Data Structures Tutorial. In the explanation for exponential time complexity, they explain that using a brute force attack on a combination lock would create O(x^n) time complexity. I am confused as this attack sounds very similar to a linear search of the passcod... |
So in the halting problem, there is a program that reverses the output of a program that tells if the input program halts or runs forever(I'll call it the main program further). The whole paradox is based on the fact that if we feed this "reverser" program to the main program the reverser program will be in two differe... |
I am working on giving an MSOL formula for an NP-hard problem; this proves that the problem is linear-time solvable on bounded treewidth graphs. Given a graph $G = (V, E)$, the problem would be to find a subset $S \subseteq V$ such that each vertex of degree at least three has at least two neighbors and at most three n... |
I'm trying to isolate the key differences between induction and recursion so that I am able to know when to use one over the other.
From my understanding, both can be used to prove properties about recursive structures.
For example:
Consider a recursive structure $x \in X$. In order to prove that for all $x$, $P(x)$ is... |
So, I know there is no general algorithm for the halting problem, but I was curious if a three output decider could at least give us "an" output {0 if doesn't halt, 1 if halts, U if undecidable for this decider}.
Here's the halting problem, roughly, in python:
# The decider function tries to determine if a function... |
I have a genetic algorithm/programming problem where I need the best arrange of items in a binary tree. My question is the best way to mutate/cross this binary tree subject to constraints described below.
All items need to be leaves in this binary tree and there are no nodes with only one branch populated. That is, all... |
In the book Self-Stabilization (Dolev, 2000) the author provides a proof (p.19) of Dijkstra's self-stabilizing mutual exclusion algorithm. An excerpt of the book showing the proof is found below.
At the end of the proof for Theorem 2.1, the author states
In accordance with lemma 2.4, P1 must assign j to x1 in every
n... |
Consider the problem of scheduling jobs with different lengths on a single machine while the jobs have the same release times and different due dates. The goal is to schedule the maximum number of scheduled jobs such that none of the scheduled jobs is late. Can this problem solved in polynomial time if jobs are non-pre... |
Let us assume, we have a FSM (to be precise, an epsilon-NFA) in which I've got redundant structures.
I am looking for a framework that allows to factor out the redundant part into some kind of subautomaton, respectively a more canonical representation and naming of this kind of NFA.
As illustration I've got the followi... |
Consider normalized DFT (discrete Fourier transform) — a transform with input $x = (x_0,\dots,x_{n-1})$ and output $y=(y_0,\dots,y_{n-1})$ s.t.
$$y_j = \frac1{\sqrt{n}} \sum_{l=0}^{n-1} x_l \omega^{jl}, \tag{1}$$
where $\omega$ is a primitive $n$-th root of unity (e.g. $\omega = e^{-2\pi i/n}$). It is described by a un... |
I was exploring a problem of label flipping in the target column:
Problem:
I have a data frame with just two columns: Predicted probability | Target. Target column is binary (contains only 0 and 1) --- the actual target values. Predicted probability column contains outputs from my model. I calculate the ROC-AUC metric ... |
Are there (interesting) situations where we can decrease the time complexity of a program by increasing its ordinal complexity?
For example, is it possible to find a primitive recursive function such that:
The fastest primitive recursive program to compute it runs in $O(f(N))$.
The fastest non primitive recursive (for... |
int q(int n)
{
if (n <= 0) return 0;
return 1-q(q(n-1));
}
I'm not sure how to approach this. I tried representing the time complexity as a function $T(n)$ and then use repeated substitutions:
So I got $T(n)=C+T(T(n-1))$ where $C$ is a constant representing a constant amount of lines we have in the fun... |
I wanted to ask a simple question:
Assume I have a function whose time complexity is given by the following function:
$T(n)=\frac{1}{1^2}+\frac{1}{2^2}+\frac{1}{3^2}+...+\frac{1}{n^2}$.
Would it be correct to say that the time complexity of the function is $Θ(1)$ because $T(n)$ is represented by a convergent series?
|
The literature that I have reviewed shows examples of calculations of known approximation algorithms such as the Christofides' algorithm for the TSP. However, I have not been able to find information regarding the calculation of the approximation factor of an algorithm that has a loop inside as the one in the example b... |
A common issue with CPU performance is that pipelining requires the knowledge of what will come next, and what comes next can only be known once a branch condition is evaluated, so that instructions in the branch can be preloaded.
As such, CPUs employ branch predictors to predict which branch will be taken so that the ... |
I'm working my way through the graph section of Introduction to Algorithms by CLRS (3E,4E) and I came across the following proof:
3E: Lemma 22.2
Let $G = (V, E)$ be a directed or undirected graph, and suppose that BFS is run on $G$ from a given source vertex $s \in V$. Then upon termination, for each vertex $v \in V$, ... |
Let $G = (V, E)$ be a graph with edge weights $w: E \rightarrow \mathbb{R} \cup \{\infty\}$.
Let $P := \{(a_i, b_i, w_i)\}$ be a set of tuples of nodes $a_i, b_i \in V$ with shortest distance $w_i$ from $a_i$ to $b_i$.
We want to update the weights of a subset of edges $E' \subseteq E$, and then efficiently update the ... |
Is it possible for a language (or machine or system) to be universal or turing complete, when there is no possibility to write a program for it that halts?
Lets say we create a new language, brainfuck-nonstop, that like brainfuck with a single change: When the program pointer reaches the end, it goes back to the start ... |
Consider two large numbers $a$ and $b$ of which some, not necessarily prime factors, are known. This means $a = a_1 \cdot \dots \cdot a_n$ and $b = b_1 \cdot \cdots \cdot b_m$. Required is their quotient
$$
\frac a b = \frac {a_1 \cdots a_n} {b_1 \cdots b_m}
$$
of which is also known that it is a (positive) integer.
Mo... |
The Trench algorithm (1996) has complexity N*N to invert an N by N positive-definite Hermitian Toeplitz matrix. More recently (2005), Martinsson et al "A Fast Algorithm for the Inversion of General Toeplitz Matrices" describe an algorithm with complexity NlogN for general Toeplitz matrices but the intrinsic complexity ... |
I am new to C++, and upon running this code I am getting the following error, can someone please explain what's wrong with the code? Thank you.
main.cpp:8:17: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
8 | C(char *s = " ",int i =0, double d=1){
|
A computer science lecturer said that one should use test as programs can't be proved to be bugless. Is this true? What does it mean to prove that program is bugless? Is there a proof that it is impossible to find such a proof? And is there a method to transform a program to a mathematical statement whose proof can or ... |
I know that Integer Linear Programming problems are NP-hard. But it seems like this answer is only applicable to Integer Linear optimization problems.
It seems like integer linear feasibility problems should be able to be solved in polynomial time.
I was thinking that this would look something like this:
Solve the lin... |
Quantum mechanical principles have already been used to attack computer science problems in the form of quantum computing. In a similar vein, is there any usage of general relativity principles to generate algorithms in favor of computer-scientific problems? One (fairly trivial) example would be solving the shortest pa... |
Weighted interval scheduling with m-machines
('Weighted interval scheduling with m-machines')
I encountered the problem of weighted interval scheduling on m identical machines (as discussed in the link above). My greedy solution is exactly the same as the answer provided by D.W. in that link. 1. sort the interval by pr... |
Let $\Sigma$ be a finite nonempty alphabet. Is the set of all DFAs over $\Sigma$ countable?
I know the set of all regular languages is countable, however, it is impossible to build an injection from the DFAs to the regular languages since a regular language isn't necessarily accepted by only a single DFA.
|
The time complexity of the matrix product is $O(n^3)$ if calculated normally for each element.
If computed on GPU, is it $O(n)$?
What I thought:
GPU can compute each element of the matrix product in parallel.
Each element is computed by a inner product of vectors $\sum_{k=1}^n a_kb_k$
Each $a_kb_k$ can be calculated i... |
I am searching for a CS equivalent to American Math Monthly. It should contain articles on topics and some problems at the end for submission. I need some recommendations .
Thanks in advance.
|
Consider the following "game".
There is an ant on a strip of length N. The ant can perform the following actions: move left, move right, and paint the cell he is on with white or black. The ant is also given a target coloring and must paint the strip according to such coloring in the most efficient way possible. The a... |
Weisstein, Eric W. "One-Way Function." From MathWorld--A Wolfram Web Resource.:
The existence of one-way functions is not proven.
Why not?
|
I'm interested in getting a precise estimate of the computational complexity of an algorithm I wrote involving permutations. Permutations are represented in my code as arrays of the integers $1$ through $n$ for some $n$, which can vary, and at least in the output (but perhaps not in the intermediate stages) the $n$th e... |
I am developing a computer vision system, using the pinhole camera model. Is this an appropriate model to use for a real camera? I know that lenses and such will distort the image, my main questions are: for a cheap webcam (which I plan to use), what are the distorting effects of lenses and having a finite sized camera... |
Suppose we are given $n$ bits $a_0,\dots, a_{n-1}$. Then let $s=\sum\limits_{i=0}^{n-1}$ Then $BCOUNT(a_0,\dots,a_{n-1})=s$ and $UCOUNT(a_0,\dots,a_{n-1})=1^s0^{n-s}$ Now i have to show that $UCOUNT\leq_{cd} BCOUNT$ i.e. $UCOUNT$ is constant depth circuit reducible to $BCOUNT$. I have to create a constant depth circuit... |
This is a follow-up for Weighted interval scheduling with m-machines ---greedy solution with approximation factor.
As suggested by @D.W., I will present the problem more comprehensively.
$\textbf{Problem Definition}$:
Given $n$ intervals and $K$ identical machines, each with a duration $t_{(\cdot)}$, fixed start time,... |
Suppose some hash family H satisfies $$Pr_{h_{\in_{R}} H}[h(x_1) = h(x_2)] = \frac{1}{|Y|}$$ Does it mean H is 2 universal?
The converse is true, but I'm not sure about this.
|
Suppose we have an alphabet of size $S$, a pattern of length $P$ and a text of length $T$. We want to design an algorithm for matching all caesar rotations of the pattern $P$ in the text $T$. The problem can be solved using the following two methods:
By $\text{KMP/Z}$ against all $S$ rotations of $P$ in time $O(P+ST)... |
Gaussian integer is a complex number whose real and imaginary parts are both integers.
Say I want raise $(a + b*i)$ to power $(c + d*i)$ and have result modulo $m$.
I can do it with floating-point approximation using normal complex power, as defined with exp and ln. But this is not precise, I can lost important last di... |
The AND boolean function $AND(x)$ can be represented using the polynomial $P(x) = x_1x_2\cdots x_n$. I have a few questions:
Is there a similar polynomial for the PARITY boolean function?
Is there a boolean function whose polynomial doesn't have a maximum possible degree?
|
Given an ordered list of two-dimensional points $P$ that represent the vertices of an $N$-sided (very) self-intersecting polygon, find a point $p_{best}$ with the highest winding number of all points within that polygon represented by $P$.
Sunday's algorithm sounds great for efficient calculation given one point, but s... |
You are given the number $m$ and $m$ intervals of the form $a_i, b_i, v_i$, where $a_i<=b_i$ and $v_i>0$ and also a number $n$ and an array $s$ of length $n$, where $s_i>0$. In one operation you can choose an interval say $j$ and decrease the values of $s_i$ by 1, where $a_j<=i<=b_j$, and you can choose interval $j$ at... |
My understanding of the Curry–Howard correspondence is that it shows an isomorphism between constructive logic (also called intuitionistic logic) and computer programs in appropriate typed languages.
Basically, a (logical) proposition corresponds to a type, a proof (of that proposition) is an inhabited type, a function... |
I'm trying to check if the binary tree is binary search tree. My idea is to use Morris traversal. Intuitively a binary tree is balanced iff Morris traversal produces a sorted threaded linked list.
The problem is I could not prove this proposition strictly. Is it even correct so it's safe to use it for binary search tre... |
For reference, the $Y$-combinator is the expression
$$ Y = \lambda f . (\lambda x . f (xx)) (\lambda x . f (xx)) $$
in the untyped lambda calculus. If $g$ is any lambda expression, then
\begin{align}
Y g
&= \lambda f . (\lambda x . f (xx)) (\lambda x . f (xx)) g \\
&\to_\beta (\lambda x . g (xx)) (\... |
I am trying to design an algorithm. For now, I am trying to give myself a large overview.
Assume I have K (for example, K can equal 8) perfect slave machines, and one master machine. Each slave has a perfect HDD. I want to save the string "ABCDEFGHIJKLMNOP". My wished are
I want to only save a fragment of the string ... |
Hello I am trying to implement Non Max suppression algorithm for removing overlapping bounding boxes. I have a list of bounding detected by an object detector in the format B(x,y,w,h,s)
x,y are coordinates, w,h are size, and s is confidence score.
Aim of NMS is to remove overlapping boxes and retaining only ones with h... |
Given an $n$ input array, is there an algorithm that is faster than Fast Fourier Transform if we are only interested in obtaining the maximum amplitude frequency?
Looking at the Cooley–Tukey algorithm it seems there would be a way to "prune" frequencies that are guaranteed to not be of maximum amplitude.
The applicatio... |
Suppose we want to find a vector $x\in R^n$ that satisfies the constraints $g_i(x)\leq 0$, for $i\in 1,\ldots, m$, where all $g_i$ are convex functions. The functions can be given by an oracle access: there is an oracle that, given x, returns $g_i(x)$. If this helps, we can also have an oracle for their derivative $g_i... |
This is an example algorithm of a recursive insertion sort I'm trying to understand. I've have tried understanding this with
the help of print statements (which I've commented).
def ins_sort_rec(seq, i):
if i == 0:
return
# print(f"{' ' * i} starting at depth {i}")
ins_sort_rec(seq, i-1)
j ... |
I have following language $L:= \{a^n b^n c^m \mid n \neq m; n,m \ge 0 \}$ and would like to use proof by contradiction by applying Pumping Lemma for CFLs to show that $L$ is not a CFL.
In any case, i need to choose $w = uv^iwx^iy$ so that $w \in L$.
I tried $a^p b^p c^{p+1}$ , $a^p b^p c^{p+p!}$ ($p$ - Pumping Length) ... |
I was reading the Book: The Art of Multiprocessor Programming; Section 2.3.2. and I have a doubt regarding their $\texttt{LockTwo}$ algorithm mentioned in Page 26.
The snippet of the algorithm is:
class LockTwo implements Lock {
private volatile int victim;
public void lock() {
int i = ThreadID.get();
... |
I am reading the book: Digital Design and Computer Architecture: ARM Edition
I am on the chapter about virtual memory. I am wondering, when a page fault occurs, is it the processor or the OS that "fixes it". In the text below they first say that the processor fixes it, then they say it is the OS that fixes it.
Do you u... |
In my reference, Page 26, Algorithms by Sanjoy Dasgupta, Christos H. Papadimitriou, and Umesh V. Vazirani, a division algorithm is give as,
\begin{align}
&\text{function divide}(x, y)\\\\
&\text{Input: Two n-bit integers x and y, where }y ≥ 1\\\\
&\text{Output: The quotient and remainder of x divided by y}\\\\
\\\\
&\t... |
Let me take the set $A = \{1, 2\}$ as the alphabet. By the bijective binary numeral system, $A^*$ has one-to-one correspondence to the set of nonnegative integers $\mathbb{N}$. As such, each language $L \subset A^*$ corresponds to a subset of $\mathbb{N}$.
Now consider the power set of $\mathbb{N}$, and treat its eleme... |
How do i prove that the regular expression $$a^*(ba^*)^*$$ is the same as $$(a+b)^*$$. Is there a way to prove this using regular expression identities?
|
Insertion into a heap is an O(logn) operation. Insertion of n elements into a heap one by one is summarised as O(n * logn). I wonder about the math behind this, because I could not reach to the same outcome.
Let's say we have an empty heap h = [].
The first insertion will be a constant time operation, say O(1)
The sec... |
Today, I came across the notation 3[arr] in C++, and I was surprised to find out that it's a valid way to access array elements. For example:
int arr[] = {10, 20, 30};
int element = 1[arr]; // This compiles and works!
Online IDE: https://onlinegdb.com/4o8qnsx8O
The assembly of this looks exactly same
arr:
.lon... |
hopefully I'm writing this post in the adequate place if not please move my post
I'm reading this paper about L-shaping fitting for vehicles. and ran into this optimization in the photo attached.
in the paper it is written that due to the combinatorial complexity of the partition problem it is not easy to solve the opt... |
Lets consider a range of "K" binary digit numbers. In that range, we want to take a subset of those values which have (<="n" consecutive 0s) AND (<="n" consecutive 1s).
Then, we want to find the order of values in the resulting subset incrementally.
Also, we want to do the "un-ordering" of the values. i.e. find the val... |
So we know that LBAs have a finite number of configurations, which makes the task of detecting loops much easier. My proposition is that if a given LBA is constructed to recognize a language, it also decides it since if there was a non-halting instance of the problem, we can detect it and terminate the computation.
Is ... |
Toda's theorem says that the polynomial time hierarchy is contained in $P^{\#P}$, the class of problems solvable by polynomial time oracle Turing machines with access to an oracle in #P, which is the class of functions that return the number of satisfying assignments of nondeterministic machines clocked in polynomial t... |
Question
Consider a system which has logical address is 7 bits, physical address is 6 bits , page size is 8 words, calculate the number of pages and no.of frames, size of page table.
Answer
Addressing Scheme in a Paging System
Given the following information:
Logical Address: 7 bits
Physical Address: 6 bits
Page Size:... |
Given an undirected graph $G$ with non-negative edge weights, how can we prove that the predecessor subgraph $G_{p}$ of $G$ is always connected?
Here's how the predecessor subgraph is defined: for a graph $G = (V, E)$ with source $s$, the predecessor subgraph of $G$ is $G_{p} = (V_{p}, E_{p})$, where $V_{p} = \{ v \in ... |
I am looking for literature on abstract models on parallel computing. I am mainly referring to models like Alternating Turing Machine, PRAM or NC-uniform equivalence (Boolean circuits) with some parallelism capability.
I would like to know if there are any recent advances or literature on the subject.
Thank you very mu... |
In order to enumerate such a regular expression, it's clear one can break down the language into the set $s =\{00,01,10,11\}$ and it is clear that we need to enumerate some expression that avoids the following combination of strings:
01, 00+10,00+11, 10+11. I'm just having finding trouble enumerating the regular expres... |
I wanted to learn Operating System on my own. Although I have learned few basic things from here and there, but wanted to know the suggestions (books, any video lecture, etc.) from this community.
|
I need to build a schedule that maps 7 people to 4 groups (3 pairs, 1 single) for each week.
An ideal schedule would be one where each person swaps pairs and groups in a round-robin style. If such a schedule is not possible, an algorithm that creates a schedule that minimizes repetition while being fair over the long t... |
I am looking for a reference on the most optimal output-sensitive algorithm currently available for listing all maximal cliques in a graph.
I know the Bron-Kerbosch algorithm is highly utilized, but it is not output sensitive (i.e., the expected running time does not depend on the output).
There is also the Tsukiyama e... |
This is probably insignificant, but I was messing around with polynomials, and found out that, if we have a number, n = pq that we want to factor, if we expand (k+1)^n -k^n - 1, mod n, the first nonzero term will be a factor of n. This, of course, is just trial division in disguise, since in order to find p, you would ... |
Does the following highly down-voted answer not answer the question "Why does Schaefer's theorem not prove that P=NP?"? If not, why not?
Marek, V. Wiktor. Introduction to Mathematics of
Satisfiability. Boca Raton; London; New-York: CRC Press, 2009,
p. 310:
THEOREM 13.3 (Schaefer Theorem)
Let $Γ$ be a collection of B... |
I am a high schooler who has been programming for about 3 years now. My skill level is above what AP Comp Sci and especially what principles can teach me. What should I be doing to improve myself and prepare for future schools/jobs? What should I be adding to my portfolio?
|
I am a CS undergrad trying to improve my problem-solving skills. I have noticed that I have a problem with theoretical computer science which I've been trying to fix largely unsuccessfully till now. I have noticed these in Undergrad courses such as Theory of Computation, Algorithm Design, Discrete Mathematics, Game The... |
For these algorithms, the time complexity of BFS and DFS is O(E).
I have gone through many websites and even the algorithm books, but I never got a clear idea of why it is O(E). It just says it's O(E) in the flow graph as it considers only edges. What does this mean?
|
I don't actually understand the meaning of $w$$x$ + $b$ = 0
when it is defined in support vector machine.
In my own understanding, in order for the equation to be true, the hyperplane would always need to pass through the origin.
$w$$x$ + $b$ = 0
0 = 0
But when I look at many diagram of SVM hyperplane, it doesn't pass ... |
Taking an example, say we have Page size = 4KB, Page Table Entry = 4B, Physical Address Space requires 36 bits
In 3-level multi-paging, let's say the number of entries in the level 3 page table is 2^9 (so the size of this page table would be 2^9 * 4B = 2^11 B )
In level 2, there are 2^9 entries as well and finally in l... |
If I have 2 version of code
1.)
def T(n):
if n == 0:
return 1
return T(n-1)+T(n-1)
2.)
def T(n):
if n == 0:
return 1
return 2 * T(n-1)
Is my understanding correct that the time complexity of the first function is O(2^n) and the second function is O(n)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.