Thursday, July 08, 2021

Oposiciones y probabilidades

 [The following is a guest post by my Spanish alter ego, Steven, who writes in Spanish.]

Son fechas de oposiciones de secundaria en España, y en este post voy a describir un cálculo que cada opositor debería hacer.

Foto por Elijah Hail en Unsplash

La primera prueba de la mayoría de las oposiciones consiste en desarrollar un tema completo del temario de la oposición. Este temario puede contener fácilmente más de 70 temas, cada uno con su complejidad correspondiente, lo cual hace que su memorización sea una hazaña importante o incluso imposible. Afortunadamente, no es necesario estudiarse todos los temas, puesto el opositor puede elegir un tema de una selección pequeña. En particular, la dinámica típica es la siguiente: De todos los temas disponibles se sacan al azar 5, y de esos 5 el opositor elige uno para desarrollar. De ese modo, si el temario contiene 70 temas, no tiene sentido estudiarse todos esos temas, ni 69 ni 68, porque claramente el número mínimo que hay que estudiar para que sea seguro que salga uno de los estudiados es 66, o bien 70 - 4. Incluso no es descabellado estudiarse alguno menos, porque estudiando por ejemplo 60 temas, sigue siendo muy probable de que entre los 5 seleccionados salga uno de los estudiados. Lo cual nos lleva al maravilloso mundo de las probabilidades, la combinatoria, y en particular la siguiente pregunta:

"Si estudio 20 temas de un temario de 70 temas, ¿cuál es la probabilidad de que cuando se escogen 5 salga por lo menos uno de los que he estudiado?"

Esta pregunta es bien importante, porque nos permitirá definir una cantidad de temas a estudiar con suficiente rigor. Por ejemplo, si resulta que dicha probabilidad es de 95%, seguramente valdrá la pena estudiarse solo esos 20 temas, en mucha profundidad. Por otro lado, si esta probabilidad es baja, por ejemplo 30%, deberíamos estudiar más temas para incrementarla, aunque como el tiempo disponible es fijo esto también significará que el tiempo dedicado a cada tema será menos que con esos 20 temas.

En el caso del ejemplo el cálculo no es muy complicado:

P(cae por lo menos 1) = 1 - P(no cae ninguno)

Aquí, P(no cae ninguno) es la probabilidad de que en el sorteo de los 5 números no caiga ninguno de los estudiados, y se obtiene como 

P(no cae ninguno) = P(ninguno en 1º sorteo)·P(ninguno en 2º sorteo)· ... · P(ninguno en 5º sorteo)

Las probabilidades de la mano derecha no son independientes, puesto que al sacar el primer número ya no se puede sacar este número en el segundo sorteo. (Se forman lo que se conoce como "combinaciones sin reemplazo".) Tenemos las siguientes probabilidades:

P(ninguno en 1º sorteo) = 50/70

porque hay 50 posibilidades de sacar un número que no pertenece a los 20 estudiados, de un total de 70. Como no hay reemplazo, obtenemos las otras probabilidades de la siguiente forma:

P(ninguno en 2º sorteo) = 49/69

P(ninguno en 3º sorteo) = 48/68

P(ninguno en 4º sorteo) = 47/67

P(ninguno en 5º sorteo) = 46/66

Juntando todo, obtenemos la probabilidad que buscábamos:

P(cae por lo menos 1) = 1-50/70·49/69·48/68·47/67·46/66 = 82%

Resulta que estudiando solo 20 temas de un total de 70 la probabilidad es del 82%, lo cual es bastante alto. Esta probabilidad es aproximadamente 4/5, lo cual significa que si nos presentásemos 5 veces que solo 1 vez tendríamos la suerte de no haber estudiado ningún tema de los sacados, en promedio.

