Showing posts with label Mathematica. Show all posts
Showing posts with label Mathematica. Show all posts

Sunday, November 4, 2012

Ball Park-ing ! :)

Hi pa !! :-)


HOW have you been...?


Well, yester-night,  me stayed over with my dear friends (Amod & Vijay)...since the weather (& my health! :-( My Fever...! :) !) was not very good...!

But we slept at dunno...bout 3 am or so purr-haps...!!! :)
Not fer werk...(we'd have dozed off sooner if it was jussst our stupid werk! In fact, we did some good progress on our work first...)
But...discussing & doodling on a problem I had preposed while I was in the UK to my friends...
 
I asked my friends again if we could...try to see what is the MAX size of a smaller ball that will fit in the space left when a Bigger ball rests in a cubical enclosure..
[NOTE that this could be a standard, "solved" problem elsewhere in Mathematics, but looking up too much of already "done" stuff, is what usually try to avoid...since it might (& does!) influence our "original" thoughts. Whatever we get should be our own "flowering"...]


  • ...initially, it was bout packing circles ( 2 Dimensions)...
  • ...then, I took it 'higher'...to 3 Dimensions...!!
  • ....and there. started the FUN! Because it is NOT easy to imagine 3-D spatial relationships...We 3 friends were like 3 Blind POETS/MEN trying to describe the proverbial ELEPHANT, gesturing, doodling, & doing our best to get a "handle" on our intuitive "grasp" of what could really happen in different scenarios...! Our heads got scrambled when we realized that in a 3-D cube, the "space" available at the CORNER is MORE compared to that at the meeting of just 2 faces...!!

Walking deeper based on some great li'l insights that my friend Amod stumbled upon, we were able to "break-ice, make in-roads" & slowly began to see some beautiful results.
 
We also began wondering HOW amazing the patterns are in Nature...in multiple-dimensions [right frem ZERO to THREE...it also got me back to wondering...as to what exactly is "space"..."dimensions", etc...! Hmmm...]..!! :)

I could DREAM of OLL sorts of NUMBERS n EQUATIONS n maddening PATTERNS jumping out o' nowhere & asserting their existence(?!?) to me..!!

And I went on "venting" them out to my dear friends, who were more than willing to listen, & even contribute to oLL that....!!

In the end, it was deeep into the night (or MORNING!? :P ) when we "fainted" & "slipped" into the valley of Sleeeep...

I used our 2D result that we got thanks to the work by Amod, & intuitively guessed the pattern fer 3-D...
We could even "verify" it experimentally, but our fatigued, stressed, THINKING Minds could NOT find the equation Formally, TRY as WE MIGHT...!!! :-(

AND I woke up EARLY in the MORNING, n sat Listening to SONGS....without THINKING about it, & LO & BEHOLD..!!!!!
I suddenly "got" the way to find the equation fer the 3D case that we were SO desperately TRYING to "derive"!  ["The 'EUREKA' PHENOMENON" :-) ]

Anyways, Don't think that OLL we did was some crazy doodling in our scrap-books, & write some "imaginary" equations & symbols...!!
The beautiful lit'l patterns we discovered have kept us animated n all awake....!!!! <3 :)

I enclose below few pics of some Mathematica-l  "doodles" I did immediately yester-night in order to "visualize" & "verify" our Mathematical results. :)

And I must say, I'm pleased as punch with them all! :)
[Coz these drawings are "driven" by the mad doodling n equations we friends scribbled all night...!! :P :) And the results just made us smile with joy !!  


The Very Spirit of SCIENCE...! <3 --Prediction("Guesses"), Observation/Experimentation, and Refinement of the Prediction/Guess...! :) ]
Click below on the pics to see clearly:
SCENARIO --> 001

[2D-Case...2 circles against the axes...! :)]
 






 













And now fer the 2 scenarios for pa(r/c)king "balls"....! :P :)


SCENARIO --> 002

[Pa(r/c)king "on the Edge"]





















SCENARIO --> 003
[Pa(r/c)king in the Corner] 
















 


At-LAST, we could say, Ball-e Ball-e [fer the un-initiated, this is an oft-used phrase used in Punjabi songs which are known fer their peppy music..!]...!! :P

...Or...should i call it "BALL-PARK-ing" ?!?! ;-) 

LOL..!!!


TC, n Keep Smilin'....


Love n Best Wishes,
The boy in "rags"

 
Planet (H)eart(H)

