text:
Talk:Data Structures/Asymptotic Notation

Q. This subject is pretty well introduced, but why is it in the data structures section? Nowhere in the chapter are data structures even mentioned--I can see how a reader could get confused about how it relates to the book itself.

A. Big O is not only used to represent time upper bounds, but also space upper bounds.—Kinkydarkbird (talk) 09:43, 5 January 2009 (UTC)

Q. Under - The Big O Notation, Theory Example, Paragraph two - is stated "It could then be said that f(n) runs in O(n^2) time". Shouldn't it be O(n)?

 * There are multiple upper bounds. O(n) could do but O(n^2) is used because that is what g is in this example.81.187.215.34 (discuss) 20:32, 2 July 2016 (UTC)

 * Actually, saying f(n) is faster than g(n) is nonsense. Functions don't have speeds, algorithms do. This page mixes up functions and algorithms throughout. Asymptotic notation is used to describe functions not algorithms. Functions can then describe properties of algorithms such as speed, space etc. 81.187.215.34 (discuss) 20:36, 2 July 2016 (UTC)


text:
Talk:Tagalog/Lesson 2

Iyán and Iyón
I encountered some mistakes in the explanation about the difference between iyán and iyón. Iyán is really used when the person or object being referenced is far from the speaker but near the listener. Iyón is used when the said person or object is far from both the speaker and the listener. See also the Tagalog tutorial in the Seasite page. I'm going to make some corrections in this article. -- Perryv 17:10, 17 July 2006 (UTC)

From what littleI know of the language I find it hard to believe the translations are accurate: isn't makilala, for example, correctly here used only when refering to a male? The dialog uses it for a male, but the translation is not that specific.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Talk:Tagalog/Lesson 2


text:
Control Systems/MATLAB

MATLAB
MATLAB is a programming language that is specially designed for the manipulation of matrices. Because of its computational power, MATLAB is a tool of choice for many control engineers to design and simulate control systems. This page is going to discuss using MATLAB for control systems design and analysis. MATLAB has a number of plugin modules called "Toolboxes". Nearly all the functions described below are located in the control systems toolbox. If your system has the control systems toolbox installed, you can get more information about the toolbox by typing  at the MATLAB prompt.

Also, there is an open-source competitor to MATLAB called Octave. Octave is similar to MATLAB, but there are also some differences. This page will focus on MATLAB, but another page could be added to focus on Octave. As of Sept 10th, 2006, all the MATLAB commands listed below have been implemented in GNU octave.

This page will use the MATLAB CMD template to show MATLAB functions that can be used to perform different tasks.

Input-Output Isolation
In a MIMO system, typically it can be important to isolate a single input-output pair for analysis. Each input corresponds to a single row in the B matrix, and each output corresponds to a single column in the C matrix. For instance, to isolate the 2nd input and the 3rd output, we can create a system:

sys = ss(A, B(:,2), C(3,:), D);

This page will refer to this technique as "input-output isolation".

Step Response
First, let's take a look at the classical approach, with the following system:

 * $$G(s) = \frac{5s + 10}{s^2 + 4s + 5}$$

This system can effectively be modeled as two vectors of coefficients, NUM and DEN:

NUM = [5, 10] DEN = [1, 4, 5]

Now, we can use the MATLAB step command to produce the step response to this system:

step(NUM, DEN, t);

Where t is a time vector. If no results on the left-hand side are supplied by you, the step function will automatically produce a graphical plot of the step response. If, however, you use the following format:

[y, x, t] = step(NUM, DEN, t);

Then MATLAB will not produce a plot automatically, and you will have to produce one yourself.

Here is a sample screenshot:

Now, let's look at the modern, state-space approach. If we have the matrices A, B, C and D, we can plug these into the step function, as shown:

step(A, B, C, D);

or, we can optionally include a vector for time, t:

step(A, B, C, D, t);

Again, if we supply results on the left-hand side of the equation, MATLAB will not automatically produce a plot for us.

If we didn't get an automatic plot, and we want to produce our own, we type:

[y, x, t] = step(NUM, DEN, t);

And then we can create a graph using the plot command:

plot(t, y);

y is the output magnitude of the step response, while x is the internal state of the system from the state-space equations:

 * $$x' = Ax + Bu$$

 * $$y = Cx + Du$$

Classical ↔ Modern
MATLAB contains features that can be used to automatically convert to the state-space representation from the Laplace representation. This function, tf2ss, is used as follows:

[A, B, C, D] = tf2ss(NUM, DEN);

Where NUM and DEN are the coefficient vectors of the numerator and denominator of the transfer function, respectively.

In a similar vein, we can convert from the Laplace domain back to the state-space representation using the ss2tf function, as such:

[NUM, DEN] = ss2tf(A, B, C, D);

Or, if we have more than one input in a vector u, we can write it as follows:

[NUM, DEN] = ss2tf(A, B, C, D, u);

The u parameter must be provided when our system has more than one input, but it does not need to be provided if we have only 1 input. This form of the equation produces a transfer function for each separate input. NUM and DEN become 2-D matricies, with each row being the coefficients for each different input.

z-Domain Digital Filters
Let us now consider a digital system with the following generic transfer function in the Z domain:

 * $$H(z) = \frac{n(z)}{d(z)}$$

Where n(z) and d(z) are the numerator and denominator polynomials of the transfer function, respectively. The filter command can be used to apply an input vector x to the filter. The output, y, can be obtained from the following code:

y = filter(n, d, x);

The word "filter" may be a bit of a misnomer in this case, but the fact remains that this is the method to apply an input to a digital system. Once we have the output magnitude vector, we can plot it using our plot command:

plot(y);

To get the step response of the digital system, we must first create a step function using the ones command:

u = ones(1, N);

Where N is the number of samples that we want to take in our digital system (not to be confused with "n", our numerator coefficient). Once we have produced our unit step function, we can pass this function through our digital filter as such:

y = filter(n, d, u);

And we can plot y:

plot(y);

State-Space Digital Filters
Likewise, we can analyze a digital system in the state-space representation. If we have the following digital state relationship:

 * $$x[k + 1] = Ax[k] + Bu[k]$$

 * $$y[k] = Cx[k] + Du[k]$$

We can convert automatically to the pulse response using the ss2tf function, that we used above:

[NUM, DEN] = ss2tf(A, B, C, D);

Then, we can filter it with our prepared unit-step sequence vector, u:

y = filter(num, den, u)

this will give us the step response of the digital system in the state-space representation.

Root Locus Plots
MATLAB supplies a useful, automatic tool for generating the root-locus graph from a transfer function: the rlocus command. In the transfer function domain, or the state space domain respectively, we have the following uses of the function:

rlocus(num, den);

And:

rlocus(A, B, C, D);

These functions will automatically produce root-locus graphs of the system. However, if we provide left-hand parameters:

[r, K] = rlocus(num, den);

Or:

[r, K] = rlocus(A, B, C, D);

The function won't produce a graph automatically, and you will need to produce one yourself. There is also an optional additional parameter for gain, K, that can be supplied:

rlocus(num, den, K);

Or:

rlocus(A, B, C, D, K);

If K is not supplied, MATLAB will supply an automatic gain value for you.

Once we have our values [r, K], we can plot a root locus:

plot(r);

The rlocus command cannot be used with MIMO systems, so if your system is a MIMO system, you must separate out your coefficient matrices to isolate each separate Input-output pair, and graph each individually.

Here is a sample screenshot:

Digital Root-Locus
Creating a root-locus diagram for a digital system is exactly the same as it is for a continuous system. The only difference is the interpretation of the results, because the stability region for digital systems is different from the stability region for continuous systems. The same rlocus function can be used, in the same manner as is used above.

Bode Plots
MATLAB also offers a number of tools for examining the frequency response characteristics of a system, both using Bode plots, and using Nyquist charts. To construct a Bode plot from a transfer function, we use the following command:

[mag, phase, omega] = bode(NUM, DEN, omega);

Or:

[mag, phase, omega] = bode(A, B, C, D, u, omega);

Where "omega" is the frequency vector where the magnitude and phase response points are analyzed. If we want to convert the magnitude data into decibels, we can use the following conversion:

magdb = 20 * log10(mag);

This conversion should be known well enough by now that it doesn't require explanation.

When talking about Bode plots in decibels, it makes the most sense (and is the most common occurrence) to also use a logarithmic frequency scale. To create such a logarithmic sequence in omega, we use the logspace command, as such:

omega = logspace(a, b, n);

This command produces n points, spaced logarithmicly, from $$10^a$$ up to $$10^b$$.

If we use the bode command without left-hand arguments, MATLAB will produce a graph of the bode phase and magnitude plots automatically.

The bode command, if used with a MIMO system, will use subplots to produce all the input-output relationship graphs on a single plot window. for a system with multiple inputs and multiple outputs, this can become difficult to see clearly. In these cases, it is typically better to separate out your coefficient matrices to isolate each individual input-output pair.

Here is a sample screenshot:

Nyquist Plots
In addition to the bode plots, we can create nyquist charts by using the nyquist command. The nyquist command operates in a similar manner to the bode command (and other commands that we have used so far):

[real, imag, omega] = nyquist(NUM, DEN, omega);

Or: [real, imag, omega] = nyquist(A, B, C, D, u, omega);

Here, "real" and "imag" are vectors that contain the real and imaginary parts of each point of the nyquist diagram. If we don't supply the right-hand arguments, the nyquist command automatically produces a nyquist plot for us.

Like the bode command, the nyquist command will use subplots to display the input-output relations of MIMO systems on a single plot window. If there are multiple input-output pairs, it can be difficult to see the individual graphs.

Here is a sample screenshot:

Controllability
A controllability matrix can be constructed using the ctrb command. The controllability gramian can be constructed using the gram command.

Observability
An observability matrix can be constructed using the command obsv

Empirical Gramians
Empirical gramians can be computed for linear and also nonlinear control systems. The empirical gramian framework emgr allows the computation of the controllability, observability and cross gramian; it is compatible with MATLAB and OCTAVE and does not require the control systems toolbox.

title: Control Systems/MATLAB


text:
Haskell/Algorithm complexity

Complexity Theory is the study of how long a program will take to run, depending on the size of its input. There are many good introductory books to complexity theory and the basics are explained in any good algorithms book. I'll keep the discussion here to a minimum.

The idea is to say how well a program scales with more data. If you have a program that runs quickly on very small amounts of data but chokes on huge amounts of data, it's not very useful (unless you know you'll only be working with small amounts of data, of course). Consider the following Haskell function to return the sum of the elements in a list:

sum [] = 0 sum (x:xs) = x + sum xs How long does it take this function to complete? That's a very difficult question; it would depend on all sorts of things: your processor speed, your amount of memory, the exact way in which the addition is carried out, the length of the list, how many other programs are running on your computer, and so on. This is far too much to deal with, so we need to invent a simpler model. The model we use is sort of an arbitrary "machine step." So the question is "how many machine steps will it take for this program to complete?" In this case, it only depends on the length of the input list.