Pero aunque 82% es una probabilidad razonablemente alta, el tema de la oposición es lo suficientemente importante para intentar garantizar el éxito algo más. Podríamos dar la vuelta a la pregunta y preguntarnos, ¿cuál es el número mínimo de temas que debería estudiar para que la probabilidad de que caiga por lo menos uno de los estudiados sea por lo menos el 95%? La forma más rápida de obtener este número es calcular la probabilidad para 21 temas, 22 temas, etc. por ejemplo con una hoja de cálculo, e identificar en qué caso alcanzamos la probabilidad buscada. En este caso, los números que salen son los siguientes:


O, gráficamente:

En otras palabras, para que la probabilidad de que caiga por lo menos un tema de los estudiados sea del 95% hay que estudiarse 31 temas. Curiosamente, si por ejemplo solo nos estudiamos 9 temas esa probabilidad ya es del 50%. Esto resulta poco intuitivo, y enfatiza la necesidad de hacer un buen cálculo de probabilidades al hacer este tipo de decisiones. No confiemos en nuestra intuición cuando se trata de probabilidades.




Tuesday, January 19, 2021

There was a bug...

... in the latest update of my Chrome extension, RevEye v1.5.0, which went live today. Thanks to the alertness of several users, the bug is fixed now and the new, corrected version v1.5.1 will be rolled out soon.

In any case, if you need to perform reverse image searches right now and are stuck with the buggy version, you can follow the next steps to fix the bug until the extension updates on your machine:

  1. Go to the options screen (right click on icon > options)
  2. Open DevTools (F12 on Windows, Command+Option+I on Mac).
  3. In the tab "Console", write the following code and press enter:

    localStorage.services = ['google', 'bing', 'yandex', 'tineye'];

  4. Visit the page chrome://extensions/, disable the extension and enable it again.
Now it should work correctly, including the new options introduced in v1.5.0.

Tuesday, May 27, 2014

Desaturation bookmarklet

I recently needed to protect my eyes from a web site whose editors just love saturation. I figured there should be an easy fix for that, so I quickly found the Desaturate extension for Chrome. Nevertheless, nowadays I prefer to install as few extensions as possible since malicious parties figured out how to exploit Chrome extensions for profit. Luckily, many extensions are simple Javascripts that can be replaced by a bookmarklet. So here it goes, a bookmarklet to desaturate a page:


Just drag it to your bookmarks bar and you're done.

Update: clicking the button a second time now returns the page to full color.

Wednesday, March 19, 2014

Machine learning and cryptocurrencies

Here's a thought on cryptocurrencies. It's fairly well known that the proof-of-work required to discover new blocks is actually just a bunch of calculations that typically don't serve any other purpose than producing a hash. And it is a lot of computation power, check for yourself. Some cryptocurrencies like Riecoin try to make block discovery useful outside of the cryptocurrency world as well by making it solve an additional purpose, like finding prime numbers.

Discovering a block is basically done by solving a problem that is hard to solve, but easy to check (think a really hard sudoku). There are still a myriad of problems that fit this description but that are not used in cryptocurrency hashing.

So here's the thought. Why not use the proof-of-work calculations to solve a problem in machine learning? Many problems in machine learning are hard to solve but easy to check. One such problem is training a machine, e.g. a big neural network. Discovering a block would be mean producing a set of weights that allow the network to validate a test data set correctly. (I'm leaving out many practical details here, such as how to treat hashes.)

Another approach may be to treat the entire network of crypto miners as the machine itself, and use it e.g. to detect interesting instances, such as in SETI, though that example may be too esoteric.


