Questions tagged [knuth]

Donald E. Knuth is a computer scientist, best known as the author of the series of books on algorithms The Art of Computer Programming and the creator of the TeX typesetting system.

91 questions
1
vote
1 answer

Arithmetic operations in donald knuth's Mix assembly language 1.3.1

I have been reading Donald Knuth's The Art of Programming, Volume 1, in which MIX is used as the assembly language. In the section where Knuth talks about arithmetic operations in MIX, I didn't understand how the subtraction, multiplication and…
dheart_joe
  • 11
  • 1
1
vote
0 answers

Unnormalizing in Knuth's Algorithm D

I'm trying to implement Algorithm D from Knuth's "The Art of Computer Programming, Vol 2" in Rust although I'm having trouble understating how to implement the very last step of unnormalizing. My natural numbers are a class where each number is a…
beeclu
  • 11
  • 1
1
vote
1 answer

Is there a nice way, in Python, to measure the number of memory accesses, or mems, used by a function?

When people ask about memory, they're often asking how much memory is being used, but this is not what I mean. Rather, I'm reading through Donald Knuth's The Art of Computer Programming, and recreating some of the algorithms in Python. Knuth…
Tyler
  • 28,498
  • 11
  • 90
  • 106
1
vote
2 answers

The Art of Computer Programming, Vol 4, Fascicle 2 typo?

At the bottom of page 5 is the phrase "changes k to k ⊕ (1j+1)2". Isn't 1 to any power still 1 even in binary? I'm thinking this must be a typo. I sent an email to Dr. Knuth to report this, but I don't expect to hear back for months. In the…
SSteve
  • 10,550
  • 5
  • 46
  • 72
1
vote
1 answer

Question about Knuth's "Dancing Links" / DLX algorithm (in Python)

I've been reading quite a bit about the "Exact Cover" problem and Knuth's solution using heavily linked lists. I think I understand about 70% of it, but still confused on how the linked-lists "cover" and "uncover" are supposed to work. Knuth's…
Mark Bennett
  • 1,446
  • 2
  • 19
  • 37
1
vote
1 answer

Exact cover problem but with constraint on exact number of subsets in the solution

I'm relatively new to exact-cover and similar problems, so please bear with me. Suppose I have a typical exact-cover problem, ie. given a set X and a collection of X's subsets S, I want to find S* (a subset of S) that exact-covers X. However, I want…
1
vote
2 answers

Implementing Algorithm X in R

I am looking to implement something sort of like Knuth's Algorithm X in R. The problem: I have a n x k matrix A, n>=k, with real-valued entries representing a cost. Both n and k are going to be pretty small in general (n<10, k<5). I want to find the…
ErinMcJ
  • 593
  • 6
  • 20
1
vote
1 answer

Sign in MIX computer by Donald Knuth

In the MIX computer a word is composed of five bytes and a sign. How is the sign represented in memory? Is it another byte so each word is six bytes really? Thanks.
Carlitos_30
  • 371
  • 4
  • 13
1
vote
2 answers

Donald Knuth algorithm for Mastermind - can we do better?

I implemented Donald Knuth 1977 algorithm for Mastermind https://www.cs.uni.edu/~wallingf/teaching/cs3530/resources/knuth-mastermind.pdf I was able to reproduce his results - 5 guess to win in the worst case and 4.476 on average. And then I tried…
Tomer
  • 1,159
  • 7
  • 15
1
vote
1 answer

Knuth List Insertion Method in C

I've been reading through the sorting and searching algorithms in Volume 3 of The Art of Computer Programming by Donald Knuth, Second Edition. I came across an algorithm which Knuth calls "list insertion" (A modification on traditional insertion…
BlaqICE
  • 309
  • 2
  • 11
1
vote
0 answers

Input and output restricted deque

How to prove that the number of permutations of an increasing sequence using an input restricted deque is equal to number of permutations using output restricted deque? In Knuth's 'The Art of Computer Programming' it is given that there is one to…
1
vote
1 answer

ctwill - mini indexes for cweb

where can i download ctwill? The ftp.cs.stanford.edu/pub/ctwill/ site doesn't work for me, either is ftp://labrea.stanford.edu/pub/ctwill/. Thanks, Raoul
Raoul
  • 11
  • 1
1
vote
1 answer

Knuth Hash for byte[]

Can I use the Knuth Hash to generate a unique hash number for a byte[]? The normal Knuth Hash algorithm looks like this: int KnuthHsh(int v) { v *= 2654435761; return v >> 32; } Is there also a way to input a byte[] and generate a unique…
Dark Side
  • 695
  • 2
  • 8
  • 18
1
vote
0 answers

Is singleton a algorithm and is it covered in knuth's

I owned a copy of Game Programming Gems a while ago and used Singletons in an application. I wanted to know if Singletons are considered an algorithm and if not what are they?. Secondly, I am going to most likely purchase Knuth's algorithm book and…
eidetmp
  • 41
  • 8
1
vote
1 answer

An explanation of terms for D.Knuth's dancing links algorithm

I have downloaded from D.Knuth's website the DLX algorithm. In the first section in which D.Knuth gives an overview of the problem, separates the columns to "primary" and other columns. Which are these "primary" columns? Thanks in advance.
Dragno
  • 3,027
  • 1
  • 27
  • 41