LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 19 Feb 2008 16:08:56 -0500
Reply-To:     Nathaniel.Wooding@DOM.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject:      Re: SAS Certification
In-Reply-To:  <000601c86feb$da8c61d0$0401a8c0@zencos.com>
Content-Type: text/plain; charset="ISO-8859-1"

Don

I, too, enjoyed seeing this solution since it is so nice and compact but I am going to differ a bit with you about its usefulness in evaluating a candidate. My main concern is "How many SAS programmers actually are aware of this bit of mathematics". I have encountered it in conversation at least once post college but in my four years of college math, I do not ever recall hearing of it. I just checked one of my reference texts -- Tables of Integrals and other Mathematical Data published by Macmillan and do not see the general formula. They do offer

1 + 3 + 9 + ... + (2n-1) = n**2

which just happens to be what we need for our situation and the author offers

1 + 8 + 16 + ... + 8(n-) = (2n - 1)**2

It may well be found in some other reference such as the Handbook of Chemistry and Physics but how many SAS programmers keep volumes like these on their shelves and how many happen to have encountered it in some class or elsewhere?

I would be impressed if a candidate were to offer the short, formulaic solution, but I would be equally happy if someone who presented excellent knowledge of the subject matter that was being analyzed could also write one of the brief programmatic solutions that we saw.

Just my 2 mills.

Nat

Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977

Don Henderson <donaldjhenderson @HOTMAIL.COM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject Re: SAS Certification

02/15/2008 11:00 AM

Please respond to Don Henderson <donaldjhenderson @HOTMAIL.COM>

Well done Peter. I was about to post something similar and include no code at all. Like you, I was going to leverage the series summation technique developed by Gauss where the sum of any series of numbers is the average of the numbers time the number of numbers.

For this case the average is 50 (e.g., (1+99)/2 = 50, (3+97)/2 = 50, and so on). And there are 50 odd numbers. So the answer is 50*50 = 2500.

I agree with Alan's earlier point about problem solving skills. And a very important part of that is to learn when you need to write a program. For this problem you don't need a program; you need a formula.

In the past when I've done this (in my case dating back to the late 70s, early 80s), if someone answered such a question by writing a program I would have followed up and asked if a program was necessary.

An important issue to address is to interpret what is needed - which is not necessarily the same as what is requested.

Regards, -donh

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Peter Sent: Friday, February 15, 2008 9:58 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: SAS Certification