If the input list is of length $$0$$, the function will take either $$0$$ or $$1$$ or $$2$$ or some very small number of machine steps, depending exactly on how you count them (perhaps $$1$$ step to do the pattern matching and $$1$$ more to return the value $$0$$). What if the list is of length $$1$$? Well, it would take however much time the list of length $$0$$ would take, plus a few more steps for doing the first (and only element).

If the input list is of length $$n$$, it will take however many steps an empty list would take (call this value $$y$$) and then, for each element it would take a certain number of steps to do the addition and the recursive call (call this number $$x$$). Then, the total time this function will take is $$nx+y$$ since it needs to do those additions $$n$$ many times. These $$x$$ and $$y$$ values are called constant values, since they are independent of $$n$$, and actually dependent only on exactly how we define a machine step, so we really don't want to consider them all that important. Therefore, we say that the complexity of this  function is $$\mathcal{O}(n)$$ (read "order $$n$$"). Basically saying something is $$\mathcal{O}(n)$$ means that for some constant factors $$x$$ and $$y$$, the function takes $$nx+y$$ machine steps to complete.

Consider the following sorting algorithm for lists (commonly called "insertion sort"):

sort [] = [] sort [x] = [x] sort (x:xs) = insert (sort xs) where insert [] = [x] insert (y:ys) | x <= y   = x : y : ys                        | otherwise = y : insert ys The way this algorithm works is as follows: if we want to sort an empty list or a list of just one element, we return them as they are, as they are already sorted. Otherwise, we have a list of the form . In this case, we sort   and then want to insert in the appropriate location. That's what the function does. It traverses the now-sorted tail and inserts wherever it naturally fits.

Let's analyze how long this function takes to complete. Suppose it takes $$f(n)$$ stepts to sort a list of length $$n$$. Then, in order to sort a list of $$n$$-many elements, we first have to sort the tail of the list first, which takes $$f(n-1)$$ time. Then, we have to insert into this new list. If  has to go at the end, this will take $$\mathcal{O}(n-1)=\mathcal{O}(n)$$ steps. Putting all of this together, we see that we have to do $$\mathcal{O}(n)$$ amount of work $$\mathcal{O}(n)$$ many times, which means that the entire complexity of this sorting algorithm is $$\mathcal{O}(n^2)$$. Here, the squared is not a constant value, so we cannot throw it out.

What does this mean? Simply that for really long lists, the function won't take very long, but that the  function will take quite some time. Of course there are algorithms that run much more slowly than simply $$\mathcal{O}(n^2)$$ and there are ones that run more quickly than $$\mathcal{O}(n)$$. (Also note that a $$\mathcal{O}(n^2)$$ algorithm may actually be much faster than a $$\mathcal{O}(n)$$ algorithm in practice, if it takes much less time to perform a single step of the $$\mathcal{O}(n^2)$$ algorithm.)

Consider the random access functions for lists and arrays. In the worst case, accessing an arbitrary element in a list of length $$n$$ will take $$\mathcal{O}(n)$$ time (think about accessing the last element). However with arrays, you can access any element immediately, which is said to be in constant time, or $$\mathcal{O}(1)$$, which is basically as fast an any algorithm can go.

There's much more in complexity theory than this, but this should be enough to allow you to understand all the discussions in this tutorial. Just keep in mind that $$\mathcal{O}(1)$$ is faster than $$\mathcal{O}(n)$$ is faster than $$\mathcal{O}(n^2)$$, etc.

title: Haskell/Algorithm complexity


text:
Talk:Basic Algebra

Welcome Teachers!
We live in very exciting times. Many math teachers have wished that they could make changes to, or contribute to, the math book they use. A project like this makes that possible, with the added benefit of providing our expert help to people in need across the world. How cool is that!?!--HSTutorials 16:18, 20 July 2006 (UTC)

California Mathematics Council Teachers - I really enjoyed meeting you all at CMC South in Palm Springs, and look forward to seeing others of you at CMC North in Asilomar in December. Happy Contributing!--HSTutorials 04:35, 6 November 2007 (UTC)

Moving this Wikibook to The Simple English Wikibooks Project
I am proposing to move this whole Wikibook to the Simple English Wikibooks project. This is not an inditment of the content here, but instead a way to showcase this content and allow other contributors who want to work with Simple English content to keep it all together.

BTW, I'm even willing to do the actual page moves and get everything moved over, and I also see no problem with a "bookshelf" here on the regular English Wikibooks to have links to the Simple English content. This is mainly a proposal to move this content so we don't have mixed efforts, and to recognize that there already is an independent Simple English Wikibooks project. If there is an objection to doing this, I would like to see a reasonable argument for keeping it with en.wikibooks other than exposure to more readers and contributors. --Rob Horning 18:27, 17 July 2006 (UTC)

I have to trust other people's judgement on this issue. I'm hoping that the main contributors will be my fellow math teachers, and starting this fall I'm planning to present at as many math teaching forums as I can to show my fellow teachers how to contribute to the wiki. It seems to me that the input of people focused on writing in simple English would be much more valuable to us than people who are focused on writing about mathematics, since math is already our forté.