[Update 2014/07/29: I'll be pasting some remarks here that have appeared on other social networks in an effort to centralize ideas.]

Specific properties of the computations in typical proof-of-work:

  • Solution is hard to obtain but easy to verify;
  • Input data for the computation depends on the block / transaction data;
  • A small change in the input data triggers a big change in the solution.
A meta-remark by Kevin Peno:
"Block-finding is like winning the lottery and mining throughput is proportional to the number of tickets bought."
So how about formulating a problem that rewards intelligence instead of computational power, possibly maintaining some of the properties listed above?

Tuesday, February 25, 2014

New Chrome extension: 'Nuff Tabs

I wrote a Chrome extension to limit the amount of tabs in Google Chrome. It's called 'Nuff tabs. There were already some extensions in the wild that do something similar, but none with the properties I was looking for (lightweight, specific options, etc.).

It works as follows. In the options you can specify the maximum number of open tabs. When you open one more tab, the extension will automatically close a previous tab. In the options you can also specify which rule it must follow to determine which tab to close: either close the oldest tab, the least recently used tab, the least frequently used tab, or a random tab. My current favorite setting is the "least recently used" tab, as this way I don't have to worry about losing older tabs that are still relevant.

You can also choose to display the number of open tabs in the extension icon.

Install it and let me know what you think.

Chrome store link: https://chrome.google.com/webstore/detail/nuff-tabs/kemeihccgedidlokcbfhdekcfojpjjmp

Source code: https://github.com/steven2358/NuffTabs


Wednesday, September 18, 2013

New Drupal web site for our research group

A few months ago we finished installing a new web site for our research group. The previous site was in Drupal 5, and we made an improved version in Drupal 7. You can visit the site here.


Overview

These are the most important parts of the site:
  1. Personal profiles for each researcher and professor
  2. A general list of publications and individual listings for each researcher
  3. Information pages for courses
  4. A news section


With respect to the previous version, we made several big changes:
  • We went back to a single language. Previous versions were in English and in Spanish (as we're located in Spain) but we decided to go English-only as this is the language of research. That removed the hassle of having to update profiles in two languages. We still have Spanish-only pages for the courses though, but we are not using the internationalization system anymore.
  • We removed any anonymous user input. There is still a contact form, but we removed the guestbook and comments on announcements.
  • Previously we used a custom-made publication management system. We now changed to the Drupal module Biblio. Biblio has some great out-of-the-box features like publication listings per author and several types of sorting.
  • We made more use of the views module and added some tighter interaction between the different content types on the site. We now have
    • news pages and news blocks showing up in several parts of the site;
    • a page for research projects, with links to related Biblio publications on each project and vice-versa;
    • an area dedicated to reproducible research / open science in which we post code to reproduce experiments from our papers (with links back from the paper pages) and several tools we are building.


Here's a short rundown of how we built the site.

Modules

The non-core module footprint was relatively small, since Drupal 7 comes standard with many features. The major non-core extensions we used are the following:
Sticky footer!

Customizations

Apart from configuring the modules, there has been some getting our hands dirty in 3 areas:
  1. We had to hack the Biblio module as it doesn't allow for hooking / theming properly. Mainly, this was for sorting the publications by type with a custom order (not alphabetic) and some aesthetic aspects.
  2. The theme is a zen subtheme. The user profiles are built with Profile2 and some additional fields, and on top of that they have some CSS but no theming templates.
  3. Some of the views are using complex combinations of contextual filters and relationships, e.g. to show selected publications in our member profiles.


Conclusion

Drupal 7 was a good choice for our research group web site:
  1. The core of this web site is content management, and our content management requirements which were nicely met by Drupal.
  2. We kept the back-end clean and simple, and we didn't bother with any additional graphics or fancy buttons. For instance, text markup is done code-like with BUEditor which is perfect for us technical people.
  3. Drupal has some great extensibility in whatever direction, which meant that we could find almost any component we needed as a contributed module. It also came in handy for linking external services and doing experimental stuff.
The development took a few months, as this is something we did besides our normal research tasks, but we're very glad with the results. Now let's see if it lasts another 5 years.

Tuesday, May 21, 2013

Matlab code and demo for kernel density estimation


I've made it a habit to release the source code publicly every time somebody asks me for help with a publicly available algorithm. Having my source code in public actually also showed to improve its readability, and it helps me find it back (because, let's face it, everybody knows it is easier to find a file on Google than on your own computer).

So today I am releasing some Matlab code to perform Parzen's kernel density estimation of one-dimensional data. It's included in the KMBOX toolbox now, and you can download a standalone version with a demo from here: https://sourceforge.net/projects/kmbox/files/packs/


The image shows the output of the included demo.

Friday, May 17, 2013

Logos in vector format

I started a small github repo to organize all the logos I've been using in my work lately, mainly in conference posters. As it takes a few minutes to extract a vector logo from a pdf, I though other people might benefit too from the result.

You can find them here: https://github.com/steven2358/vectorlogos

As an example, here goes the ICASSP 2013 logo in vector format. Click the image for the SVG file, use Inkscape or any other software to edit/convert.

Wednesday, March 06, 2013

Graphic-design competitions for electrical engineers

Nature-Inspired Problem Solving
Last year I made this drawing. It was my submission to the t-shirt design competition of the IEEE Computational Intelligence Society. The goal was to make a drawing inspired by the scientific field of "computational intelligence". It also had to feature the slogan "Nature-Inspired Problem Solving".

The idea and drawing took me a few hours in Inkscape, but these turned out to be hours well invested, as I won the competition. So, the IEEE CIS will be handing out shirts with this design at their conferences. Awesome. And besides, I got an iPad for it, so I'm pretty happy to confirm that I'm still living Maurice Moss' dream.



The funny thing is, it's the second time I participate in an IEEE drawing competition and I won both times. Last time I drew the logo for the IEEE region 8. That's a pretty good success rate. But how is it possible?


Maybe it has to do with the fact that the IEEE respresents electrical engineers all around the world, and not graphic designers. And I am lucky enough to know a thing or two about drawing lines. So if that's the reason, the equivalent would be an electrical-engineering contest for graphic designers. I'd love to see that. At the very least it would produce interesting results.

Saturday, March 31, 2012

Kernel Canonical Correlation Analysis code for Matlab

I've made a package with kernel canonical correlation analysis (KCCA) code for Matlab, as part of the experiments I did for a paper. While there are some other packages out there, most notably David Hardoon's KCCA code [1] and Francis Bach's kernel ICA code [2], I wanted a KCCA implementation that included a demo file in addition to the KCCA functions, and I wanted it to be very fast.

The code performs standard regularized KCCA and it includes a demonstration on some synthetically generated data. It can be modified easily to work on external data sets and to use custom kernel functions. The KCCA implementation decomposes the kernel matrices using incomplete Cholesky decomposition, which does not require to calculate the entire kernel matrix (see [2] for more details). The code contains different forms of the generalized eigenvalue problem, all of which yield very similar results. A demo that performs full KCCA without decomposing the kernel matrices is also included.

Download the KCCA code here:
http://sourceforge.net/projects/kmbox/files/packs/

The package is part of my Kernel Methods toolbox, which is still very much in beta. Suggestions are welcome.

References:
[1] D. R. Hardoon, S. Szedmak and J. Shawe-Taylor, "Canonical Correlation Analysis: An Overview with Application to Learning Methods", Neural Computation, Volume 16 (12), Pages 2639--2664, 2004.
[2] F. R. Bach and Michael I. Jordan. "Kernel Independent Component Analysis", Journal of Machine Learning Research, volume 3, pages 1-48, 2002.

Tuesday, November 15, 2011

Comparing the weather forecast for two cities

Going out for the weekend but can't make up your mind between two great places? Wolfram Alpha to the rescue! I found out you can compare weather forecasts with it too. Just use their weather forecast with the "versus" operator, like in this recent query of mine

and up pop the results:


For less well-known cities you might give Wolfram Alpha a hand by adding some parentheses etc.:

Happy walphing!

Tuesday, October 04, 2011

An exquisit blank HTML page

Fancy hacking together a quick single-page web site? No? Well I do. Just in case you change your mind, here's a high-quality blank HTML page you can use as a starting point. It's transitional XHTML and has utf-8 encoding, so that should allow for doing quite a few crazy things.

Thursday, September 29, 2011

Spanish DNI and NIE letter calculator

As I couldn't find this really well done anywhere online, I made a small tool to calculate the letter of the Spanish DNI. For expats living in Spain, you can use it to calculate the letter of a NIE too.

Here it is: Calculadora de letra de DNI y de NIE.

Friday, June 17, 2011

Google reverse image search on desktop

Google finally adjusted their Goggles service for the desktop, so we can now also add their service to list of reverse image search tools, which already included the algorithms of TinEye, Cydral and GazoPa among others. First results show it's a winner, returning more identical results, more visually similar images, and interesting context information. Go to images.google.com to see if it's available in your region.

To commemorate the occasion, I released a new version of RevEye, the Chrome plugin to perform reverse image searches. It now includes searches by Google, TinEye, Cydral, and I've added Yandex and Baidu to the list since they also do pretty well.

RevEye v1.3 is a free download available from the chrome web store.

Wednesday, June 01, 2011

RevEye: Even more reverse image search

Google asked me to change the name of my Chrome plugin "ChromeEye" into something that did not violate their terms. Fair enough. I changed it to "RevEye", and took the opportunity to make some changes to the user interface as well.

First, I added the Cydral engine to the list of reverse image search services included, since it has been producing some very nice results lately.

Second, I added an option to change the context menu: You can now choose either to use one default search engine, or to have a cascaded menu with all options on every search. My favorite option is the one that opens all services in different tabs.

These changes basically make RevEye a "meta reverse image search tool", since it now includes the complete functionalities by the TinEye, GaZoPa or Cydral plugins. So off you go then! Install it and have fun tracking images.

RevEye v1.2 is a free download available from the chrome web store.

Wednesday, March 02, 2011

More reverse image search: ChromeEye v1.0

Yesterday I released a new version of my reverse image search extension "ChromeEye" for Google Chrome. While the first version was simply a bridge to the reverse image search engine TinEye, the new version 1.0 includes the option to use different search engines. At the moment that means images can be sent either to TinEye or to GazoPa. TinEye, which seems to be most popular reverse image search engine these days, looks mainly for exact matches. GazoPa uses a very different algorithm, based on visual features, with sometimes surprising results. Both are still improving their algorithms, obviously, so we´ll keep an eye on them.

That said, ChromeEye is now a plugin for reverse image search in general, and I will be including more search engines in the future. Note also that it is using the right click context menu for image searches. This was a much asked for option in the previous version, but technically not possible (due to Chrome restrictions) when I released it.

ChromeEye v1.0 is a free download available from the chrome extensions directory and from the chrome web store.

Wednesday, March 17, 2010

Fixed-Budget Kernel RLS at ICASSP 2010

My paper titled "Fixed-Budget Kernel Recursive Least-Squares" will be presented this afternoon at the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP 2010). It was written in collaboration with Weifeng Liu and Jose C. Principe of the Computational NeuroEngineering Laboratory (CNEL) at the University of Florida. I couldn't be there to present the paper myself, but luckily my former supervisor Ignacio Santamaría is attending and will be giving the talk. If you are interested in learning methods or online kernel methods, be sure to attend. It's the first paper of the "Learning Theory and Models I" session (MLSP-L2.1), which is held on Wednesday, March 17, 13:30 - 15:30.

