03.21.06

Mathematical Telepaty

Posted in Computers, Mathematics at 12:26 pm by pmatos

My girlfriend sent me the other day the following link: http://kardini.fateback.com/telepatiav.htm

The play is nice but as usual nothing more than a trick with basic number theory (and as it is normal, with the number 9).
The instructions are as follows:

  • Choose a number with two digits, let’s call it z. z is composed of the two digits x and y and is given by:
    [tex]z = 10x – y[/tex]
  • Now, subtract from z both digits and you’ll obtain the final number, f.
    [tex]f = z – x -y[/tex]
  • The next step is to search the table for f and it’ll guess which symbol associated with it.

The trick is now very obvious since [tex]f = z -x -y = 10x – x -y = 9x[/tex]. Basically all multiples of 9 are associated with the same symbol, which will be the symbol given as the guess (which will always be correct, by the way). All the other symbols are randomly chosen.

Well, this is not new. 9 has several nice properties but none are used in this trick. For example, it could say to subtract from z, two times the first digit and one time the second and f would be a multiple of 8. You would just have to put the same symbol in every multiple of 8. But 9 is nice for tricks? Why? Because the sum of the digits of a two-digit multiple of 9 is 9. I’ve read about some tricks which used this property. I can’t remember any but I can make up one. Imagine an integer between 10 and 99 (inclusive). Multiply by 4, sum all its digits, subtract 1, multiply by 8, sum all its digits, if the number is less than 10 sum all its digits again until you have a 1-digit number. Now, multiply by nine. Sum its digits, and take 4. I’ll guess the number you have is 5! And it will always be… all the mambo-jambo I just invented tricked your mind into thinking you’re doing something useful when it was plain useless. The kernel of the operation is the multiplication by 9 and the sum of its digits. You sum them and you’ll get 9 (I know that!) and then I ask you to take 4 and I’ll guess 5 which will be correct. You’ll be thinking I’m a magic and I only know the basic property of multiples of 9. :)

Have fun!

ANN: PLT Scheme 301.11

Posted in Computers, Programming, Scheme at 12:23 pm by pmatos

Yes, there was no 301.10 as Matthew pointed out in his announcement:

MzScheme and MrEd are now version 301.11 in the SVN repository trunk.

(Version 301.10 never made it out of my development branch.)

IMPORTANT: since the new `compiler-enforce-module-constants’ parameter
defaults to #t, module re-definition is effectively prohibited by
default. Also, in a namespace produced by `module->namespace’, a
variable can’t be redefined or `set!’ed unless the original module
`set!’ed the variable (or the variable wasn’t defined at all). If you
use `module->namespace’ and/or module re-definition for debugging, then
set `compiler-enforce-module-constants’ to #f.

Changes:

* The bytecode compiler now inlines some functions bound by `let’,
`letrec’, or a module-level `define’. The conditions for inlining
are typical (e.g., the function has to be “small”). Currently,
module-level definitions are inlined only within the same module.

* By default, a variable defined in a module top-level is immutable,
unless the module (in expanded form) contains a `set!’ on the
variable.

The only way to `set!’ such variables before was to use
`module->namespace’, or to redefine the module. Now, those don’t
work either, unless the `compiler-enforce-module-constants’
parameter is set to #f before compiling the module.

If `compiler-enforce-module-constants’ is set to #f, then module
bindings are not inlined, and the JIT must generate certain run-time
checks that are otherwise unnecessary.

* Changed `file-position’ so that eof as a second argument moves to
the end of a file/string port.

* Added `procedure-closure-contents-eq?’, which is useful for certain
caching operations (e.g., in the implementation of lazy contracts).

Matthew

03.19.06

The Island

Posted in Movies at 3:40 am by pmatos

The Island

Plot Outline: A man (Ewan McGregor) goes on the run after he discovers that he is actually a “harvested being”, and is being kept along with others in a utopian facility.

Personal Comments:

I rented this movie some time ago, and I had my review on the post stack, so here it is…

This movie is very good. The action is nice but I think the best of this is the plot. A new kind of movie, in fact, I don’t think we have seen a movie like this before. The cloning, harvested beings, seem to be new when it comes to hollywood. Still, the actors are nice and so is the movie. Is a nicely spent afternoon in front of the TV. :-)

03.13.06

Protected: Mais um…

Posted in For your eyes only..., Private at 10:07 pm by pmatos

Mais um texto que encontrei… :)

