Search This Blog

Saturday, March 31, 2012

Easy algorithm in C++ to treat random data.


Given a binary sequence, the following algorithm counts how many voltage increases there are in a certain period of time.

Note: let 1 be a tiny voltage increase and 0 a constant voltage. Somehow (at present I don’t know how to do it), real data ought to be correctly processed so as to get a real analysis of what is happening in the quantum scale; in order not to complicate this algorithm, let’s suppose a random database created in Excel, for instance.
----------------------------------------------------------------------------------------------------------
#include <iostream>
#include <math.h>

using namespace std;

void main (void)
{
            int i,j,var1,var2cont1,cont2,nrows,ncolumns,totaldata,percent1,percent2;
            int matrix[1000][1000];

  cout<<”(Please copy and paste the binary sequence considered in a certain period of time and type  it as a matrix)”<<endl;

  cout<<”Type the number of rows :”<<endl;
  cin>>nrows;
  cout<<”Type the number of columns :”<<endl;
  cin>>ncolumns;

  for (i=0;i<nrows;i++)
  {
              for (j=0;j<ncolumns;j++)
              {
                          cout<<”Type element [i+1][j+1]: “<<endl;
                          cin>>matrix[i][j];
              }
  }
  cout<<”Input matrix: “<<endl;
  for (i=0;i<nrows;i++)
  {
              for (j=0;j<ncolumns;j++)
              {
                          cout<<matrix[i][j]<<” “;
              }
              cout<<endl;
  }





var1=0;
var2=0;
for (i=0;i<nrows;i++)
{
            for (j=0;j<ncolumns;j++)
            {
                       if (matrix[i][j]==1)
                                   {
                                               var1++;
                                   }
                       else
                                   {
                                               var2++;
                                   }
            }  cont1=var1;
                cont2=var2;        
}


            totaldata=nrows*ncolumns;

            int a=cont1/totaldata;
            percent1=a*100;

            int b=cont2/totaldata;
            percent2=b*100;

            cout<<”Conclusion: “<<percent1<< ” % of times seems to have been a voltage increase, whereas  
“ << percent2 << ” % of times it’s very likely to have been a constant voltage.” <<endl;

            system (“pause”);

}

Saturday, March 17, 2012

Fractales del teorema de Pitágoras



Como se ve en la animación, se trata de ir añadiendo cuadrados dispuestos de manera que van formando entre sí triángulos rectángulos. Y este mismo problema llevado hasta el infinito hace la forma de este curioso árbol.

Thursday, March 8, 2012

But...what is time?

What's the time? That's a typical question we ask people everyday. But, have you ever stopped to think about what exactly is what we call 'time'? Time is a crucial concept in physics, and here (http://www.timephysics.com/ ) you can find a very good explanation of it.
As Einstein would say: "There's no time to lose".

Sunday, March 4, 2012

The mysteries of the Universe. Before the beginning.


Here's an amazing set-up pic of a black hole. As you may know, the gravitational field created beyond the event horizont is so big that no particle is able to escape from it, not even light photons. Some scientists often claim that many experiments being carried out in the CERN create small black holes, leading to a possible 'destruction' of the planet. But, from my point of view, it's fairly unlikely to happen. I think we're getting closer to the truth, thanks to the enormous work thousands of scientists do everyday; the final truth, the one that is going to be able to explain the origins of the universe. Just a quick question: assuming that everything that surrounds us, all this world we live in came from what is called 'singularity', are you able to place it in an exact point of space (let's refer to it as R^3, for instance) just before the Big Bang?

Peaceable matter-antimatter pairs glimpsed in the lab - physics-math - 29 February 2012 - New Scientist

Peaceable matter-antimatter pairs glimpsed in the lab - physics-math - 29 February 2012 - New Scientist

Sunday, February 12, 2012

¿-1=1?

Puede haber incoherencias al pasar del campo complejo al real. Y una de ellas es esta.

No es la primera vez que la veo, pero es alucinante. Al menos ahora, cuando estés en negativos, podrás argumentar lo contrario.


Sunday, February 5, 2012

Ciencias Vs. Letras (2)

Me compadezco por aquellos que se hayan podido sentir 'ofendidos' por la reflexión anterior. Por ello, he decidido poner unos ejemplos claros de cómo las letras cobran mayor importancia que los números en algunas ocasiones:


  • "¡VAMOS A COMER, NIÑOS!", que no "¡VAMOS A COMER NIÑOS!".
  • "La violencia doméstica", que no "La violencia domestica".
  • "Espero que lo hallas pasado bien", que no "Espero que lo hayas pasado bien". (No dificulta la lectura pero causa tal dolor visual, que enfín, sí que la dificulta)
  • Y así millones de ejemplos.

Ciencias Vs. Letras

Hola a todos, esta vez vengo a exponer una pequeña reflexión, no por ello menos válida que otras de mayor peso. Es muy sencilla:

"Si nos equivocamos en una letra cuando escribimos una frase (Ejemplo: '¿Quedamso a las 7?', que se entiende perfectamente que queremos quedar a esa hora, o 'Estpy con mi amiga', queriendo decir 'Estoy') el receptor del mensaje entiende sin ningún problema la información que le proporciona el emisor.

El problema viene con los números. ¿Es lo mismo decir que 'Hay un 0,7 de probabilidad de que algo ocurra' que afirmar 'Hay un 0,9 de probabilidad de que algo ocurra'? Otro ejemplo: 'Quedamos a las 7' en vez de 'Quedamos a las 8', o mejor aún, 'Me tocó 1/3 de la tarta' en vez de 'Me tocó 1/7 de la tarta'.

Claramente, y es fácilmente comprobable, los números son más importantes que las letras en algunas ocasiones, pues por un mínimo error numérico pueden suceder malentendidos o incluso tragedias como la del 'Mars Climate'.

Entonces, razonando de manera lógica, ahí va la pregunta (ocn un poquito de ironía): ¿Si ols nuemros son ams improtantes que las lertas, las Ciencais son ams improtatnes que als Lertas?