instruction
stringlengths
35
29.1k
My goal is to find the best combination, or good approximation, of weighted elements with different constraints / relations, for example: B can only be there after A B have to be there after A B have a different weight if present after A B have a different weight if present in the N next elements after A B can only be...
Table 4 in Problem Solving with Algorithms and Data Structures's chapter on Infix, Prefix and Postfix Expressions gives the following examples: Infix Expression: A + B * C + D Prefix Expression: + + A * B C D Postfix Expression: A B C * + D + Why is prefix not: + A + * B C D To show my reason for this question, I'...
The approach described in this question is wrong. It'll find false positives for disconnected components with multiple vertices. See D.W.'s answer for a reliable alternative. This might be a simple question, but I can't seem to find a clear cut algorithm for this. I'm given a set of vertices from a graph and I need to ...
What is the 1's and 2's complement of 0.01101? I'm unable to find any details on this from google. Basically how do we represent the floating points in 1's and 2's complement forms? Even wikipedia only says that 1's complement is the inverted bits of binary representation. The examples only contain integer values. I co...
QUESTION EDITED Since this question wasn't clear, I'll rephrase. See question-history for original. I'm looking for academic papers that describe schema evolution on documents (1) in a generic way. More specifically some questions I'm hoping to see answered in part: given a schema A and documents adhering to schema A: ...
It has been shown that any Linear Program (LP) can be solved in a polynomial number of steps. An example of such algorithm is the ellipsoid method. To solve a problem which has $k$ variables and can be encoded in $L$ input bits, this algorithm uses $O(k^4L)$ pseudo-arithmetic operations on numbers with $O(L)$ digits. ...
Consider the following two arguments "For every non deterministic TM M1 there exists an equivalent deterministic machine M2 recognizing the same language." "Equivalence of two Turing Machines is undecidable" These two arguments seem a bit contradicting to me. What should I conclude from these two arguments?
Do we consider Pushdown Automata, Turing Machines in Finite State Machines? If we don't, then what does the term "Finite" stands for in Finite state machines, as PDAs & TMs are also defined to have Finite Number of States?
Alright, I'm not sure if this is more of a stack overflow question, but I'm going to try here because you folks seem more suited. CouchDB makes an interesting claim about using an "append only" B+ tree to index its documents. Specifically... "In a B-tree, data is kept only in leaf nodes. CouchDB B-trees append data ...
"If every subset of a set is a CFL, then the set must be regular." I want to prove it, could anyone please give me some hints?
I am studying compressed row storage (CRS format) for storing an sparse matrix. I can't tell how this works if the matrix has a row with all entries zero, and in particular, what happens with the pointer row_ptr. Could you describe the val, col_ind and row_ptr vectors for the following matrix? \begin{bmatrix} 2 & 0 &...
The question I'm working from is: Prove whether or not a finite automation exists that recognises the following language: B = {ww | w ∈ {a,b,c,...,z)*} EDIT So I believe this is a non-regular language. My understanding of pumping lemma is not great but this was my solution: S = apbapb Where S is a valid string in the l...
I am doing practice after just learning what combinational circuits are, yet I am unsure of why (c) is combinational, but (d) is not. Can someone please explain to me why this is? The Solution mentions that for (d) node n6 connects to the output terminals of both I3 and I4, but how is this different from the circuit i...
There's many types of Machine Learning methods, but one sticks in my mind, and I don't understand why for ex. Q Learning was made instead of just using the following method: Method: Say we give the robot some Triggers, we will implant a pre-installed image of a girl, taste of fries, sound of birds, and acceleration. Wh...
I'm currently looking into developing a system in which media from various sources is collected, with the notion that the media collected for each user is media they 'like'. This results in a set of n users, each with their own respective set of m liked items. Most papers on recommender systems I find either require e...
To get to clarification of "generalizing" and "overfitting" I first must state the following: We have a robot, it makes guesses, and the way we know what guesses to keep is by if the received sensory input matches pre-installed senses that keep it alive/producing. The analog to my terms are training/test data and guess...
I am studying CFL at the moment and I found this confusing. What I've just read is that, $L=\{ww\}$ is not a CFL. The proof showed it by using pumping lemma for CFL. ($w=0^n1^n0^n1^n$) and I fully understood the proof. Here comes the question. I understand that $L1=\{ww^R\}$ can be constructed by NPDA, and thus a CFL. ...
Is the language $L=\{a^nb^n\} \cup \{aa*\}$ DCFL OR CFL? The author says $L$ is CFL, but I am able to generate a Deterministic PDA for the corresponding language. I am naive in this subject and hence I am not sure whether its DCFL or CFL. Can you provide an explanation that shows $L$ is either DCFL or CFL? i dont know ...
The title says it all. I've tried digging up debate on this issue to see a proof one way or the other but it doesn't look like anyone is able to say whether or not it is. Clearly there are recursive structures in English, and that's about all anyone seems to say.
I have a set of thousands~millions of points on a sphere's surface, each with latitude, longitude. I want to quickly get all points within a distance d of a particular sphere point latC, lonC. The points are mostly concentrated at places where humans go often. Some points have the exact same latitude and longitude. d ...
How does it help avoid frame collisions? Are there any rules for when the back off is allowed, especially in the case of wireless networks?
I'm working on a complex engineering problem that I've essentially reduced to this problem: I have a set of natural numbers $1,N$ and a grid (square or hexagonal) of exactly $N$ cells. I have to map each number to each cell so that the distribution (in a geometric sense) is as flat as possible. I'm still working on the...
Suppose we have a set E of entities. Each entity is described by a set P of binary properties (i.e. each element e of E has a defined true/false value for each element p of P). |P| >> |E| We now want to select a subset of fixed size (e.g., 10) of P that will enable us distinguish the elements in E as accurately as poss...
currently working through slides and I've noticed this which I believe to be an error. Shouldn't the two DFA's be swapped around, so that the one that reaches the accept state is with L(M)=nothing is the accept state? If not could you explain why?
I came across following fact: If we AND two functions expressed as CDNF (Canonical Disjunctive Normal Form), then the result contains sum of commont minterms. For example consider two functions $f_1$ and $f_2$ on three variables $A,B$ and $C$ expressed in CDNF. Then they will have eight minterms: $m_0$ to $m_7$. If...
I am confused in calculating the time complexity for a recursive function inside a loop. Function (int n){ if(n<=1) return; for(int i=1;i<=3;i++) Function(n/3); } in the text book answer written for this is theta(n). Please explain how is it so?
Consider a basic integer program such as: $$\begin{align} \min_x & \quad c^Tx \\ \text{s.t.} & \quad Ax \leq b \\ &\quad x_i \in \{-100,\ldots,100\} \end{align} $$ where $x \in \mathbb{Z}^n, A \in \mathbb{R}^{m \times n}$ and $b \in \mathbb{R^m}$. Say that I have a point $y \in \mathbb{Z}^n \cap [-100,100]^n$ that I w...
"The class of Recursively Enumerable Languages is closed under Union, and Intersection but they are not closed under Complement." I know why they are not closed under Complement & why they are closed under Union & Intersection but for other classes of languages we use a reasoning for closures based on the De'Morgan...
Let $"t"$ and $"s"$ be a words we will say that two words are "completly different" if for all $1\leqslant i\leqslant |t|$ the $i$ letter in $t$ diffrent from the $i$ letter in $s$. Prove that the language $\mathcal{L}=\{ts|t,s\in \{0,1\}^*,|t|=|s|,t,s \text{ completly different} \}$ is not a free-context-language ...
I learned how to convert context-free grammar to pushdown automata but how can I do the opposite? to convert PDA to CFG? For example: to write CFG for the automata My attempt: $S=A_{03}$ because $q_{\color{blue}0}$ is the initial state and $q_{\color{blue}3}$ is the final state. There are $4$ states so we will have $4...
We're given a fixed text, and we are presented with a series of online queries of patterns. For each query, the goal is to answer if the pattern exists in the text. Each pattern is a string, and we want to know if it appears as a substring of the text. The text can be preprocessed. What's the optimal way to solve this?...
Can I do encryption on a compressed file and again decompress the file after decryption to get the original data?
What is the definition for k-line-connectedness of the graph ? I am in doubt whether it differs from usual k-vertex (edge) connectedness. I've encountered it in the paper titled "Np-complete problems on a 3-connected cubic planar graph and their applications" where it comes without definition. Unfortunately for me I co...
In an upcoming of an exam of 'Digital Techniques', we have to be able to design sequential circuits, and in particular we have to draw Moore FSM's when the equations for the output and next states are given. One of the exercises we could use to practice our skills is: "A sequential circuits with two flip-flops A and B,...
I have $N$ uniformly distributed 2D points and I want to find out how many points lie in some small rectangular region. However, the number of points can be arbitrarily large (e.g., $N=10^8$), so I don't want to explicitly generate points and insert them in some spatial data structure. I am not interested in the actua...
$L = \left \{ a^{c}\mid \text{c is a composite number} \right \}$ I feel that this is not a context-free language as checking this constraint requires divisibility checking, but I am facing a hard time in proving that $L$ is not a Context Free Language using Pumping Lemma. Could please anybody please give me a hint?
Take this example in 2's complement representation with 8 bits. 1111 1110 + 1111 1110 ( -2 + -2 = -4 ) Calculation: 1111 1110 +1111 1110 ----------- 1|1111 1100 = -4 in 2's complement This operation gives overflow and carry at the same time?
Question: Given 2 undirected graphs $G_1$, $G_2$, the problem whether exists a subgraph H1 of G1 which is isomorphic to a subgraph $H_2$ of $G_2$. What is the lowest complexity class for this problem: a. PSPACE b. NPC c. NP d. P Thoughts We were thinking of this to be in NP because we can get a certificate of such two ...
Primitive recursion can be extended to double-recursion as in the following link: http://www.andrew.cmu.edu/user/kk3n/recursionclass/1primrec.html How can this be generalized to n-iterated recursion? I got the term "n-iterated recursion" from Hans Hyttel on Quora. The idea is that double-recursion extends primitive r...
To compute the determinant of a $n \times n$ matrix using the cofactor expansion requires roughly $n!$ operations ($n! = 1 \times 2 \times 3 \times \ldots \times n)$. Consider a $25 \times 25$ matrix. This would require $25!$ operations or roughly operations. Suppose you have a super computer that can do $1$ trillion o...
In computability we have the hierarchy of grammars "https://en.wikipedia.org/wiki/Chomsky_hierarchy". In this hierarchy we have many classes of grammar. This hierarchy has Turing machines at the top, and weaker machines lower. Machines are able to "recognize" languages within their class, and they are able to "decide" ...
Question: Which of the following languages are in P? which in NP? other classes? a. EXACTLY-2-CNF (every clause in the formula has 2 differenet literelas)- does there exist a satisfying assignment s.t. at most k variables are TRUE. b. same language but this time in each clause one literal is negated and the other isn't...
In Philip Wadler's paper on Theorems for Free he states in Section 2 on Parametricity that there are no naive set-theoretic models of polymorphic lambda calculus In the naive set-theoretic model types are sets and functions are set-theoretic functions which seems reasonable. So why does he say there are no naive set-...
I have a text and a narration of the exact same text. What is the best way to synchronize them together? By synchronizing I mean, finding out for example the location of each word in the audio. For example if the sentence is "I took a cab" I want for markers on the accompanying audio which indicate start of each word. ...
I'm trying to understand the math behind correcting a radial distortion (caused by a lens), but I'm failing to have it explained in simple terms. I found several examples that proceed this way: a starting point $P = (x, y)$ is given and it is transformed to another point $P'=(x', y')$ with the following equations $$\be...
Let $L$ be some language. What could you say about $L$'s grammar if it is a regular language, that couldn't be said if it was a context free language? For example, in case $L$ is regular, could you say that there exists a context-free grammar $S$ such that every derivation rule of $S$ is of the form: $$V \rightarrow \s...
In 1982 Brian Smith proposed his Knowledge Representation Hypothesis: Any mechanically embodied intelligent process will be comprised of structural ingredients that we as external observers naturally take to represent a propositional account of the knowledge that the overall process exhibits, and independent of ...
I came across the Python library libgpuarray and was reading about it but could not really understand what a GPU array is and why do we need it? What is the difference between a normal array and GPU array? Please excuse the noobness of the question.
Let's say that I want to restrict certain features of a common programming language--for instance, C--such that the result is decidable, and thus no longer Turing-complete. What language features, at minimum, would I need to remove to make a given programming language decidable? For the purpose of this question, let's...
I am having a hard time figuring out the specific relationship, of various things in computability. So we have a hierarchy of machines, with a (real life) upper bound of Turing machines, moving on down to things like deterministic finite automata. We also have a hierarchy of grammars that the machines can implement. Th...
Given a directed graph $ G = (V,E)$ with non-negative(zero and positive) weights on the edges, and a vertex $ s \in V $ Problem: Find the lightest path from $s $ to each and every vertex $v \in V$ and that's from the shortest paths from $ s$ to all $v \in V$ Length of a path is the number of edges in the path. Weight ...
Consider the following variation of Bipartite Maximum Matching. As usual, we have a bipartite graph $G$. In addition, there is an additional collection of sets $S_1,S_2,\dots,S_k$, with each set $S_{i}$ being defined as a collection of nodes from the right side of the graph $G$ as well as a weight. Suppose that in ...
I have this program written in haskell : I have to prove that: $(\forall a \in \mathbb{N})[!D_V [h](a) \Rightarrow log_2 (D_V[h](a) )\equiv 2 (mod$ $ 10) ]$. The predicate $P_2$ for the $g$ function is obvious : $P_2(f,g) \equiv (\forall x,y \in \mathbb{N})[!g(x,y) \Rightarrow g(x,y)\backsimeq xy]$. But the predi...
I'm trying to find the time complexity of Monte Carlo Tree Search (MCTS). Googling doesn't help, so I'm trying to see how far I get calculating it myself. It does four steps for n iterations, or before the time runs out. So we'll have O(n*(selection+expansion+simulation+backpropagation)) Expansion just adds a child t...
Let's try to solve "co3SAT" with an NTM in polynomial time. It seems we need, more or less, to guess a proof that the formula is unsatisfiable i.e. derive a contradiction. We've got a formula in conjunctive normal form, a big AND of OR clauses, each clause with 3 literals. Let's suppose we adopt the following strateg...
I'm starting an online Computer Science class called Advanced Programming Languages, and the book asks me to create a parse tree and generate a grammar from it. Here are the exact instructions: To verify that a string of characters belongs to a language defined by a grammar, we must create a parse tree that shows tha...
Let's say I have a general tree. What algorithm can I use to find a shortest walk that starts at the root, passes through exactly $k$ different leaves, and ends at the root? Passing through a node/edge more than once is allowed. For example, consider this graph: For $k = 1$, the shortest walk would have the node 4. F...
I'm trying to implement a Fourier transform in an OpenGL shader. I found some literature that explains the general principles, but is a bit sparse on some details. And those details are seriously confusing me. This paper describes the use of the Stockham FFT on the GPU. It contains the following diagram: I understand ...
Reading Histograms of Oriented Gradients for Human Detection, I cannot see any discussion of how many layers there should be in the HOG pyramid. OpenCV offers a scaling factor of 1.05 which would mean 15 layers between each halving and Object Detection with Discriminatively Trained Part Based Model suggests 10 layers, ...
"What is the maximum and minimum difference between two successive real numbers representable in IEEE 754 Single Precision and Double Precision Floating Point Representations respectively?" In order to answer this question, I am unable to visualise how Floating Points are spread over the real number line, assumin...
Here: https://www.cs.rochester.edu/~nelson/courses/csc_173/grammars/parsing.html in chapter Driver Procedure, it's shown how table-drive predictive parsing works. The predict table however can involve $\epsilon$-productions (which leads to including a production in the symbols of $FOLLOW(w)$, where $w$ is a non-termina...
I'm looking for innovative ways to create text summaries and I was wondering whether feature structures can be used for such a task. Is it possible to create subsume and unification methods that allow one to model text summary tasks using feature structures?
Suppose we have a datastructure that is a list containing elements that are either a leaf or another layer of the datastructure (recursively defined). What would we call this? It isn't a tree, since it has variable number of leaves and branches on each node. It isn't a forest, since it doesn't consist of a list of tree...
I'm designing a communication protocol for 24 to 52 bits (typically 32 bits) data including the CRC-8 for error detection. I'm trying to select the best polynomial for this kind of application. In the paper Cyclic Redundancy Code (CRC) Polynomial Selection For Embedded Networks Koopman, et. al. gives a very nice method...
Let us consider the following schedule : \begin{array}{lcr} \mbox{$T_1$} & \mbox{$T_2$}\\ \\ \mbox{lock-exclusive(a)} \\ \mbox{lock-exclusive(b)} \\ \mbox{read(a)} \\ \mbox{a=a+50} \\ \mbox{write(a)} \\ \mbox{unlock(a)} \\ \mbox{} & \mbox{lock-exclusive(a)}\\ \mbox{} & \mbox{read(a)}\\ \mbox{} & \mbox{a=a+50}\\ \mbo...
In the context of our class on combinatorial algorithms we have been discussion randomness. One student said (paraphrasing): Pseudo-random number generators (PRNGs) must have a period since they only have finitely many internal states. At least for the PRNGs we see in the class, this is certainly a valid argument (as...
In computability theory, computable functions are also called recursive functions. At least at first sight, they do not have anything in common with what you call "recursive" in day-to-day programming (i.e., functions that call themselfes). What is the actual meaning of recursive in the context of computability? Why ar...
I have an exercise about cache memory, first the cache is empty : I have a cache memory with 16 lines and each lines have 16 octet, the address is 16 bits So I know that the INDEX will be composed of 4 bits and the offset will be composed of 4 bits too So i will have this : bits number : (15 ... TAG... 8)(7.. INDEX.....
A recent question made me think about an obvious approach for circumventing the "algorithm is allowed to do anything" problem, when proving lower bounds. Instead of starting with a simple looking NP-complete problem, start with a powerful looking logical deduction system. Then try to find a reasonable general term expr...
There are $n$ students that share the same apartment. At each evening, one of them must prepare dinner for everyone. There are $m$ evenings to schedule, with $m \geq n$, and you have to assign any singular evening to one student at a time. In particular, student $i$ is disposed to accept cooking for $c_i$ evenings, wi...
Which of the following regular expressions generate a language that is different from the rest? (a+b)$^*$a(a+b)$^*$(a+b)$^*$ b$^*$ab$^*$a(a+b)$^*$ (a+b)$^*$ab$^*$ab$^*$ b$^*$ a(a+b)$^*$ab$^*$ RE 1 generates a language that contains the string 'a' which no other language among 2,3,4 contains, so can I sa...
I am reading this material to understand the basics of number system. I am stuck at a point in that material where it writes the algorithm to convert a decimal number to binary number. The heading of that part where I am stuck is Decimal to Base The algorithm (may be presented less than faithfully, please refer the lin...
Are the following two sets equal? One the set of regular expression over an alphabet, and the other set is the set of all strings which can be generated by using the symbols of an alphabet(Σ*)?
We know that for 3 variables (A=0,B=1,C=1), f$_1$ = (A XNOR B XNOR C) = 1, since the input has even number of 1's. But if we were to do this step by step, f$_2$ = (A XNOR (B XNOR C)) = (A XNOR (1 XNOR 1)) Now, 1 XNOR 1 = 1. So, f$_2$ = (A XNOR 1) = 0 XNOR 1 = 0. Why is f$_1 \neq$ f$_2$ ? Also, which is true : "XNOR op...
I am a little bit confused with the concept of using the Weibull distribution or other distribution for fault model. As I understand, in simulation this distribution is often used for modelling a fault in components. On the other hand when designing systems we often assume some components might become faulty and we use...
I want to ask just a quick question. If I have an array, which sorting method will have a complexity of $n \log n$ if I compare two objects in that array? I can't decide between divide-and-conqueror insertion-sort. And how would the iterative solution look like in pseudocode?
A greedy algorithm for finding a minimum feedback vertex set is to pick and remove a vertex with minimum $w(v)/\delta_H(v)$, where $H$ is the current graph, until there are no more cycles left. (That is, the algorithm looks at the lowest cost per cycle space decreased node picks it and continues to do so as long as t...
I see that modern SW basically dominated by recursive descent parsers. These parsers try grammar production and back track to an alternative one in case of failure. Suppose BNF is program = (declaration)* "begin" (statement)* declaration = type_declaration | variable_declaration | function_declaration type_declaration ...
I am trying to create a DFA and a regex for this kind of exercise: $A = \{w ∈ \{0, 1\}^* |\text{length of w is a multiple of 2 or 3}\}$. I tried to do one for $2$ and one for $3$ and then combine them, but it didn't seem to work cause I miss some cases for example $6,7$ or so. Any help would be gratefully received :D
You are given $N$ numbers. Remove contiguous subsequence of those numbers, so the remaining numbers will create a sorted sequence. For example, if the sequence is $5$, $7$, $8$, $2$, $1$, $9$ then we have to remove subsequence $2$, $1$. I am only interested in the minimal amount of numbers removed. If this task wasn't...
I'm dealing with some simple randomized and on-line algorithms, both kind produce some lower/upper bound on quality of the output instance. For example, there's a simple randomized algorithm for the MAX-E3SAT problem, where there are $m$ clauses each consisting of three distinct 3 variables in $\{x_1, ..., x_n \}$. Th...
I've got a 2D cubic spline (Bézier) and I have the polygon-line that's a discretization of that spline. Is there an efficient and simple to implement a way to calculate the maximum curvature of the spline either by using its smooth representation or the discrete poly-line? It doesn't have to be exact since it's for a ...
Due to curiosity regarding possible extensions of Schaefer's dichotomy theorem, I wound up considering the "promise constraint" with 3 boolean inputs that's given by $C(x,y,z) ​ ​ = \hspace{.1 in}\begin{cases} \hspace{.19 in}\text{ True} & \text{ if exactly one of } \hspace{.02 in}x,\hspace{-0.03 in}y,\hspace{-0.03 in}...
I'm currently working on a compiler backend for a custom architecture which has some unusual constraints. The architecture has several super-registers with aliasing between the sub-registers, and none of these special registers can be spilled to memory. The code is initially constructed to ensure that registers can be ...
In research articles (e.g. this one's abstract), I often see the complexity of an algorithm expressed using a somewhat ambiguous notation: $\log^2(n) = ?$ $\log(n)^2 = ?$ $(\log n)^2 = (\log(n)) \times (\log(n))$ $\log(n^2) = \log(n \times n)$ $\log \log n = \log(\log(n))$ The last three case are easy enough to under...
Minhash is said to estimate the Jaccard coefficient - supposedly because it's faster to compute. Given two sets $A$ and $B$, minhash (with k hash functions) takes $O(k*(|A|+|B|))$ time to compute. But isn't it possible to also compute the Jaccard coefficient $\frac {|A \cap B|} {|A \cup B|} $ in $O(|A|+|B|)$ time by si...
Does a definition of primitive recursion exist for the untyped lambda calculus? Does the definition of primitive recursion require typing for natural numbers? The only definitions I can find are for the typed lambda calculus: http://www.math.nagoya-u.ac.jp/~garrigue/lecture/2013_tenbo/recfun_en.pdf. Perhaps if I just i...
So I am working on a problem where I have a set of (labeled) nodes and I have a tree structure (rooted) over that set of nodes. The goal for me is to automatically generate that tree structure. To find the performance of my algorithm, I am trying to use the score as the fraction of edges that I have common in the gener...
I have given an undirected graph of which I want to associate every vertex with a (random) binary vector. I can chose the dimensionality of the vector but it has to be identical for every vertex. The main constraint is that the closer two vertices are in the graph, the lower the Hamming distance between the two associa...
An answer on Programmers.SE characterizes an essay by Cook (Objects are not ADTs) as saying Objects behave like a characteristic function over the values of a type, rather than as an algebra. Objects use procedural abstraction rather than type abstraction ADTs usually have a unique implementation in a program. Whe...
What are some of the books for "computer organisation and architechture" which are best for self study. Such a text that one can grasps the big picture, and understandhow various things are fitting with each other. Topics include: machine instructions and addressing modes, ALU and data path , cpu control design, memory...
"Let $G\left ( x \right )$ be the generator polynomial used for CRC checking.What is the condition that should be satisfied by $G\left ( x \right )$ to detect odd number of bits in error? a) $G\left ( x \right )$ contains more than two terms b) $G\left ( x \right )$ does not divide $1+x^{k}$ , for any $k$ not exce...
int fun (int n) { int x=1, k; if (n==1) return x; for (k=1; k<n; ++k) x = x + fun(k) * fun(n – k); return x; } What is the value of fun(5)? I find it difficult to realize a recurrence tree when the functions are called inside loops so I decided to go with the recurrence relations. This is what I came u...
I'm having a hard time getting my head around smoothing, so I've got a very simple question about Laplace/Add-one smoothing based on a toy problem I've been working with. The problem is a simple Bayesian classifier for periods ending sentences vs. periods not ending sentences, based on the word immediately before the p...
I am new to python programming. I am now trying to build a program which convert every element in a list of numbers of base 10 into its base 4. For example here, say i have numbers from 0 to 20 or more, I want to convert every number starting from 0 to numbers of base 4. The result should be like this [[0,0],[0,1],...[...
For every non-universal computable program $P$ that takes input of type $D$ does there exist some total computable function $g$ that takes an input $I$ of type $D$ and decides successfully whether $P$ halts on $I$? Some concrete definitions: A program $P$ that takes some data type $D$ as input is computable iff there e...
I read here that "a randomly initialized filter acts very much like an edge detector!". I want to know if there are any papers describing and explaining this phenomenon.
I want to implement an insertionSort-algorithm. Let's say I have these pseudocode. function insertionSort(F) for i <- 1 to n - 1 do j <- findInsertPosition(F, i, 0, i - 1) insert(F, i, j) end for end function Now I want to implement the findInsertPosition function. Say I give this function my list, which ...
We were talking today, in Intro to Programming, about machine language. I know it's a bunch of 0's and 1's. Let's say I compile the following C++ program on an x86 machine: #include <string> #include <iostream> using namespace std; int main() { cout << "Enter something"; string input; cin >> input; return 0; } Now, ...
If I have a weighted graph $G=(V,E)$ and three subgraphs $T_1$, $T_2$ and $T_3$ in $G$ which are trees and all unconnected from each other. What is the best way to connect these three trees such that the resultant connected tree is of minimal cost? If it helps, I have already used the floyd-warshall algorithm to calcul...