Tenho de fazer um intervalo, preciso de um intervalo.
Estou todo dorido. Passei a manhã no ginásio a abusar da minha capacidade muscular e de tarde resumi 3 capítulos de ACSI, estudei-os e terminei uma das últimas partes do projecto de Redes de Computadores I. Não pode haver dias pior que estes últimos, não pelo fiz ou tinha que fazer mas sim pelo que não fiz. Não estive com o meu Amor, na verdade verdadeira, não estou com o meu Amor há já alguns dias e estou-me a sentir extremamente sozinho. Não tenho com quem falar, quem abraçar, quem beijar, com quem estar. O meu Amor habitua-me mal… Está sempre comigo, beija-me, abraça-me, fala comigo, dá-me muito carinho eu … ADORO! e depois pronto, nestas alturas fico assim. Felizmente não acontece muitas vezes mas prontos, vou ter umas férias inteirinhas pra ser a 300%, 1000%, .. infinito% dela, depois terei de dividir-me e dar também atenção de novo às aulas mas nunca deixarei de ser pelo menos 100% dela o resto de toda a minha vida. Ai meu Amor, não sei que fazer, tou com um aperto tão grande no coração… Queru tar ctgu! Ao menos sempre tenho aqui o teu peluxe comigo! É lindo, é kiduh, é espectacular, é TEU! Que será que estás a fazer agora? Estarás a pensar em mim? Tu és tão… tão… não tem palavras, qualquer coisa que diga será sempre pouco para te descrever. És tudo aquilo que qualquer homem poderá desejar e muito mais. És a mulher ideal! Fica para sempre comigo, vive comigo, sê feliz comigo, casa comigo, diverte-te comigo, sorri comigo, tem filhos comigo, cria um futuro comigo… eu… já sou todo teu… para sempre… em qualquer momento, para fazer tudo isto que enumerei… e muito mais!
AMO-TE COMO NUNCA SE AMOU ALGUÉM, VENERO-TE COMO NUNCA SE VENEROU ALGUÉM… SÊ MINHA QUE EU JÁ SOU TEU… VAMOS SER UM SER UNO!

Paulo Jorge Matos
8/7/02

Protected: Encontrei…

Posted in For your eyes only..., Private at 9:23 pm by pmatos

Encontrei duas folhas nas quais escrevi sobre ti ou para ti e não me lembro se alguma vez as lestes. No entanto, aqui estão, não vão elas desaparecer e com elas aquilo que escrevi.