The basic idea behind this learning algorithm is pretty simple. First of all, it is an RLS method in kernel feature space, which means it is capable of learning a nonlinear regression in an online manner. Kernel RLS methods usually face memory and computational problems, since their solutions require to invert a large kernel matrix that incorporates information about all processed data. As new data patterns (x,y) arrive (remember this is set in an online environment), this matrix grows and the computation of the regression output becomes more costly in each step. The typical approach to avoid these memory and computational problems is to restrict the data patterns to a minimum number that allows to approximate the solution sufficiently well. Each time a newly arrived pattern is found to be sufficiently interesting, it is added to a "dictionary".

In contrast to these techniques, which make the dictionary expand (albeit slowly), the technique of this paper fixes the size of the dictionary. As a consequence, apart from adding patterns to the dictionary, we also have to prune patterns. While the pruning itself involves only simple algebra, the criterion to determine what data to prune is more interesting. We chose to use a relevance-based criterion in this paper, motivated by the good results it yielded. More specifically, in each time step we calculate how relevant each stored pattern is with respect to the regression, and subsequently prune the least relevant pattern. (Details and references are in the paper itself.) As a result, after running a number of iterations of this algorithm, it obtains a compact set of patterns that summarizes the observed patterns pretty well.

I particularly like the interpretation of this algorithm as a simple learning method that deals with memory restrictions. Every time this method receives a new data pattern, it must determine actively what pattern to "forget" in order to maintain its memory size. So it's a way of "optimal forgetting". And as the results in the paper point out, it is also pretty efficient in doing so.