I do want to keep the name as OLPC - Algebra 1 in Simple English because the One Laptop Per Child Project would be why these teachers would be willing to contribute to the book. --HSTutorials 20:43, 17 July 2006 (UTC)
 * As has been pointed out by some Simple English proponents, this is an internationally recognized "subset" of the English language and by using the term "Simple English", you are putting some specific implications into the name of this book. Is this what you intended when creating this book, or were you simply trying to make a textbook that would use basic English grammar?  I know that even among users of Simple English (as a dialect of English) there can be considerable room for discussion over what that really means, but I mainly wanted you to be aware of the fact that Simple English Wikibooks does exist.
 * As far as keeping the name OLPC, is this going to be an "official" sub-project of the One Laptop Per Child Project?  There isn't anything specifically wrong about that provided you also maintain Wikibooks policies and standards like NPOV principles and allow non-OLPC participants to make changes to the content.  If this hasn't been sanctioned by the OLPC, I would be wary about implying an endorsement from that group when it hasn't been given.  Throwing the name "OLPC" into the title would be an inappropriate use of a trademark if the OLPC folks havn't given explicit permission to use their trademark in this manner.  --Rob Horning 11:44, 19 July 2006 (UTC)

This project is in cooperation with OLPC. Please read http://wiki.laptop.org/go/Electronic_textbook_projects for more information.--HSTutorials 15:57, 20 July 2006 (UTC)

 * Fantastic! - this is exactly what I was trying to see, and I'm not trying to discourage this. I've just seen some individuals acting as though they had permission for similar things. I have, however, seen some other groups do this, so I was trying to give you the benefit of the doubt.  --Rob Horning 04:39, 21 July 2006 (UTC)

I think you're right; this should part of the Simple English Wikibooks Project. I don't know how to move it, though. Can someone give me some guidance, or move it for me? I also need to know if links I've created outside wiki will still work, or do I have to change them to the new address? Thanks,--HSTutorials 03:52, 21 July 2006 (UTC)'''

 * I'll try to help you out on this one. Give me about 48 hours, and I'll get the whole thing moved over to the Simple English Wikibooks.  --Rob Horning 04:39, 21 July 2006 (UTC)

Thanks for your help, Rob.--HSTutorials 18:56, 21 July 2006 (UTC)

Turn Chapter 1, Lesson 1 into an introduction?
As it is written now, Chapter 1, Lesson 1 is less of a lesson than an introduction to the Algebra 1 in Simple English project. It does not conform to the layout used in other lessons of the wikibook. Since it is not really a lesson so much as an introduction, maybe we should move its text into a seperate introduction page, and then shift all of the lessons in Chapter 1 up one lesson number? What are your thoughts?

You're absolutely right that it's not really a lesson. I'm going to do just that! Thanks.--HSTutorials 21:49, 2 August 2006 (UTC)

I forgot my login name and cant log in to delete this, but I would like it to be removed so I had to do it myself. Thanks.

Excessive
This thing goes into LINEAR ALGEBRA topics in chapter 7. Calling it a high school textbook is nuts, some of this material is 200-level college. Still, it's nice to have all the information rolled together coherently.

Solving simple systems of equations through linear combinations really is high school level. A 200 level college class in linear algebra covers MUCH more detail, and covers matricies.

If you look through most high school textbooks you'll find sections on linear combinations. It is covered in both Algebra textbooks that I use in my classroom. Your teacher may have had to skip that due to time constraints, but it supposed to be there. One of the terrific things about this teaching situation is that we do not have to worry about time constraints at all, and we can simply make sure that the course covers everything that is considered Algebra 1. --HSTutorials 04:54, 11 November 2006 (UTC)

Practice problems
Rather than having the answer in parentheses immediately after the problem, why not have the answers on a seperate page with a 'Click here to see answers' link under the list of questions? --82.47.199.13 16:20, 23 November 2006 (UTC)

Your idea would be a really good one if this was the final destination of this wikibook. However, the content in this wiki-textbook is going to be turned into a completely interactive tutorial website. It is easier for the math teachers who are contributing to this project to have the answers to the problems immediately following, because it allows us to make sure that the problems are progressing with the correct levels of difficulty.--HSTutorials 05:10, 2 December 2006 (UTC)

Welcome CMC North participants
It was wonderful to meet you all. Be sure to create an account, log in every time you contribute, and sign any discussion contributions you make.

Basic English or Simple English?
Hi all, I just came across this project and am eager to get involved. I made some aggressive edits to the first couple pages using Ogden's Basic English. I noticed that what has been written so far hasn't stayed close to 850 word list. Personally I feel the fewer words the better. I am curious as to what direction people think this book should take. Should the language be in the style of the Simple English Wikipedia, or should it be more limited?--Ezrakatz 02:11, 26 December 2006 (UTC)

I agree with you; the fewer words, the better. Please keep up the aggressive editing! There have been many entries from people who don't understand the Basic English/Simple English concept. I have put in a request to have this moved to the Simple English Wikibooks, but that hasn't happened yet.--HSTutorials 15:59, 28 January 2007 (UTC)

Move to delete "Using Matricies to Solve Linear Systems"
Hi, I have started a vote for deletion of the page Using Matricies to Solve Linear Systems for the reasons I have mentioned on the Votes for deletion page.

Also, I didn´t want to make a separate topic for this, how are we supposed to put questions for the tests if the questions are formatted like

"Evaluate the following expressions if a=4, b=3, c=2?" Do we have to put this in each question or can we put them under a general heading.

I look forward to working on this great project. Thylacine222 04:46, 6 January 2007 (UTC)

 * I've closed the VfD discussion, and instead marked the page as a speedy deletion barring discussion here. I dont think that page belongs in this book, and so it should be deleted. --Whiteknight (talk) (projects) 20:48, 8 January 2007 (UTC)

I don't want matricies to be a distraction. They are included in some algebra textbooks (including mine as a 9th grader in Texas in the 70's), but not in others. Let's do whatever will keep our attention focused on creating content for our students. If that means we drop matricies, fine.--HSTutorials 16:03, 28 January 2007 (UTC)

