Most Popular

1500 questions
14
votes
2 answers

Universes in dependent type theory

I am reading about dependent types theory in the Homotopy Type Theory online book. In section 1.3 of the Type Theory chapter, it introduces the notion of hierarchy of Universes: $\mathcal{U}_0 : \mathcal{U}_1 : \mathcal{U}_2 : \cdots$, where every…
huynhjl
  • 243
  • 1
  • 7
14
votes
2 answers

What are the advantages of x86 CPUs over ARM?

Now that Apple is switching the MacOS platform to ARM chips, much has been said about the benefits of ARM processors (they save energy, are passively cooled, and the Apple M1 seems to be faster than even an Intel Core i9 processor). I'd like to know…
Jonas Sourlier
  • 243
  • 1
  • 2
  • 7
14
votes
2 answers

Are there peer-reviewed papers studying the pros and cons of functional programming?

Can somebody refer me to peer-reviewed papers studying the advantages or disadvantages of writing code in a functional style? Are there papers which discuss the applications of Lambda Calculus in fields such as Machine Learning, Language Design,…
14
votes
2 answers

Are runtime bounds decidable for anything nontrivial?

Problem  Given a Turing machine $M$ which has known runtime ${O}(g(n))$ with respect to input length $n$, is the runtime of $M \in {O}(f(n))$? Is the above problem decidable for some nontrivial pairs of $g$ and $f$?A solution is trivial if $g(n)…
Chao Xu
  • 3,103
  • 19
  • 34
14
votes
1 answer

Efficiently selecting the median and elements to its left and right

Suppose we have a set $S = \{ a_1,a_2,a_3,\ldots , a_N \}$ of $N$ coders. Each Coders has rating $R_i$ and the number of gold medals $E_i$, they had won so far. A Software Company wants to hire exactly three coders to develop an application. For…
Jack
  • 329
  • 1
  • 5
14
votes
2 answers

Algorithm to determine whether two regexes are equivalent

Given two arbitrary regular expressions, is there an "efficient" algorithm to determine whether they match the same set of strings? More generally, can we compute the size of the intersection of the two match sets? What algorithms are there to do…
MathematicalOrchid
  • 897
  • 1
  • 8
  • 13
14
votes
3 answers

Is O((n^2)*log(n)) greater than O(n^(2.5))?

I know that $O(n^2\times \log(n))$ is greater than $O(n^2)$, but is $O(n^2\times \log(n))$ greater than $O(n^{2.5})$?
Samuele Bianchi
14
votes
5 answers

NP-hard problems but only for n≥3

2-SAT is in P; 3-SAT is NP-complete. Exact cover by 2-sets is in P; exact cover by 3-sets is NP-complete Two-dimensional matching is in P; three-dimensional matching is NP-complete Graph 2-coloring is trivially in P; graph 3-coloring is…
Mark Dominus
  • 1,567
  • 14
  • 22
14
votes
4 answers

Does our PC work as Turing Machine?

Does our PC work as Turing Machine? The model of a Turing Machine consists of infinite memory tape, which means infinite states. But suppose if our PC has 128 MB memory and 30GB disk it would have 256^30128000000 states and thus, it has finite…
14
votes
1 answer

Finding a 5-Pointed Star in polynomial time

I want to establish that this is part of my homework for a course I am currently taking. I am looking for some assistance in proceeding, NOT AN ANSWER. This is the question in question: A 5-pointed-star in an undirected graph is a 5-clique. Show…
BrotherJack
  • 1,115
  • 1
  • 10
  • 23
14
votes
2 answers

Machine learning algorithm to play Connect Four

I'm currently reading about machine learning and wondered how to apply it to playing Connect Four. My current attempt is a simple multiclass classificator using a sigmoid function model and the one-vs-all method. In my opinion, the input features…
Tom
  • 141
  • 1
  • 4
14
votes
1 answer

Program synthesis, decidability and the halting problem

I was reading an answer to a recent question, and sort of a strange, ephemeral thought came to mind. My asking this might betray either that my theory chops are seriously lacking (mostly true) or that it's just too early for me to read this site.…
Patrick87
  • 12,924
  • 1
  • 45
  • 77
14
votes
2 answers

Number of possible search paths when searching in BST

I have the following question, but don't have answer for this. I would appreciate if my method is correct : Q. When searching for the key value 60 in a binary search tree, nodes containing the key values 10, 20, 40, 50, 70, 80, 90 are traversed, not…
14
votes
1 answer

Can the sorting of a list be verified without comparing neighbors?

A $n$-item list can be verified as sorted by comparing every item to its neighbor. In my application, I will not be able to compare every item with its neighbor: instead, the comparisons will sometimes be between distant elements. Given that the…
Display Name
  • 395
  • 1
  • 7
14
votes
7 answers

Why do negative array indices make sense?

I have came across a weird experience in C programming. Consider this code: int main(){ int array1[6] = {0, 1, 2, 3, 4, 5}; int array2[6] = {6, 7, 8, 9, 10, 11}; printf("%d\n", array1[-1]); return 0; } When I compile and run this, I don't…
Mohammed Fawzan
  • 283
  • 1
  • 4
  • 8