• Ei tuloksia

Latex exercises on writing algorithms

N/A
N/A
Info
Lataa
Protected

Academic year: 2022

Jaa "Latex exercises on writing algorithms"

Copied!
2
0
0

Kokoteksti

(1)

Latex exercises on writing algorithms

1 Exercise 1

Write Algorithm 1! Test how to refer to it in the text (like here).

Alg. 1 PartitioningClustering(S, n, k)

Input: Data set S,n =|S|, number of clusters k Output: Centroids c1, ..., ck

1 begin

2 Select randomly k data pointsp1, ..., pk ∈S

3 for allpi // Initialization

4 begin

5 ci =pi

6 Ci ={pi}

7 end

8 while (not converged) // Update clusters

9 begin

10 for all pi ∈S

11 begin

12 Search cj such that d(pi, cj) is minimal

13 Cj =Cj ∪ {pi}

14 end

15 Update centroids ci

16 end

17 end

2 Exercise 2

Test how to write the following kind of method using an itemize list!

1

(2)

Step 1 x=x+ 1 Step 2 y=x2+ 1

Step 3 If y≤n return to Step 1.

2.1 Exercise 3

Write an algorithm or a method to your paper!

2

Viittaukset

LIITTYVÄT TIEDOSTOT

The goal is to make the Weighted Majority algorithm a bit more concrete and prepare for later exercises with other online

Explain and bring some examples on each type of evidence that have been considered.. Suppose two experts are consulted regarding a

Use basiclatex.tex as you example, and write your own latex file where you solve the following tasks.. You can copy

• Line numbers are useful, if you refer to certain lines in your code. Begin each code line

Search at least two useful articles in ACM or IEEE digital libraries related to your topic!. These libraries can be found in Finelib,

• You can start xfig from shell by command xfig (when the file doesn’t have any name) or you can already give it a name by command xfig example.fig.. If you didn’t give any file name

WRITING EQUATIONS AND SPECIAL SYMBOLS BY LATEX 97 Table 6.1: Useful mathematical symbols: arrows. → An arrow to

(Note that you are actually editing the Sound object in the Object list within Praat. The original sound file will not change on disk, unless you explicitly save the edited sound