Pre-Algebra Text
I have been having trouble getting a good start on writing this text because of all the backtracking needed to explain Pre-Algebra terms and ideas. I don't want to detract from this project, but in order for it to succeed I feel it is necessary to create a Pre-Algebra text that sets up the vocabulary needed for a non-native speaker to understand Algebra. This way the text can start with variables, expressions, and equations and not be bogged down by review.

Here is a link to the new project Numbers. I give more details about the idea for the book there. --Ezrakatz 20:09, 25 February 2007 (UTC)

Moving Again
I've been talking with an admin over at Simple English Wikibooks and he is prepared to move this book. SE Wikibooks is a more appropriate venue for this book. Any comments are welcome. --Ezra Katz 00:37, 5 July 2007 (UTC)

 * If they can talk with the Wikimedia developer team to get the page import feature going on the Simple English Wikibooks, I don't see any other problems. You have to explicitly note what projects you want the ability to import pages from.  I agree this belongs on the Simple English Wikibooks as well.  As soon as the move is complete, please mark at least this main page of this Wikibook with delete to let the admins on en.wikibooks know that it is safe for us to delete the content without losing any of the edit history.  --Rob Horning 04:55, 5 July 2007 (UTC)

Moving and simple English
I am the admin that Ezra Katz talked to, and I will be performing the move. Sorry I didn't get things rolling earlier when it was first decided, but I didn't know how it worked and I was under the impression that someone else was going to do it. I'll make sure to put the tag on this module when I've completed the move. Having to move talk pages separately is kind of a pain. It would be nice to at least have the option of automation there.

