thus spake a.k.tag:www.thusspakeak.com,2013-04-24://1Movable Type 5.2.13Blockade - baron m.tag:www.thusspakeak.com,2018:/baron_m//11.2572018-05-18T19:00:00Z2018-05-18T19:05:18Z
Good heavens Sir R----- you look quite pallid! Come take a seat and let me fetch you a measure of rum to restore your humors.
To further improve your sanguinity might I suggest a small wager?
Splendid fellow!
I have in mind a game invented to commemorate my successfully quashing the Caribbean zombie uprising some few several years ago. Now, as I'm sure you well know, zombies have ever been a persistent, if sporadic, scourge of those islands. On that occasion, however, there arose a formidable leader from amongst their number; the zombie Lord J------ the Insensate.
baron m.
Good heavens Sir R----- you look quite pallid! Come take a seat and let me fetch you a measure of rum to restore your humors.
To further improve your sanguinity might I suggest a small wager?
Splendid fellow!
I have in mind a game invented to commemorate my successfully quashing the Caribbean zombie uprising some few several years ago. Now, as I'm sure you well know, zombies have ever been a persistent, if sporadic, scourge of those islands. On that occasion, however, there arose a formidable leader from amongst their number; the zombie Lord J------ the Insensate.
]]>
A Measure Of Borel Weight - a.k.tag:www.thusspakeak.com,2018:/ak//9.2562018-05-04T19:00:00Z2018-05-04T19:11:06Z
In the last few posts we have implemented a type to represent Borel sets of the real numbers, which are the subsets of them that can be created with countable unions of intervals with closed or open lower and upper bounds. Whilst I would argue that doing so was a worthwhile exercise in its own right, you may be forgiven for wondering what Borel sets are actually for and so in this post I shall try to justify the effort that we have spent on them.
a.k.
In the last few posts we have implemented a type to represent Borel sets of the real numbers, which are the subsets of them that can be created with countable unions of intervals with closed or open lower and upper bounds. Whilst I would argue that doing so was a worthwhile exercise in its own right, you may be forgiven for wondering what Borel sets are actually for and so in this post I shall try to justify the effort that we have spent on them.
]]>
On Quaker's Dozen - studenttag:www.thusspakeak.com,2018:/student//12.2552018-04-20T19:00:00Z2018-05-01T21:42:36Z
The Baron's latest wager set Sir R----- the task of rolling a higher score with two dice than the Baron should with one twelve sided die, giving him a prize of the difference between them should he have done so. Sir R-----'s first roll of the dice would cost him two coins and twelve cents and he could elect to roll them again as many times as he desired for a further cost of one coin and twelve cents each time, after which the Baron would roll his.
The simplest way to reckon the fairness of this wager is to re-frame its terms; to wit, that Sir R----- should pay the Baron one coin to play and thereafter one coin and twelve cents for each roll of his dice, including the first. The consequence of this is that before each roll of the dice Sir R----- could have expected to receive the same bounty, provided that he wrote off any losses that he had made beforehand.
student
The Baron's latest wager set Sir R----- the task of rolling a higher score with two dice than the Baron should with one twelve sided die, giving him a prize of the difference between them should he have done so. Sir R-----'s first roll of the dice would cost him two coins and twelve cents and he could elect to roll them again as many times as he desired for a further cost of one coin and twelve cents each time, after which the Baron would roll his.
The simplest way to reckon the fairness of this wager is to re-frame its terms; to wit, that Sir R----- should pay the Baron one coin to play and thereafter one coin and twelve cents for each roll of his dice, including the first. The consequence of this is that before each roll of the dice Sir R----- could have expected to receive the same bounty, provided that he wrote off any losses that he had made beforehand.
]]>
A Borel Universe - a.k.tag:www.thusspakeak.com,2018:/ak//9.2532018-04-06T19:00:00Z2018-04-06T19:00:55Z
Last time we took a look at Borel sets of real numbers, which are subsets of the real numbers that can be represented as unions of countable sets of intervals Ii. We got as far as implementing the ak.borelInterval type to represent an interval as a pair of ak.borelBound objects holding its lower and upper bounds.
With these in place we're ready to implement a type to represent Borel sets and we shall do exactly that in this post.
a.k.
Last time we took a look at Borel sets of real numbers, which are subsets of the real numbers that can be represented as unions of countable sets of intervals I_{i}. We got as far as implementing the ak.borelInterval type to represent an interval as a pair of ak.borelBound objects holding its lower and upper bounds.
With these in place we're ready to implement a type to represent Borel sets and we shall do exactly that in this post.
]]>
On Natural Analogarithms - studenttag:www.thusspakeak.com,2018:/student//12.2522018-03-16T19:00:00Z2018-03-16T20:02:14Zstudent
Last year my fellow students and I spent a goodly portion of our free time considering the similarities of the relationships between sequences and series and those between derivatives and integrals. During the course of our investigations we deduced a sequence form of the exponential function e^{x}, which stands alone in satisfying the equations
D f = f f(0) = 1
where D is the differential operator, producing the derivative of the function to which it is applied.
This set us to wondering whether or not we might endeavour to find a discrete analogue of its inverse, the natural logarithm ln x, albeit in the sense of being expressed in terms of integers rather than being defined by equations involving sequences and series.
]]>
A Decent Borel Code - a.k.tag:www.thusspakeak.com,2018:/ak//9.2512018-03-02T20:00:00Z2018-03-02T20:10:39Z
A few posts ago we took a look at how we might implement various operations on sets represented as sorted arrays, such as the union, being the set of every element that is in either of two sets, and the intersection, being the set of every element that is in both of them, which we implemented with ak.setUnion and ak.setIntersection respectively.
Such arrays are necessarily both finite and discrete and so cannot represent continuous subsets of the real numbers such as intervals, which contain every real number within a given range. Of particular interest are unions of countable sets of intervals Ii, known as Borel sets, and so it's worth adding a type to the ak library to represent them.
a.k.
A few posts ago we took a look at how we might implement various operations on sets represented as sorted arrays, such as the union, being the set of every element that is in either of two sets, and the intersection, being the set of every element that is in both of them, which we implemented with ak.setUnion and ak.setIntersection respectively.
Such arrays are necessarily both finite and discrete and so cannot represent continuous subsets of the real numbers such as intervals, which contain every real number within a given range. Of particular interest are unions of countable sets of intervals I_{i}, known as Borel sets, and so it's worth adding a type to the ak library to represent them.
]]>
Quaker's Dozen - baron m.tag:www.thusspakeak.com,2018:/baron_m//11.2502018-02-16T20:00:00Z2018-02-16T20:00:04Z
Sir R-----, my fine friend! The coming of spring always puts one in excellent spirits, do you not find? Speaking of which, come join me in a glass of this particularly peaty whiskey with which we might toast her imminent arrival!
Might I tempt you with a little sport to quicken the blood still further?
It lifts my soul to hear it Sir!
I have in mind a game that I learned when in passage to the new world with a company of twelve Quakers. I was not especially relishing the prospect of yet another monotonous transatlantic crossing and so you can imagine my relief when I spied the boisterous party embarking, dressed in the finest silks and satins and singing a bawdy tavern ballad as they took turns at a bottle of what looked like a very fine brandy indeed!
baron m.
Sir R-----, my fine friend! The coming of spring always puts one in excellent spirits, do you not find? Speaking of which, come join me in a glass of this particularly peaty whiskey with which we might toast her imminent arrival!
Might I tempt you with a little sport to quicken the blood still further?
It lifts my soul to hear it Sir!
I have in mind a game that I learned when in passage to the new world with a company of twelve Quakers. I was not especially relishing the prospect of yet another monotonous transatlantic crossing and so you can imagine my relief when I spied the boisterous party embarking, dressed in the finest silks and satins and singing a bawdy tavern ballad as they took turns at a bottle of what looked like a very fine brandy indeed!
]]>
The After Strife - a.k.tag:www.thusspakeak.com,2018:/ak//9.2492018-02-02T20:00:00Z2018-02-02T20:06:36Z
As well as required arithmetic operations, such as addition, subtraction, multiplication and division, the IEEE 754 floating point standard has a number of recommended functions. For example finite determines whether its argument is neither infinite nor NaN and isnan determines whether its argument is NaN; behaviours that shouldn't be particularly surprising since they're more or less equivalent to JavaScript's isFinite and isNaN functions respectively.
One recommended function that JavaScript does not provide, and which I should like to add to the ak library, is nextafter which returns the first representable floating point number after its first argument in the direction towards its second.
a.k.
As well as required arithmetic operations, such as addition, subtraction, multiplication and division, the IEEE 754 floating point standard has a number of recommended functions. For example finite determines whether its argument is neither infinite nor NaN and isnan determines whether its argument is NaN; behaviours that shouldn't be particularly surprising since they're more or less equivalent to JavaScript's isFinite and isNaN functions respectively.
One recommended function that JavaScript does not provide, and which I should like to add to the ak library, is nextafter which returns the first representable floating point number after its first argument in the direction towards its second.
]]>
On Lucky Sevens - studenttag:www.thusspakeak.com,2018:/student//12.2472018-01-19T20:00:00Z2018-01-19T20:19:57Z
The Baron's most recent game consisted of a race to complete a trick of four sevens, with the Baron dealing cards from a pristine deck, running from Ace to King once in each suit, and Sir R----- dealing from a well shuffled deck. As soon as either player held such a trick the game concluded and a prize was taken, eleven coins for the Baron if he should have four sevens and nine for Sir R----- otherwise.
The key to reckoning the equity of the wager is to note that it is unchanged should the Baron and Sir R----- take turns dealing out the rest of their cards one by one after the prize has been taken.
student
The Baron's most recent game consisted of a race to complete a trick of four sevens, with the Baron dealing cards from a pristine deck, running from Ace to King once in each suit, and Sir R----- dealing from a well shuffled deck. As soon as either player held such a trick the game concluded and a prize was taken, eleven coins for the Baron if he should have four sevens and nine for Sir R----- otherwise.
The key to reckoning the equity of the wager is to note that it is unchanged should the Baron and Sir R----- take turns dealing out the rest of their cards one by one after the prize has been taken.
]]>
Let's Talk About Sets - a.k.tag:www.thusspakeak.com,2018:/ak//9.2462018-01-05T20:00:00Z2018-01-05T20:01:47Z
In the last couple of posts we have seen various ways to partially or fully sort data and the kinds of queries that we can run against them once they have been. Such query operations make fully sorted arrays a convenient way to represent sets, or more accurately multisets which treat repeated elements as distinct from each other, and in this post we shall exploit this fact to implement some operations that we might wish to perform upon them.
a.k.
In the last couple of posts we have seen various ways to partially or fully sort data and the kinds of queries that we can run against them once they have been. Such query operations make fully sorted arrays a convenient way to represent sets, or more accurately multisets which treat repeated elements as distinct from each other, and in this post we shall exploit this fact to implement some operations that we might wish to perform upon them.
]]>
Finally On A Calculus Of Differences - studenttag:www.thusspakeak.com,2017:/student//12.2452017-12-15T20:00:00Z2017-12-15T20:00:19Zstudent
My fellow students and I have spent much of our spare time this past year investigating the similarities between the calculus of functions and that of sequences, which we have defined for a sequence s_{n} with the differential operator
Δ s_{n} = s_{n} - s_{n-1}
and the integral operator
n
Δ^{-1}s_{n} =
Σ
s_{i}
i = 1
where Σ is the summation sign, adopting the convention that terms with non-positive indices equate to zero.
We have thus far discovered how to differentiate and integrate monomial sequences, found product and quotient rules for differentiation, a rule of integration by parts and figured solutions to some familiar-looking differential equations, all of which bear a striking resemblance to their counterparts for functions. To conclude our investigation, we decided to try to find an analogue of Taylor's theorem for sequences.
]]>
I Still Haven't Found What I'm Looking For - a.k.tag:www.thusspakeak.com,2017:/ak//9.2442017-12-01T20:00:00Z2017-12-01T20:14:19Z
Last time we took a look at a selection of sorting operations that we can use to sort arrays, or ranges of elements within them. After defining some useful comparison functions satisfying JavaScript's requirement of returning a negative number when the first argument compares smaller than the second, zero when they compare equal and a positive number otherwise, and a function to map negative integers to indices read from the end of arrays in the same way that Array.slice does, we first implemented ak.partition which divides elements into two ranges; those elements that satisfy some given condition followed by those elements that don't. We saw how this could be used to implement the quicksort algorithm but instead defined ak.sort to sort a range of elements using Array.sort, slicing them out beforehand and splicing them back in again afterwards if they didn't represent whole arrays. We did use it, however, to implement ak.nthElement which puts a the correctly sorted element in a given position position within a range, putting before it elements that are no greater and after it elements that are no smaller. Finally, we implemented ak.partialSort which puts every element in a range up to, but not including, a given position into its correctly sorted place with all of the elements from that position onwards comparing no less than the last correctly sorted element.
This time we shall take a look at some of the ways that we can query data after we have manipulated it with these functions.
a.k.
Last time we took a look at a selection of sorting operations that we can use to sort arrays, or ranges of elements within them. After defining some useful comparison functions satisfying JavaScript's requirement of returning a negative number when the first argument compares smaller than the second, zero when they compare equal and a positive number otherwise, and a function to map negative integers to indices read from the end of arrays in the same way that Array.slice does, we first implemented ak.partition which divides elements into two ranges; those elements that satisfy some given condition followed by those elements that don't. We saw how this could be used to implement the quicksort algorithm but instead defined ak.sort to sort a range of elements using Array.sort, slicing them out beforehand and splicing them back in again afterwards if they didn't represent whole arrays. We did use it, however, to implement ak.nthElement which puts a the correctly sorted element in a given position position within a range, putting before it elements that are no greater and after it elements that are no smaller. Finally, we implemented ak.partialSort which puts every element in a range up to, but not including, a given position into its correctly sorted place with all of the elements from that position onwards comparing no less than the last correctly sorted element.
This time we shall take a look at some of the ways that we can query data after we have manipulated it with these functions.
]]>
Lucky Sevens - baron m.tag:www.thusspakeak.com,2017:/baron_m//11.2432017-11-17T20:00:00Z2017-11-17T20:05:29Z
Greetings Sir R-----! This evening's chill wind might be forgiven some of its injurious assault upon me by delivering me some good company as I warm my bones. Come, shed your coat and join me in a glass of this rather delightful mulled cyder!
Might you be interested in a little sport whilst we recover?
Excellent!
This foul zephyr puts me in mind of the infantile conflict between King Oberon and Queen Titania that was in full force during my first visit to the faerie kingdom. I had arrived there quite by accident but fortunately my reputation was sufficient to earn me an invitation to dine at the King's table. That the fare was sumptuous beyond the dreams of mortal man goes without saying, but the conflict between the King and his consort cast something of a shadow upon the evening.
baron m.
Greetings Sir R-----! This evening's chill wind might be forgiven some of its injurious assault upon me by delivering me some good company as I warm my bones. Come, shed your coat and join me in a glass of this rather delightful mulled cyder!
Might you be interested in a little sport whilst we recover?
Excellent!
This foul zephyr puts me in mind of the infantile conflict between King Oberon and Queen Titania that was in full force during my first visit to the faerie kingdom. I had arrived there quite by accident but fortunately my reputation was sufficient to earn me an invitation to dine at the King's table. That the fare was sumptuous beyond the dreams of mortal man goes without saying, but the conflict between the King and his consort cast something of a shadow upon the evening.
]]>
We're All Sorted From A To Z - a.k.tag:www.thusspakeak.com,2017:/ak//9.2422017-11-03T19:00:00Z2017-11-03T20:00:21Z
Something that I miss when programming in JavaScript is the wide variety of array manipulation functions available in my primary language, C++. We have, in fact, already implemented one of them with ak.shuffle which randomly rearranges the elements of an array. We shall be needing another one of them in the not too distant future and so I have decided to take a short break from numerical computing to add those of them that I use the most frequently to the ak library, starting with a selection of sorting operations.
a.k.
Something that I miss when programming in JavaScript is the wide variety of array manipulation functions available in my primary language, C++. We have, in fact, already implemented one of them with ak.shuffle which randomly rearranges the elements of an array. We shall be needing another one of them in the not too distant future and so I have decided to take a short break from numerical computing to add those of them that I use the most frequently to the ak library, starting with a selection of sorting operations.
]]>
On Share And Share Alike - studenttag:www.thusspakeak.com,2017:/student//12.2412017-10-20T19:00:00Z2017-10-20T19:01:22Z
When last they met, the Baron challenged Sir R----- to a wager in which, for a price of three coins and fifty cents, he would make a pile of two coins upon the table. Sir R----- was then to cast a four sided die and the Baron would add to that pile coins numbering that upon which it settled. The Baron would then make of it as many piles of equal numbers of no fewer than two coins as he could muster and take back all but one of them for his purse. After doing so some sixteen times, Sir R----- was to have as his prize the remaining pile of coins.
student
When last they met, the Baron challenged Sir R----- to a wager in which, for a price of three coins and fifty cents, he would make a pile of two coins upon the table. Sir R----- was then to cast a four sided die and the Baron would add to that pile coins numbering that upon which it settled. The Baron would then make of it as many piles of equal numbers of no fewer than two coins as he could muster and take back all but one of them for his purse. After doing so some sixteen times, Sir R----- was to have as his prize the remaining pile of coins.
]]>