Figures: The previous figure is one of the slides. The below figure is an illustration of the "label update" procedure that can be introduced to equip the algorithm with tracking capability. I.e., in a time-varying environment the regression surface can be changing, as indicated by the new data pattern (xn,yn). The proposed procedure updates the labels in the vicinity of this point to reflect those changes.
But enough talking about this paper. My friends and colleagues are also presenting theirs, so if you are at the ICASSP be sure to check them out:
  • Il Park and Jose Principe, "Quantification of Inter-trial Non-stationarity in Spike Trains from Periodically Stimulated Neural Cultures" (Multivariate and Multimodal Analysis of Brain Signals, Tuesday, March 16, 13:50 - 14:10).
  • Sohan Seth, Jose C. Principe. A conditional distribution function based approach to design nonparametric tests of independence and conditional independence (Learning Theory and Models III, Wednesday, March 17, 16:00 – 18:00).
  • David Ramirez, Javier Via, Ignacio Santamaria, Roberto Lopez-Valcarce, Louis L. Scharf, "Multiantenna Spectrum Sensing: Detection Of Spatial Correlation Among Time-Series With Unknown Spectra" (SPCOM-L1: Spectrum Sensing for Cognitive Radio I, Tuesday, March 16, 14:10 - 14:30).
  • Javier Vía, David Ramírez, Ignacio Santamaría, Luis Vielva, "Widely And Semi-Widely Linear Processing Of Quaternion Vectors" (Detection and Estimation Techniques - II, Thursday, March 18, 13:30 - 15:30).
  • Luis Vielva, Javier Vía, Jesús Gutiérrez, Óscar González, Jesús Ibáñez, Ignacio Santamaría, "Building A Web Platform For Learning Advanced Digital Communications Using A Mimo Testbed" (Signal Processing Education: Signal Processing Education, Tuesday, March 16, 14:30 - 14:50)
  • Abhishek Singh, Jose Principe. Kernel width adaptation in information theoretic cost functions (Learning Theory and Models III, Wednesday, March 17, 16:00 – 18:00).
  • Abhishek Singh, Jose Principe. A closed form recursive solution for maximum correntropy training (Learning Theory and Models III, Time: Wednesday, March 17, 16:00 – 18:00).
  • Abhishek Singh, Tejaswi Tamminedi, Guy Yosiphon, Anurag Ganguli, Jacob Yadegar. Hidden markov models for modeling blood pressure data to predict acute hypotension (Bioinformatics and Biomedical Signal Processing, Tuesday, March 16, 16:00 – 18:00).