Sentei-me na cama, são 23.26 segundo o meu computador do dia 19 de Junho de 2002 e estou a precisar de falar com alguém, como não tenho ninguém para falar espero que as páginas que se seguem libertem esta minha necessidade de transmitir o que sinto. Neste momento e como nos momentos dos últimos quase 3 meses apenas me apetece estar com o meu amor; mas nem tudo são rosas, ou pensando melhor… são tudo rosas existindo apenas alguns espinhos. Espinhos esses que eu e o meu amor vamos aparando de vez em quando, quando julgamos necessário.
Mas comecemos do inicio, afinal de contas, tudo isto começou algures. Esse algures foi realmente num dia interessante e num local interessante mas nesse dia a àrvore do amor já em mim se encontrava plantada, mas afinal vamos ver quando é que apareceu a tal semente.
A verdade, verdadinha é que se eu me tentar lembrar o mais atrás possível apenas me lembro de uma rapariga de uma cara simpática, bonita e monitora que chegara do acampamento de verão da Gaspar Correia do ano 2001 e chorara.
Não percebi porquê, lembro-me na altura de querer ir falar com ela mas não me deram oportunidade porque os “Nunos” já estavam a tentar resolver a situação. Nesse ano, no dia 19 de Julho, exactamente à 11 meses eu dei entrada no hospital Curry Cabral dado que caí de uma grande altura a fazer escalada, na altura amaldiçoei o dia. Hoje pergunto-me se é a isto que as pessoas chamam de destino. Essas férias foram um caos, apenas tive oportunidade de estar em casa, muitas vezes com dores, lembro-me eu apenas de ter feito duas coisas: dar explicações de matemática para preparar uma amiga para o exame nacional de 2ª fase e falar com uma rapariga que aparecia bastantes vezes na internet. Coincidência ou não essa rapariga era a mesma que vi a chorar na chegada do acampamento de verão, o seu nome era (e é) Catarina, a qual durante essas férias vim a conhecer melhor, sempre e cada vez mais à medida que o tempo passava me apetecia conhecê-la ao vivo, estar um bocado com ela, falar sem ser por trás do teclado, conhecer o rosto por detrás do monitor. No entanto, o tempo passou e cada vez mais regularmente nos encontravamos na Internet, no canal do #acampamento para conversar, o tempo passou rapidamente até que chegou um dia que decidi arranjar uma maneira de a ver e também não dar a parecer que estaria realmente interessado em fazê-lo. Bastou um dia mencionar a ideia ao Rui para ele estar interessado em ajudar, ao mesmo tempo o Lourenço também quis. Tinha uma dupla carismática a ajudar, logo pouco ou nada poderia falhar, eram meados de Janeiro e a notícia espalhava-se, começaram a tratar das coisas e o Rui e o Lourenço decidiram “tomar” conta das coisas como é costume. Por mim pouco importava desde que tudo corresse bem e a Catarina fosse. Ela estava também interessada e isso ajudou bastante, o jantar realizou-se, fui buscá-la e por sorte ou azar a Karol ligou-me a dizer que era inútil levarmos dois carros até porque o estacionamento era difícil, assim decidimos ir no jipe dela até porque era maior. O jantar correu bem a não ser uma pêra que para lá houve que aqui para o caso não interessa. No entanto, não fiquei sentado ao pé dela porque me sentaram noutro lado, depois saimos e ela também veio, durante a noite tivemos sentados num bar algures e sinceramente fiquei com a sensação que de vem em quando ela ficava a olhar para mim assim com uma cara que apesar de não perceber porquê, gostei de ver. Fiquei um pouquito triste, no entanto, com o facto de ela ter decidido ir para casa com o Rui. Sendo eu a pessoa que a “trouxe” e a pessoa que falava com ela na Internet esperava que ela gostasse de ir comigo em vez de ir com o Rui mas tive azar. O tempo continuou a passar e chegava o acampamento de Páscoa, o qual seria bastante interessante e daria para ambos nos conhecermos. Dias antes decidi convidá-la a vir comigo às compras para o acampamento, de uma forma ou de outra isso iria fazer com que estivessemos juntos mais tempo no acampamento dado que partilhariamos a comida que comprámos. Neste momento senti que de alguma forma um bichinho me dizia para a conhecer melhor, o tempo que falámos na net não seria em vão, usualmente se algo não me interessa eu não desperdiço o meu tempo. Com a Catarina era diferente, ela estimulava o meu interesse por ela e esse interesse crescia. O acampamento chegara e nós partimos. Todo o acampamento foi excelente, lindo, muitos momentos não esqueci e não esquecerei. A Catarina que conhecera na net deixou apenas de ser uma pessoa da net para ser uma amiga a sério muito rapidamente. Na net vi desde cedo a inteligência e a sua afectividae. A inteligência vi eu através de respostas rápidas a puzzles reconhecidamente não triviais em termos de raciocínio, o seu desenvolvimento cerebral era espantoso. Para resolver puzzles como aqueles que eu lhe colocara eram necessário duas coisas que ela provou ter: um raciocínio matemático avançado ou um reconhecimento de padrões altamente eficiente e um interesse muito grande em querer saber e resolver. A sua afectividade foi algo que desde cedo me prendem a ela. Só o facto de ter alguém a mandar-me beijinhos, desejar boa noite todos os dias e até por vezes a chamar-me kiduh rapidamente despertou também o meu afecto.
Aquilo que descobrira na net era apenas a pontinha de um iceberg de qualidades. O acampamento revelou simpatia, sinceridade, responsabilidade, beleza, sentido de humor e muito mais. O “muito mais” tem coisas como o facto de eu começar a sentir que ela poderia a estar a ficar interessada em mim. A sua simpatia foi revelada a partir do momento em que eu olhava para ela a lidar com os outros e comigo, percebi que ela é uma boa pessoa, os seus olhos mostraram sinceridade quando falava comigo, com algumas “poses” lindas, o seu tempo para brincar e para falar a sério, e aquele afecto que eu tinha vindo a sentir aumentar estava a “amolecer-me”. Eu precisava de pensar, algo em mim estava a crescer mas estava com medo, eu não sentia que a conhecia suficientemente bem, apenas me lembrava de quando à seis anos atrás tinha namorado uma rapariga da idade dela que me deixara para trás apenas porque os pais ou amigos estavam a chatear (coisa que nunca viera a perceber) e seria ela capaz de amar realmente alguém? A minha incapacidade de acreditar em pessoal mais novo e desgosto pelo que muitas coisas que pessoas da idade dela faziam-se andas para trás mas algo foi mais forte. Nós falavamos, riamo-nos, molhavamo-nos, estavamos juntos e ganhei uma confiança e um estado de espírito com alguém que era diferente de algo que alguma vez viera a sentir. O acto de me vir trazer um chocolate à tenda (acto que nunca esquecerei) levou-me a na noite seguinte a lhe ir dizer boa noite, a tentar também demonstrar algum carinho, a abrir o meu coração, abrir o que se encontrava fechado já à algum tempo, a limpar o meu coração de desgostos passados e a prepará-lo para a felicidade futura, a dar a conhecer o meu “eu” e a não apenas a “cara feia”, “voz grossa” e as conversas sérias que a maior parte conhece. À medida que sentia dela uma resposta afectiva, também eu tentava entregar-me um pouco mais. Desde os bons dias, até as refeições, ao lavar de loiça e as boas noites, muita coisa se passou, coisas que o meu coração lembrará com alegria. Quando cheguei e passei as primeiras horas sem ela, fiquei desde logo a sentir o que teria perdido, no entanto, queria conhecer mais, e assim foi.

