« Previous day (Mar 16, 2007) | Main | Next day (Mar 18, 2007) »
http://blogs.sun.com/insidemyhead/date/20070318 Sunday March 18, 2007

Percentages Applied Successively ...

Came across a nice simple problem but an alternative insightful solution to it as well. I quite liked it. So posting it here.

Wanting to buy a coat, Lisa is faced with a dilemma. Two competing stores next to each other carry the same brand coat with the same list price, but with two different discount offers. Store A offers a 10% discount year round on all its goods, but on this particular day offers an additional 20% on topof its already discounted price. Store B simply offers a discount of 30% on that day in order to stay competitive. How many percentage points difference is there between the two options open to Lisa? Which one should she go for?

 

Discussion

Assume the cost of the coat to be 100,calculate the 10% discount,yielding 90 as the price,and an additional 20% on 90 (or 18) will bring the price down to 72. In store B, the 30% discount on 100 would bring the price down to 70,giving a discount difference of 2,which will be 2%.

Correct procedure. But came across another insightful way :

Here is a mechanical method for obtaining a single percentage discount equivalent to two (or more) successive discounts.

1. Change each of the percentages involved into decimal form: .20 and .10.
2. Subtract each of these decimals from 1.00: .80 and .90
3. Multiply these differences: .8 * .9 = .72

4. Subtract back from 1.00: 1.00-.72 = .28

5. Convert it back to percentage i.e 28%

So the store A's successive discounts of 20% and 10% is actually a cumulative discount of 28%. The store B's discount is 30%. The difference again as proven earlier is 2%.

This procedure not only streamlines a typically cumbersome situation,  but also provides some insight into the overall picture. For example,the question "Is it advantageous to the buyer in the above problem to receive a 20% discount and then a 10% discount,or the reverse,a 10% discount and then a 20% discount?". Since the procedure shown above clearly indicates that the calculation is merely multiplication, a commutative operation, we can immediately tell that there is no difference between the two. 



Posted by insidemyhead [Personal] ( March 18, 2007 06:42 PM ) Permalink | Comments[1]

Rich Internet Applications (RIA)

I am a strong proponent of having a nice user interface, since it is the first thing the end users see about your product. I feel that we must have a strong understanding on the importance and effectiveness of a user-experience that enables our consumers/customers/users to perform their tasks with applications that are not only useful, but usable and desirable. In my opinion the same, if not more amount of time MUST be spent on designing the UI of your application, as the backend. So as the web has evolved over the past few years a lot of importance is being given to rich and responsive user interfaces. So essentially what I am talking about is the world of Rich Internet Applications (RIA) and that is the topic of today's blog.

In my previous blog entries I talked about using the Google Web Toolkit modules in your portlet projects. GWT comes with a very capable rich set of user interface widgets and you can add responsiveness to your application by AJAX enabling them. GWT provides you AJAX functionality by writing absolutely 0 JavaScript code. You write your code in Java, and the GWT toolkit comes with a compiler which compiles your java code to JavaScript. Now that was cool!

What is a RIA?


Let us understand using an analogy. My car insurance had expired and I called up the insurance company to find out how I could pay the renewal premium. I was very happy when I was told that they had an online payment facility wherein I could just fill in my details and renew my policy. So i started the process, I was taken through a set of
4 pages, at each stage asking me to fill in details and then pressing the next button to go to the next page. Each refresh taking some time, I couldn't go to the next page till I completed what I was asked for on the current page.

It asked me stuff like my VIN number, License Number etc, which I didn't have handy at that moment. What I would have really liked is to go through all the pages finishing the entries for which I had answers at the moment and then go back and fill up all the "hard" ones. ;-) But tough luck there. There are other issues with typical web interfaces, losing data due to back navigation or re-POST of data, losing data due to session timeouts etc etc. These are all problems being caused due to technical limitations of the 'typical' web.

RIA typically tries to solve this problem from the end user's perspective. Rich Internet Applications replace these multi-step, complex processes with simpler, easier, more effective singlescreen or guided-completion processes.

As I am talking about rich internet user interfaces, another one I had been wanting to try my hands for a long time was Macromedia's Flex and ActionScript. Ofcourse, now it is Adobe Flex after the acquisition but I was and still am impressed with Macromedia. That was one great company with some amazing products. With the version 2.0 of Flex now available and lots of new cool stuff added, I thought of giving it a try. For begining your Flex journey all you need is



Flex Builder installs as a plugin for Eclipse and hence the need for Eclipse. The Flex Builder provides you with a Flex Development , Flex Debug perspective and a Visual Designer for building Flex Applications. Ofcourse there is the Flex compiler which will compile your Flex application from within the IDE.


As an alternate you can also download the Flex SDK and use that to compile your Flex Applications, but you won't get the many benefits of using an IDE... Choice is yours.


I have worked a lot with Macromedia ColdFusion (Adobe now!) earlier and being a ColdFusion developer I know how powerful rapid development can be and how much of a difference that makes when building dynamic Web applications. That is exactly what Flex brings to you for developing user interfaces for the Web. Really nice looking widgets and containers, very easy to build using the Flex Builder, pretty much drag and drop.

I don't know about you, but I am off to building my Flex Application!



Posted by insidemyhead [Sun] ( March 18, 2007 04:36 PM ) Permalink | Comments[1]