Dating Game Description
Matchmaker M is trying to figure out what kind of person P wants to date. So, M
arranges many dates for P. P will report to M how much P likes those dates (score
between -1 and 1, where 1 is good and -1 is very bad). P's criteria f
It is often convenient to generate test data for new applications.
Enumerate n (denoted !n) generates all numbers from 0 through n-1 inclusive.
Draw a bunch of random numbers.
Generate 1000 numbers between 0 and 18 with replacement.
You recall dynamic programming I hope:
Solve small solutions.
Glue them together.
Let's look at the classic: string comparison
some vs. sammy
Draw the matrix. Figure out the rule for going backwards
work back towards the beginning.
Unit 2: Conditionals and String
Like C, K has conditionals.
K also has loops, though programs usually run faster and are shorter if you
avoid using them.
We discuss these features and the adverbs that often render loops unnecessary.
Yves Maison introduced himself as a disaster planner.
He didn't say which city he was planning a disaster (response) for,
but it couldn't have
been one of the old ones of his native France, because the
city was laid out in a grid.
"You see, doct
A* algorithm tutorial
This document contains a description of the AI algorithm known as A*. The
downloads section also has full source code for an easy to use extendable
How to Solve It:
Zvigniew Michalewicz and David Fogel
pp. 64 ff - local search.
Focus on a transformation of the given solution to try to improve it.
Suppose you are doing satisfiability.
Local search says:
make a flip of a variable
No Tipping Game Description
Given a uniform, flat board (made of a titanium alloy) 30 meters long and weighing 3
kilograms, consider it ranging from -15 meters to 15 meters. So the center of gravity
is at 0. We place two supports of equal heights at posit
Mint Problem Description
You are in charge of designing the denominations of coins. In the U.S., the
denominations are penny, nickel, dime, quarter, half dollar, and dollar. Ignore the
dollar coin for now. You have made a study of the subdollar prices and
This file contains basic operations and how to do them in q
I strongly recommend that
you try these one line at a time
Quick Tour of K
Basic arithmetic in K:
Vector style operations:
/ Right to left precedence:
3*2+5 / yields 21
cdf: 15% 3 / division is percent sign
x: 5 3 4 10
/ scalar-vector operations
/ prefix sum
/ element by e
Unit 3: Interprocess Communication
In K, the basic interprocess communication paradigm consists of a client and a
server (though each may take on both roles).
One starts the server with a port number on a well-known machine.
The client can then invoke pro
H (the Hunter) wants to catch P (the prey). P wants to evade H as long as possible.
You will play both roles (i.e. in the competition, once you will be the hunter and once
The game is played on a 500 by 500 square. Both P an
Unit 4: Database System: KDB/KSQL
KDB is a database system implemented on top of the K language environment.
Data structures (e.g. tables) can be interchanged between the two and functions
can be called in both directions.
KDB supports an SQL dialect call