Monday, December 26, 2011

Mountain (de)Range(R/D)s...!! :)

Making Mountains out of a mole-hill...! ;-) :)

It was Christmas, & I was lazing around with my friends in the utter cold weather...

And my dear friend Prashant "woke me" up with some of his suggestions on making 'nice-looking' mountain-ranges when he happened to see my following creation, which is essentially a Mathematica(l) plot of Sin(2x)+ Cos(2y) where both x & y are in the closed-interval [0, 3 Pi][click the pic below to see better! ]
















He wondered if we can have better approximations to real mountain ranges...

And that got me thinking...(& literally, rummaging the cup-boards in my memory-p(a)lace (a dingy hut rather..!! :P))...

And soon, i found something interesting, an utterly simple way of making mountains...based on pairs of Parentheses which can be nested together as well as shown below...[click the pic below to see better! ]
















I was working on an alternative way of making mountains out of "strings' while my dear friend Prashant came up with this beauty (http://on.fb.me/vOOgx0)... :)

Jusst made my own, "verbose" (like me moron..!:P) version...which is more like instructing a robotic arm(or a child) to draw the mountains, with a simple rule as below:
  • Traverse the string of brackets...given as input
  • If you encounter a "(", ASCEND i.e., draw a line moving towards the UPPER-RIGHT hand corner.
  • Else (if it is a ")"), DESCEND i.e., draw a line moving towards the LOWER-RIGHT hand corner.
Here's the output of my baby Mathematica(l) program: [click the pic below to see better! ]











As I came running DOWN the Stairs & shared with Prashant [it's always the Eureka! phenomenon, albeit with my clothes on..! ;) ], the thing of JOY (& BEAUTY!) that I discovered, & want to point out in this 'technique', is that it is a "look-see" device, or a sort of visual "check" fer whether a string of parentheses are properly 'balanced' or NOT! :-)
[
The simple heuristic/observation is that the brackets are 'okay' if the mountain-ranges reach 'back to ground-zero' i.e., the same height that they started out with/frem!

This assumes that the input-string begins with a "(" else, a trivial counter-example is : "())(" -- Can you see why..? :P
]

Any sort of 'imbalance' in the brackets, gives rise to a 'limping' Mountain-range...!:P

I request you to please check it out yourself!

The beauty of this is the utter simplicity; NO Need of sophisticated programs, nothing..!! :)

Even a child can doodle it & discover...& create a infinite number of mountain-ranges of different shapes & sizes...!

Note the following points:
  • The deeper the nesting, the taller the mountains become.
  • Also, YOU can 'guess &/or calculate & prove' the relationship between the TOTAL number of bracket-pairs & the TOTAL possible number of ways in which a 'proper' mountain range could be created.
Feel FREE to EXPLORE & share...!! <3 :)

Cheers, to the weird werld of Patterns around (which includes u (s) ! ;-) ...! ♥ :)

Merry X-mas & a Wonder-Filled Happy New Year to YOU n oLL your dear ones..!

Take care, & Keep Smiling, AL(L)-ways..!

Love & Best Wishes,
The boy in "rags" :-)













"Math is sometimes called the Science of Patterns."
: Ronald Graham




Wednesday, December 21, 2011

Randomness_001

Coins...Fer a Change...!! :)


Was feeling 'lost'...and then decided to pay ettention to my thoughts....