Thanks to Memming for the blog post idea!

PS: The paper will be available in short on my academic web page [update:] can be downloaded from my publications page, and I also plan to release the Matlab code either there or here in the near future. Be sure to ask me about it if you can't find it.

Sunday, December 13, 2009

ChromeEye, a TinEye extension for Google Chrome

chromeeyeI made a simple reverse image search extension for Google Chrome. Reverse what? Reverse image search. Think Google, but instead of text you enter an image. Ah okay. Please continue.

The ChromeEye extension uses the image search engine TinEye, whose technology allows you to find exact copies of images (including scalings and slight distortions).

Version 0.1 of ChromeEye (updated: now latest version) basically mimics the TinEye bookmarklet behavior, i.e. it lists all images of the current page with links to TinEye results. Let's hope Google Chrome allows for editing the browser context menu soon, so you can right click and select a "Search Image on TinEye".

Meanwhile, you can download the latest version of ChromeEye directly from this link, while the complete source code is available on GitHub. So until the oficial TinEye plugin gets released, have fun with this easy solution.

Update 14 December 2009: ChromeEye now has a page on the google chrome extensions site. Version 0.2 was also released, with a nicer logo.

Update 17 June 2011: ChromeEye is now called Reveye and it includes different search engines, such as Google, Tineye and Cydral.