On 15 Feb, 12:07, jbos...@OPTONLINE.NET (Jules Bosch) wrote: > Probably the simplest/best solution. > > > > -----Original Message----- > From: toby dunn [mailto:tobyd...@hotmail.com] > Sent: Thursday, February 14, 2008 10:34 PM > To: Rushi Patel; sa...@listserv.uga.edu; jbos...@optonline.net > Subject: RE: SAS Certification > > Data _Null_ ; > > Do I = 1 To 100 By 2 ; > X + I ; > End ; > > Put X= ; > > Run ; > > Toby Dunn > > "Don't bail. The best gold is at the bottom of barrels of crap." > Randy Pausch > > "Be prepared. Luck is where preparation meets opportunity." > Randy Pausch > > > Date: Thu, 14 Feb 2008 22:19:09 -0500 > > From: rushi_pa...@FREDDIEMAC.COM > > Subject: Re: SAS Certification > > To: SA...@LISTSERV.UGA.EDU > > > data temp ; > > do i = 1 to 100 ; > > if mod(i,2) ne 0 then sumodd = sum(sumodd,i) ; end ; put sumodd ; > > run ; > > > 38 data temp ; > > 39 do i = 1 to 100 ; > > 40 if mod(i,2) ne 0 then sumodd = sum(sumodd,i) ; > > 41 end ; > > 42 put sumodd ; > > 43 run ; > > > 2500 > > > Jules Bosch > > Sent by: "SAS(r) Discussion" > > 02/14/2008 09:41 PM > > Please respond to > > Jules Bosch > > > To > > SA...@LISTSERV.UGA.EDU > > cc > > > Subject > > Re: SAS Certification > > > Well done, Guido, yes, the SAS date value for Jan 01, 1960 is '0' > > > Now, here is a simple question I asked in the interviews: Can you > > write a SAS program that will calculate the sum of all odd numbers > > between 0 and 100? It takes a little thought at first, then, the > > pieces should quickly fall into place. > > > Jules > > > _____ > > > From: Guido Sagasti [mailto:guidosaga...@yahoo.com.ar] > > Sent: Thursday, February 14, 2008 9:03 AM > > To: Jules Bosch > > Subject: Re: SAS Certification > > > Jules: > > > I'm Guido from Argentina. I've been using SAS for 8 years, and I > > think that the best way of learning SAS is using it. SAS is very big > > to know all SAS programming tips, solutions, etc. > > I went to an interview a year ago for Schering and they sent me a > > mail with exercices and I completed it ok. It wasn't easy. I've > > never seen a lot of things I had to do to pass it. But if you want > > quality you need people capable to research, find solutions (with > > manuals, sas online doc, sasL, > > etc.) > > > I didn't pass the last step of the interviews of schering (the > > manager selected other person), but he recommended me to SAS > > Argentina, the place where I''m working as consultant. > > > About SAS Certification... can be a way of learn a lot of > > programming things, but it's not only the way to know SAS and If you > > give the exam and not practice later you are going to forget all. > > This year I made my first oficial sas programming course and I > > realised that I knew more than I think... > > > Sorry about my english (in Argentina we speak spanish) > > > Guido. > > > PD: SAS date Jan 01, 1960 = 0. :) > > > Jules Bosch escribió: > > > A few years ago on a consulting assignment with a pharmaceutical > > firm, I was asked to interview prospective SAS programmers. Over a > > three or four week period, I interviewed maybe ten candidates. Most > > of the questions I used in my scripted interview document came from > > the SAS-L archives. > > > What surprised me was that most of the candidates could not answer > > some of the most fundamental SAS questions. For example, the numeric > > value of the SAS date Jan 01, 1960. Nor could anyone of the > > interviewees, for example, describe the _N_ automatic data step variable. > > > What surprised me even more was the fact that most of the candidates > > were SAS V8 certified. > > > _____ > > > Yahoo! Encuentros > > Ahora encontrar pareja es mucho más fácil, probá el nuevo Yahoo! > > Encuentros. > > Visitáhttp://yahoo.cupidovirtual.com/servlet/NewRegistration > > _________________________________________________________________ > Connect and share in new ways with Windows > Live.http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharel > ife_...- Hide quoted text - > > - Show quoted text -

Sum of the odd numbers..... Iterate, or what?

Toby showed the iteration : >From: tobyd...@HOTMAIL.COM (toby dunn) >Date: Fri, 15 Feb 2008 03:34:19 +0000 >Local: Fri 15 Feb 2008 03:34 >Subject: Re: SAS Certification > >Data _Null_ ; > Do I = 1 To 100 By 2 ; > X + I ; > End ; > Put X= ; >Run ; > >Toby Dunn

I like doing it straight, in the %sys environment The problem looks like a variation of the sum-of-a series ( sum = n/ 2*(n+1) ) ; Just take half, and adjust ..... %let top = 100 ; %put odds = %sysevalf( &top/2*(&top +1 ) /2 -&top/4 );

What is stunning is the shape when you see it in excel. This also works %put sumod %sysevalf(%eval((&top +1)/2)**2 ); The sum of odds up to the n-th odd number is n**2

I'm still trying to get the mathematical picture in my head !

PeterC

----------------------------------------- CONFIDENTIALITY NOTICE: This electronic message contains information which may be legally confidential and/or privileged and does not in any case represent a firm ENERGY COMMODITY bid or offer relating thereto which binds the sender without an additional express written confirmation to that effect. The information is intended solely for the individual or entity named above and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.


Back to: Top of message | Previous page | Main SAS-L page