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