Friday, December 04, 2009

Drawing beautiful block diagrams in LaTeX

I used to put together the illustrations in my publications with a mixture of Inkscape, CorelDraw and psfrag, but obviously this couldn't continue for a long time without becoming an insult to graphic design.

For my latest writings I am returning to the basics: PSTricks. (I know there are lots of other programs to draw block diagrams, but I didn't find any that allowed enough customization). To avoid starting from zero, I am using the PSTricks Signals and Systems package (pst-sigsys), which is easy to customize if you keep the PSTricks user guide (pdf) at hand.

Here's a simple example:

\documentclass{article}
\usepackage{pst-sigsys}

\pagestyle{empty}

\begin{document}

\begin{figure}[ht]
\centering %
\begin{pspicture}[showgrid=false](0.5,-1.2)(9,1.55)
%--- Define blocks ---
\rput(0.5,0){\rnode{s}{$s[n]$}}
\dotnode[dotstyle=square*,dotscale=0.001](1.7,0){dot}
\psblock(3,.75){H1}{$H_1(z)$}
\psblock(3,-.75){H2}{$H_2(z)$}
\psblock(5.8,.75){B2}{$\hat H_2(z)$}
\psblock(5.8,-.75){B1}{$\hat H_1(z)$}
\pscircleop(7.7,0){ominus}
\rput(9,0){\rnode{e}{$e[n]$}}

%--- Connect blocks ---
\psset{style=Arrow}
\ncline[nodesepA=.15]{-}{s}{dot}
\ncangle[angleA=90,angleB=180]{dot}{H1}
\ncangle[angleA=-90,angleB=180]{dot}{H2}
\ncline{H1}{B2} \naput[npos=.5]{$x_1[n]$}
\ncline{H2}{B1} \naput[npos=.5]{$x_2[n]$}
\ncangle[angleB=90]{B2}{ominus} \naput[npos=.5]{$z_1[n]$}
\ncangle[angleB=-90]{B1}{ominus} \naput[npos=.5]{$z_2[n]$}
\ncline[nodesepB=.15]{ominus}{e}
\end{pspicture}
\end{figure}

\end{document}
which, after some retouching of the .sty file produces this pretty diagram:



Update 6th December 2009: Here's a slightly more complicated diagram, based on the same codes as the above example.

Friday, May 08, 2009

Kindle DX for Scientific Papers?

Just out of curiosity, I wondered what scientific papers look like on the Kindle DX's 1200 x 824 pixel resolution. The native PDF support is great, but exactly how readable are those tiny little subscripts in mathematical formula?

Although it will probably take some time until I can lay my hands on a real device, I did the test by scaling a page of one of my own papers to the Kindle's resolution. Check for yourself by clicking on the thumbnails below.

modeoriginal version
(vectorial)
scanned version
(IEEE archive)
kindle portrait
portrait
(full page zoom: page fits within 824 x 1200 pixels)


kindle landscape
landscape
(width rescaled to 1200 pixels)

(The original PDFs can be found here and here.)

In portrait mode, some details might be difficult to distinguish, especially when the PDF is generated from a scanned image. Check for instance this formula, from the scanned version in portrait mode:
But in landscape mode everything looks perfectly readable (at least in this probably very unrealistic experiment). This is the same formula, as it appears in landscape mode:
So I might buy one when it's launched in Europe. But the price needs to be slightly lower. $300 (or its equivalent in €) would be fine. And it needs an SD slot. And Wifi. Apart from that it seems to be fine.