I was thinking randomly...a lot about random numbers... 
(Hmmmm....i've not yet stopped...nor will I ever...hahaha!)

You can't imagine the MAGICAL things that lurk behind a seemingly RANDOM Universe....!

As one of my thoughts encouraged me to do, I took out a coin...& flipped it...
(yeah...Cricket -match coin-TOSS! :P )...

And as it turns out...fer a few tosses, it appeared to be biased towards HEADS or TAILS...
[Out of 10 chances...7 will be heads, or even 8 or 9 will be tails...!]

But then, I imagined....
WHAT if...what if I extend this tossing OVER & OVER & OVER egain....& egain..!?!?

In the short-term...we may feel the Universe/God is biased...but over a Loooong term...there is JUSTICE..n EQUALITY (of Probability..)..?? :P

So armed with this thought...and tonnes of emptiness....i sat blinking before my monitor....waiting....fer the magic to happen...

And happen it did...!!

Before long, between my work....I had whipped up a couple of lines to show me graphically the results of 1,000 coin tosses...to help me 'see'...

And the results...are (t)here fer YOU to see...! :)
  • n(heads)  = 504 
  • n(tails)    = 496
{ Click on the picture below !} 












    Moral: EVEN a state of ORDER has CHAOS & Randomness underneath...! :) 
    It is just amazing HOW a seemingly random set of events...can aggregate and 'appear' to be 'orderly' to our Mind/Brain...! 


    Is it not pa..? :)


    Phew..! :)

    Love & Best Wishes,
    The boy in "rags"

    Sunday, July 3, 2011

    A RuN to Remember...

    Stairs to Heaven...!


    June-17, 2011. 
    It was the birthday of Miss Sinda & Dinsa, my dear friends at the office...
    Apart frem being identical twins their names are anagrams of each other, & their b'day is a Prime (17) , with their star-sign's constellation being Gemini which also stands fer twins..!! This really made me ponder & smile a bit..


    June-15, 2011. 
    Another good friend of mine Amod Pandey, had posted a pic of him completing a marathon in the city of Bangalore. But due to heavy work at the office, I hadn't noticed it at till, late in the night of June-17, 2011(Friday), while was doing some official work at home, I just see it...& smile...!
    ...but was feeling a bit feverish & dizzy.


    The number on his shirt, caught my attention---3649.
    Well, suffice it to say that it drove my impending sleep away, as I began to find patterns in it, & ask my-self a barrage of questions like what is the smallest number with such a pattern, etc...!


    June 18, 2011.
    Sunday. Got reminded by mom that it was Fathers' day ! 
    By now, I had devised a series of numbers with such a pattern...as I saw last night.
    I secretly wanted to gift my Pappa something he'll feel happy about--because, he's always stressed the importance of Math ever since I was a child.



    And the previous night, I had also submitted my series of numbers to an extensive online search program which would apply all kinds of heuristics & algorithms to check & ensure if this series that I had stumbled upon, was indeed a NEW one, or else the proverbial, old-wine in a new bottle...! Luckily, I received confirmation that the series was indeed NEW..!


    Along with this confirmation came the need for lots of formalities---I was asked to fill detailed forms about myself, & provide description about the series, & even give a program to compute the first 'n' terms of the series...[Else, anyone could reel off some random numbers & name the resulting series fer him/her-self... :)) ]


    Anyways, I did that, & was asked to make some subtle changes in my documentation, which I did too.
    The series I had submitted was now in the 'proposed' state---awaiting detailed analysis by REAL mathematicians & scientists behind the Online Encyclopedia of Integer Sequences, who would take the final decision...


    Anyway, I immediately fergot all about it---and with absolutely no expectations about it, went to sleep....


    The next morning, at office, I was very pleased to find a mail stating that my series had indeed been APPROVED & ALLOCATED...!!!


    My lit'l Discovery had changed its status frem PROPOSED to APPROVED...!!


    Mine is the 1,91,867'th series 'registered'---though it is actually a kind of generating function for an infinite(?) number of new similar series...! [I only considered n=2 fer now, since the square has always had mysterious applications w.r.t. the Universe around us...!]


    That said, there are TONS of questions to be explored like the following :


    a) The beautiful stair-case-like graph(s) of the members of this series...
    Click on the below graph if you want to see a sample..! :)














    { Notice the unusual structures on the graph ?? Well, i purposely strove hard to make it look like the stamen (with those peculiar anthers !)of a Hibiscus flower ! :-) How ?? By using the Greek small letter 'theta' as the plot 'marker'...! ;)) }




    b) Is the series INFINITE...???? Fer ANY value of n ??
    [My conjecture is that it IS...at-least fer n=2]



    c) Any 'weird' places where this series 'pops-up'...??


    Well, those r interesting points to ponder about....


    And the below lines express my feelings very aptly..












    Love & Best Wishes,























    Sunday, May 8, 2011

    Shear Magic...! <3 :)

    Hi pa!!


    Well, one of my friends Shreyas, had shared a link on the topic of matrices in general, & there they had shown a very interesting "shear" transformation of the image of the famous MonaLisa of Leonardo Da Vinci.


    Here is that image...courtesy Wikipedia ( Click this link )


    And I had promised that I too would try n somehow do that on my own...!!
    Because, I felt, with my Wishful Thinking, that OLL it needs, is a matrix representation of the image in question, & then, apply a 2X2 or 3X3X3 "transformation" matrix on it...! :)


    And I shut myself up, trying this way & that...checking if there's a very simple representation I could work with...but all my efforts had either gone astray or in vain...into the drain...!! :-(


    But all of a sudden, teday, (on the eve of Mothers' Day..!?!?) I was able to JUST Do it..!! :)


    And hence, without much ado, let me SHARE this sheer miracle..!!
    [Note: SHEAR & SHARE are anagrams of each other! Howzzthat..?? :P]



    Fer this experiment, I decided to use the snap of the beautiful Maria Sharapova--guess she's lucky enough to be chosen by Me fer some image make-over(s)..!!? ;) 


    BEFORE the SHEAR: (As-is, in fact the "shearing" parameter is all zeroed out..!) 
    -----------------------
























    AFTER a +ve SHEAR in the horizontal (x-axis) direction
    -----------------------























    AFTER a -ve SHEAR in the horizontal (x-axis) direction
    ------------------------




















    Hope u liked it pa..!??! :)


    As fer me, i jusst LOVE--D it...(including the snap of Maria too..! ;) Sorry Maria...but thanks fer your b'ful snap & fer bearing with this...!! :) )


    Thus, with some stubborn determination & image-ination, we can always manage to do some "transformations"...!! :P


    Keep Smiling....AL(L)-ways...! :-* :)


    Love & cheers,
















    the moron in "rags"
    ---------------------------------
    Note: As a follow-up to this, I was able to extend it, & achieve a 3-D shear also..by setting up a nice, 3-dimensional [3X3X3] matrix.
    But I feel the 2-D shear illustrates it just fine enough... :) 

    ====================================================
    Here's one of my favourite oxy-moronic quotes in this context... :) 
    I close my eyes, in order to "see"...
    - Paul Gauguin
    ====================================================











    Tuesday, March 8, 2011

    Thanks to Mommy :)

    A cup of Tea,an idea,and...voila! :)

    Yesterday…as I was getting ready to go home early, I got stuck up with some office-work, & ended up having to wait for almost an hour for a bus in which I could jostle & finally reach home…

    Not surprisingly, mom was peeved at me for not being home “on-time” ;she waits fer me everyday, just to have a tea with me...!
    {My Pappa does not drink tea or coffee. And that leaves only me fer her company…!}

    But soon, seeing how tired I was, her anger melted & turned to affection, and before I knew it, I was sitting before the TV with a steaming cup-o’tea, dunking & savouring bread slices, regardless of the fact that it was almost dinner time for the rest of the world.. :)

    And then, I had dinner with Pappa & Mommy, but during dinner, there was talk about the world, & various countries, etc. And Mommy became especially curious to know if we could easily get every country’s name, along with its capital-city. 
    {
    She seemed impressed at first when I told her the place where my dear friend Siva Prasanna is currently staying, called Dar Es Salaam, is the capital of Tanzania in Africa. She then suspiciously asked if I knew all the countries & capitals of the world, or if I was just bluffing. Hahaha. Nobody seems to believe me-moron..? :(
    }

    That’s it...! :-)

    The unexpected cup of tea, and my Mommy’s curiosity had their effect…!

    I quickly ran into my room, to my lappie…& came up with a 2-line (yes ! Just 2 lines!!) code which created this magical image… J

    It has a list of 237 countries, their capital cities & their flags & even their shapes respectively...!

    {Click on it..., better save it & SCROLL & view with a program like Google's Picasa..!! J}


    Tried..??
    I know...the image doesn't even appear at its normal size right..? 
    Thanks a ton to a few of my friends fer pointing it right away to me-moron. 
    "Only your real friends tell you when your face is dirty.", as my one of my oft-quoted saying (a Sicilian proverb) goes.:-) 


    Here's the LINK fer the image to download & view properly..! :)

    The strange thing is, I took hardly 5 minutes to cleverly set up those 2 lines…but took an additional 20 minutes to get my CRAZY COLORs, FONTS, etc…! J


    Some interesting points to note:
    1. The font I wanted ( & managed to get!) is simply country number 138 J
    2. The map of Egypt (number 60) has a near perfect right angle…looks like a right-angled triangle… J
    3. The flag of Isle of Man (number 100) is so interesting, and unusual.

    This then, is THANKS to YOU Mommy...!! :-)

    Love & Best Wishes,

    The boy in 'rags'
    Planet Earth
    ----------------------------
    "The best academy-a mother's knee."
    :- James Russell Lowell
    ----------------------------