As far as simple English, I must say that I'm in friendly disagreement with Rob on this one. Yes, some people on SE Wikipedia think it is more or less an "official" subset. I am not one of them. Simple English in my opinion is just a simplified version of English, with significantly reduced vocabulary. There is nothing particularly official about it. We happen to try to follow the BE850 more or less, but if another wordlist seems more or equally useful (like we've discovered on SE Wiktionary), we aren't particularly tied to that one. The term "simple English" has no specific meaning outside of SE wikiprojects as far as I know, and it is only incidentally similar to Basic English. The idea is simply to make a group of projects for people who don't know English well (for whatever reason: non-native speaker, learning disabilities, etc.) but who want to use English, not a different language like their native tongue (in the case of non-native speakers). On SEWP, another goal is to create easier articles to ease translations into other languages. We'll be happy to receive help on all the SE projects from anyone interested in those goals, including those who have worked on this book in the past. If someone would like to vote regarding the proposed closure of SEWQ, see here. I personally think we should create an SE Wikisource (which would have simple versions of all the classics for anyone who doesn't know English well), an SE Wikinews (which would provide the news for those who don't know English well), and SE translations on meta, commons, etc. --Cromwellt|talk|contribs 02:24, 11 July 2007 (UTC)
 * I have been putting a delete tag on each page I import. Would it be better to wait and just put the tag on the main page?  The problem I see is that others might edit here after I've imported a page.  What is the general rule?  --Cromwellt|talk|contribs 01:36, 16 August 2007 (UTC)

 * The general rule is to only add the delete template to the main page, but no real discussion or consensus was reached regarding its deletion so it would be better to use and bring it up on WB:VFD for discussion. Just because its been copied elsewhere doesn't mean it has to be deleted from English Wikibooks and people here may object to its deletion. --dark  lama  17:08, 17 August 2007 (UTC)
 * Actually, there has been discussion on this very page, and no one objected to the move at all. It actually belongs on the other project, though this project may have a link if that's what they decide.  Either way, I'll quit putting delete templates on each page and just wait until I've imported it all to put a delete template on the main page.  I just hope that no good-faith edits are made here after I've imported because those will be lost.  Oh well.  --Cromwellt|talk|contribs 17:15, 17 August 2007 (UTC)
 * I see a discussion to move this to simple english did take place on this page, but thats different from deleting it. One administrator has already voiced objection to its deletion on WB:AN. There have been cases where books have forked from the majority of current contributors deciding to continue the book elsewhere, but where the book continued to remain here to be developed by those who disagreed with the move. Its perfectly fine for both to co-exist. --dark lama  17:55, 17 August 2007 (UTC)

Import
For those who care, the import to SEWB is complete. As one might expect, I recommend that people who want to work on simple English projects like this one should work on them there. --Cromwellt|talk|contribs 18:55, 5 September 2007 (UTC)

Printable chapter versions???
Hello Wikibookians! I was wondering if there is a printable by chapters version of this textbook anywhere as its a lot of fuss to print each little subsection at a time? is this possible? (librarianofages on EN wikipedia)-- 203.143.210.49 (talk) 01:40, 2 January 2008 (UTC)

* to ×
I recommand that the sign of multiplay should be changed from * to ×. The reason that I recommanded this is because readers may get confused by the sign of * and ×. The sign of division should also be changed from / to ÷.

title: Talk:Basic Algebra


text:
Haskell/Mutable objects

Functional purity is a defining characteristic of Haskell, one which leads to many of its strengths. As such, language and ecosystem encourage eschewing mutable state altogether. Thanks to tools such as the  monad, which allows us to keep track of state in a convenient and functionally pure way, and efficient immutable data structures like the ones provided by the   and   packages, Haskell programmers can get by perfectly fine with complete immutability in the vast majority of situations. However, under select circumstances using mutable state is just the most sensible option. One might, for instance, be interested in:

 * From Haskell code, using a library written in another language which assumes mutable state everywhere. This situation often arises with event-callback GUI toolkits.

 * Using Haskell to implement a language that provides imperative-style mutable variables.

 * Implementing algorithms that inherently require destructive updates to variables.

 * Dealing with volumes of bulk data massive enough to justify squeezing every drop of computational power available to make the problem at hand feasible.

Any general-purpose programming language worth its salt should be able to deal with such tasks. With Haskell, it is no different: there are not only ways to create mutable objects, but also to keep mutability under control, existing peacefully in a setting where immutability is the default.

s
Let's begin with the simplest of those use cases above. A common way of structuring code for user interfaces is through the event-and-callback model. The event might be a button click or a key press, while the callback is just a piece of code meant to be called in response to the event. The client code (that is, your code, if you are using such a library) should set up the wiring that connects interface elements, events involving them, and the corresponding callbacks. A hypothetical function to arrange a callback might have the following type:

The  argument is the callback, while the result of   is an   action which sets up the wiring. Running  would lead to "Hello" being printed on the console following every click on.

Both  − with pervasive   and lacking useful return values − and our exposition above have a marked imperative feel. That's because our hypothetical GUI library was written using a more imperative style in a wholly different language. Some good soul has written a facade so that we can use it from Haskell, but the facade is a very thin one, and so the style of the original library leaks into our code.

Using  to perform   actions such as printing to the console or showing dialog boxes is easy enough. However, what if we want to add 1 to a counter every time a button is clicked? The type of  doesn't reveal any way to pass information to the callback, nor to get information back from it (the return types are  ). doesn't help: even if there was a way to pass an initial state to the callback, run a  computation within it, what would we do with the results? We would need to pass the resulting state of the counter to the callback on the next time the button is clicked, and we would have no idea when that would happen, nor a place to keep the value in the meantime.

The obvious solution to this issue in many languages would be creating a mutable variable outside of the callback and then giving the callback a reference to it, so that its code can change the value of the variable at will. We need not worry, though, as Haskell allows us to do exactly that. In fact, there are several types of mutable variables available, the simplest of which is the. s are very simple; they are just boxes containing mutable values. We can create one as follows:

takes a value and gives back, as the result of an  action, an   initialised to that value. We can then use  to retrieve the value in it...

... and  and   to change it:

An  would be enough for implementing the counter, given that it would persist between button clicks. The code might look like this:

Note there is no point in using s indiscriminately, without a good reason for it. Beyond the more fundamental concerns with mutable state, it just would not be very convenient to do so with all those explicit read/write/modify calls, not to mention the need to introduce  in extra places to handle the   (in our hypothetical example that wouldn't be much of an issue, as the GUI code would have to live in   anyway, and we presumably would keep it apart from the pure functions forming the core of our program, as good Haskell practice dictates). Still, s are there for when you can't avoid them.

The pitfalls of concurrency
There is another very important use case for mutable variables that we didn't mention in the introduction: concurrency, that is, circumstances when simultaneous computations are being executed by the computer. Concurrency scenarios range from the simple (a progress bar displaying the status of a background task) to the extremely complex (server-side software handling thousands of requests at once). Given that in principle nothing guarantees that simultaneous computations will run in step with each other, any communication between them calls for mutable variables. That, however, introduces a complication: the issues with understandability and predictability of code using mutable state become much more serious in the presence of independent computations with unpredictable timings. For instance, computation A might need the result of computation B, but it might ask for that result earlier than predicted and thus acquire a bogus result. Writing correct concurrent code can be difficult, and subtle bugs are easy to introduce unless adequate measures are taken.

The only functions in that provide extra safety in concurrent code are ,   and  , which are only of any help in very simple situations in which there is just one   meant to be used as a shared resource between computations. Concurrent Haskell code should take advantage of more sophisticated tools tailored for concurrency, such as s (mutable variables that a computation can make unavailable to the others for as long as necessary − see ) and  from the   package (an implementation of software transactional memory, a concurrency model which makes it possible to write safe concurrent code while avoiding the ugliness and complications of having to explicitly manage the availability of all shared variables).

The monad
In the  example above, mutability was imposed upon our code by external demands. However, in the two final scenarios suggested by the introduction (algorithms that require mutability and extreme computational demands) the need for mutable state is internal − that is, it is not reflected in any way in the overall results. For instance, sorting a list does not require mutability in any essential way, and so a function that sorts a list and returns a new list should, in principle, be functionally pure even if the sorting algorithm uses destructive updates to swap the position of the elements. In such case, the mutability is just an implementation detail. The standard libraries provide a nifty tool for handling such situations while still ending up with pure functions: the  monad, which can be found in.

looks a lot like, and indeed they are similar in spirit. An  computation is one that uses an internal state to produce results, except that the state is mutable. For that purpose, provides  s. A   is exactly like an , but it lives in the   monad rather than in.

There is one major difference that sets apart  from both   and. offers a  function with the following type:

At first, that is a shocking type signature. If  involves mutability, how come we can simply extract   values from the monad? The answer lies in the  part of the type. Having a  enclosed within the type of an argument amounts to telling the type checker "  could be anything. Don't make any assumptions about it". Not making any assumptions, however, means that  cannot be matched with anything else − even with the   from another invocation of   :

The overall effect of this type trickery is to insulate the internal state and mutability within each  computation, so that from the point of view of anything else in the program   is a pure function.

As a trivial example of  in action, here is a very imperative-looking version of   for lists :

For all intents and purposes,  is no less pure than the familiar. The fact that it destructively updates its accumulator  is a mere implementation detail, and there is no way information about   could leak other than through the final result. Looking at a simple example like this one makes it clear that the  type variable in   does not correspond to anything in particular within the computation − it is just an artificial marker. Another detail worth noting is that even though  folds the list from the right the sums are done from the left, as the mutations are performed as applicative effects sequenced from left to right.

Mutable data structures
Mutable data structures can be found in the libraries for the exceptional use cases for which they prove necessary. For instance, mutable arrays (alongside with immutable ones) can be found in the vector package or the array package bundled with GHC. There are also mutable hash tables, such as those from the hashtables package. In all cases mentioned, both  and   versions are provided.

title: Haskell/Mutable objects


text:
Haskell/Advanced type classes

Type classes may seem innocuous, but research on the subject has resulted in several advancements and generalisations which make them a very powerful tool.

Multi-parameter type classes
Multi-parameter type classes are a generalisation of the single parameter type classes, and are supported by some Haskell implementations.

Suppose we wanted to create a 'Collection' type class that could be used with a variety of concrete data types, and supports two operations -- 'insert' for adding elements, and 'member' for testing membership. A first attempt might look like this:

This won't compile, however because the arguments to  must be of type   and   whereas we supply an. The problem is that the 'e' type variable in the Collection operations comes from nowhere -- there is nothing in the type of an instance of Collection that will tell us what the 'e' actually is, so we can never define implementations of these methods. Multi-parameter type classes solve this by allowing us to put 'e' into the type of the class. Here is an example that compiles and can be used:

Functional dependencies
A problem with the above example is that, in this case, we have extra information that the compiler doesn't know, which can lead to false ambiguities and over-generalised function signatures. In this case, we can see intuitively that the type of the collection will always determine the type of the element it contains - so if  is , then   will be. If  is , then   will be. (The reverse is not true: many different collection types can hold the same element type, so knowing the element type was e.g. , would not tell you the collection type).

In order to tell the compiler this information, we add a functional dependency, changing the class declaration to

A functional dependency is a constraint that we can place on type class parameters. Here, the extra  should be read '  uniquely identifies  ', meaning for a given , there will only be one. You can have more than one functional dependency in a class -- for example you could have  in the above case. And you can have more than two parameters in multi-parameter classes.

Matrices and vectors
Suppose you want to implement some code to perform simple linear algebra:

You want these to behave as much like numbers as possible. So you might start by overloading Haskell's Num class:

The problem comes when you want to start multiplying quantities. You really need a multiplication function which overloads to different types:

How do we specify a type class which allows all these possibilities?

We could try this:

That, however, isn't really what we want. As it stands, even a simple expression like this has an ambiguous type unless you supply an additional type declaration on the intermediate expression:

After all, nothing is stopping someone from coming along later and adding another instance:

The problem is that  shouldn't really be a free type variable. When you know the types of the things that you're multiplying, the result type should be determined from that information alone.

You can express this by specifying a functional dependency:

This tells Haskell that  is uniquely determined from   and.

title: Haskell/Advanced type classes


text:
Speech-Language Pathology/Stuttering/Hearing Safety

Temporary Hearing Impairment
Some anti-stuttering devices reduce your ability to hear. An adult may be willing to trade some hearing loss for improved speech. However, a child who is unable to hear his teacher may fall behind in school.

Some anti-stuttering devices occlude or block the ear canal. This reduces or eliminates your hearing in that ear while the device is in your ear.

Some anti-stuttering devices amplify and distort background noise. The device may be usable in a quiet office, but not be usuable in a restaurant or classroom.

Permanent Hearing Damage
Any device that amplifies sound might cause hearing damage. To reduce risk of hearing damage,

Use a device that is effective at low volumes (under 85 dB).

Use a device for part of the day, not all day.

Use a device that doesn't pick up background noise, or don't use a device in noisy environments.

Get your hearing tested before using a device, then get your hearing retested after a few weeks.

Discontinue using a device if you experience ringing in your ears or pain from loud noises (e.g., a siren going by).


text:
User:Leon2323~enwikibooks

I appear on the user lists of the following wikis:

Wikimedia

 * English language Wikipedia • User • Talk • Contribs

 * Simple English language Wikipedia • User • Talk • Contribs

 * Test Wikipedia • User • Talk • Contribs

 * English language Wiktionary • User • Talk • Contribs

 * English language Wikibooks • User • Talk • Contribs

 * English language Wikinews • User • Talk • Contribs

 * English language Wikiquote • User • Talk • Contribs

 * English language Wikisource • User • Talk • Contribs

 * English language Wikispecies • User • Talk • Contribs

 * Meta-Wiki • User • Talk • Contribs

 * Wikimedia Commons • User • Talk • Contribs

Wikia

 * Central Wikia • User • Talk • Contribs

 * Wikia, Inc. • User • Talk • Contribs

 * Scratchpad Wiki Labs • User • Talk • Contribs

 * Uncyclopedia • User • Talk • Contribs

 * Memory Alpha • User • Talk • Contribs

EditThis.info

 * Central Wiki • User • Talk • Contribs

 * computer projects • User • Talk • Contribs

Other

 * Uncyclopedia • User • Talk • Contribs

 * Uncyclopedia • User • Talk • Contribs

title: User:Leon2323~enwikibooks


text:
Piano/Treble Clef and Bass Clef

Music can be written in a variety of ways. Less intricate systems exist which only indicate the basic structure (chord changes) of a song and require the reader to already know the melody or improvise one, while more formal systems allow for carefully indicating each sound to make and also when to be tacit (silent), and the respective durations of each. The vast majority of Western music in the modern era is written using a system of notation where each sound is represented by a symbol called a note which is placed within an arrangement of five parallel lines running horizontally known as a staff, where the lines and spaces between them each correspond to a consecutive pitch (acoustic frequency) in a scale, with lower pitches at the bottom and higher ones at the top. The specific symbol used for each note indicates its duration, and other symbols called rests indicate the lengths of silence between them, if any.

The first symbol on every staff is a symbol called a clef, whose function is to identify one of the lines of the staff as representing a particular note. Pianos, able to play notes ranging over many octaves simultaneously, usually have music written with two staves, each with a different clef. The treble clef, or G clef, is used for the higher sounding notes, usually played with the right hand. The bass clef, or F clef, is used for the lower sounding notes, usually played with the left hand. When the two staves are joined on the left by a brace, they are collectively called a grand staff.

The right hand plays the treble clef the left hand plays the bass clef.

title: Piano/Treble Clef and Bass Clef


text:
User:Geekyaznboy~enwikibooks

I am fluent in: Vietnamese Japanese Korean English

Love Maplestory

Ask me about the rest!

title: User:Geekyaznboy~enwikibooks


text:
Talk:How to use a Motorola DVR/Connections

Could someone please explain what some of these connections are FOR? In particular, why do we have USB and Ethernet jacks on this box? 24.126.51.176Donald Hosek

Some of the boxes were originally designed during the 'convergence' heyday era, and included everything but the kitchen sink. Many newer models have deleted many items, such as video input.

Ir connection
I wish to set up a IR connection so that I can control the top box on my Motorola 3412 with the Comcast supplied remote. There is a concection on the back of the box and the configuration screen says it is active but I have no idea what I need to plug into the IR port to make it work. I really would like to place the top box inside a cabinet and out of sight.

Any help from somewone that knows this stuff would be appreciated.

R

 * The IR port is for an IR Blaster, but there is no software support for it.

34xx no front connections?
The 3416 has a card slot on the front and composite. The 3412 is the model that has no front connections. To say the 34xx has no front connections is overly broad.


text:
Piano/Notes of the Staves

Notes of the Staves
In written music, every line and space represents a note on the staff. The notes on the piano are named using the first seven letters of the alphabet (A through G). You must memorize each letter name to the assigned spot on the staff. However, remember that the bass clef and treble clef have lines and spaces that correspond to different note letters.

Learning to memorize each note will take some time, so you can use a mnemonic to help you. Mnemonics are words or phrases made from the letter names of the lines and spaces, to help you remember.

For the treble or G clef, notes on lines starting at the bottom and moving to top are: (E, G, B, D, F) Mnemonics are Every Good Boy Deserves Football, or Every Girl Buys Designer Fashions, or  Elephants Get Big Dirty Feet. A mnemonic for notes in spaces is FACE. You can even use your hand as a mnemonic: fingers are lines.

For the bass or F clef, for notes on lines: GBDFA - Grizzly Bears Don't Fear Anything, or Good Burritos Don't Fall Apart, and for notes in spaces between the lines, All Cows Eat Grass.

Learn to read bass clef at the same time as treble clef, and try to learn notes without needing to calculate spaces and lines or think about mnemonics. That's simply too slow. Practice is the key. Keep practicing, and you'll learn the notes!

title: Piano/Notes of the Staves


text:
User talk:MarkovV09~enwikibooks

Hi,

I read your PS and just wanted to let you know that a few days ago I started expanding the Hungarian language book: a more bearable front page, some new material, some structural arrangements and some new audio files is all i have done up to now, but I'd need someone who is better at lingusitics than me and I'm sure you are :-) So I'd be glad if you helped me! Tylop - 23:13 CET 17 Jul 2006

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called MarkovV09. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name MarkovV09~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:25, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:14, 19 April 2015 (UTC)

title: User talk:MarkovV09~enwikibooks


text:
Talk:Java Programming/About This Book

Redo "Who Should Read This Book"
Many entry-level programmers, in both high school and college classes, and even independent learners, are starting to choose Java as the language they learn with. At my university (LSU), for example, Java has supplanted C++ as the language majors are taught first. Therefore, I suggest that the book be aimed at both entry-level and more experienced programmers. Darkxxxxillusion 22:07, 17 July 2006 (UTC)

 * Sounds like a good idea to me, but IMO, it should appear as a separate part of the book, because it doesn't interest all readers. Untrots 21:18, 1 April 2007 (UTC)

 * I agree with both of the above, it's not difficult to include some basic programming stuff, so I don't want to alienate those who have never encountered programming before, only assume a certain level of computer expertise (surely they would have that if they wanted to become a programmer).--Mattylaws (talk) 00:19, 8 March 2010 (UTC)

Just did a complete rework of this page - Help needed
This page has been completely reworked to include the most basic and necessary information – such as who the intended readers should be, how readers and authors can participate and finally, how one can get their hands on the latest stable release of the Java platform software from the Oracle website. However, there are portions of text where any help would be greatly appreciated, e.g., installation instructions for Mac OS and Solaris are one of the most significant entries on the to-do list for this book. Thanks for helping out. I hope nobody reads after a year has gone past (or worse, more than that). – Arunreginald (discuss • contribs) 09:10, 26 October 2011 (UTC)

I think that the process of setting up the user's system should have it's own section, the preface should be talking about the book, acknowledgements, it's purpose and paradigms it employs to teaching java.
 * I have moved this part there. Ftiercel (discuss • contribs) 23:27, 21 August 2012 (UTC)

title: Talk:Java Programming/About This Book