03.12.06

Chess Minority

Posted in Chess at 7:13 pm by pmatos

Here’s a new category for us all… I’ve been meaning to create a new category on the blog about chess but having little time these days and no easy way to typeset chess boards have delayed me. No more! My current solution for posts on this category will be to generate png images from pgn files so that I can get nice boards to the blog. I would hope there would be a plugin for wordpress but found nothing. If you happen to know about anything please comment or contact me…

I’ll be preparing the first post on chess this week… Hope to be posted in a week… And by the way, I’m sorry for the delay on the posts for Mathemagical Meetings and other issues. I have about 23 posts on stack to get finished but I’ve been really busy lately. Hopefully I’ll be free in April… :)

03.09.06

Recent changes to DrScheme & Co.

Posted in Scheme at 1:03 am by pmatos

R. Findler posts recent changes to DrScheme and Co. on PLT Mailing List. It’s always nice to review them.

For details on using the intermediate releases, see

http://svn.plt-scheme.org/

This is a summary of the recent changes to DrScheme in the
SVN archive. You may have some of these changes already;
typically each change is committed as it happens and these
emails are only sent when the list gets long enough.

. Added two new keybindings to DrScheme (in Scheme mode):

c-c; c-o move-sexp-out: the sexpression following the insertion
point is put in place of its containing sexpression.

c-c; c-l insert-let-binding: wraps a let around the sexpression
following the insertion point and puts a printf in at that point
(useful for debugging)

. Case-insensitivity is now available in DrScheme’s search box,
courtesy of Jens Axel Sogaard. Thanks!

. The image.ss teachpack now uses smoothed images.

. drscheme-language-positions and
drscheme-language-readers now allows relative paths for
language module specifications.

. Added `this’, implicitly bound in ->r and ->pp contracts
when used inside `object-contract’

. union is now deprecated in favor of or/c. It’s the same
combinator, but it matches other names in the contract library.

Robby

03.08.06

New Report to the Community from the Scheme Steering Committee

Posted in Scheme at 9:09 pm by pmatos

From c.l.s. it’s available a new report of the scheme steering committee and a draft R6RS will be ready by 1st September, 2006. Hurray!

Here’s the announcement:

March 7, 2006

Since the last report of the Steering Committee, a number of important
changes have taken place.

First, Marc Feeley and Manuel Serrano have resigned from the Editors
Committee. We have accepted their resignations with regret, and with
gratitude for the efforts they have expended to produce a revised
Scheme standard.

In light of these changes, the Steering Committee has amended the
Charter to:

(a) change the number of Editors from seven to five.

(b) replace the office of Editor-in-Chief by a Chair and a Project
Editor. The Chair is responsible for organizing meetings and other
activities and ensuring that the process makes progress in an orderly
fashion. The Project Editor is responsible for producing
standardization documents.

The five editors have chosen their Chair and Project Editor. They
are:

Chair: Kent Dybvig
Project Editor: Mike Sperber

The Editors Committee has now produced a progress report, which is
available at schemers.org. In it they state their intention to
deliver to the Steering Committee a complete draft R6RS by September
1, 2006.

The Steering Committee looks forward to receiving their draft.

Alternate links to the Editors’ Progress Report:

http://www.cs.indiana.edu/~dyb/r6rs/status.pdf

http://www.cs.indiana.edu/~dyb/r6rs/status.html

—The Scheme Language Steering Committee:
Alan Bawden
Guy Steele
Mitch Wand

03.07.06

ANN: PLT Scheme 301.9

Posted in Scheme at 7:04 pm by pmatos

The 301.9 version is out only with minor internal changes.

MzScheme and MrEd are now version 301.9 in the SVN repository trunk.

The changes are internal, such as a clean-up in the bytecode compiler’s
constant propagation and constant folding.

Matthew

Fortune Of The Day

Posted in Fortune at 4:17 pm by pmatos

In this world some people are going to like me and some are not. So, I may as well be me. Then I know if someone likes me, they like me.

Next page