SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
Cuchulainn
Posts: 60470
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

circle-ellipse inheritance problem

February 17th, 2016, 7:09 pm

QuoteOriginally posted by: outrunI can arrange a C++ job interview if you want to take notes...Is that how you got the job? One thing: the last job interview I did as interviewee was 1986, so I am a bit rusty. But you know it all how it goes, outrun? Do I need a middleman? I am very interested in seeing how people behave in such situations.
Last edited by Cuchulainn on February 16th, 2016, 11:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik
 
User avatar
Cuchulainn
Posts: 60470
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

circle-ellipse inheritance problem

February 17th, 2016, 7:22 pm

QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: outrunI can arrange a C++ job interview if you want to take notes...Is that how you got the job? One thing: the last job interview I did as interviewee was 1986, so I am a bit rusty. But you know it all how it goes, outrun? Do I need a middleman?I just get these crazy emails all the time, and today I forwarded one to you because I thought you were a bit bored. Kicking cans here at the forum.I though Cuch needs a therapy job to keep him busy, and some colleagues of course.Very kind, it is on my own time;) You spent a while here as well;)
Last edited by Cuchulainn on February 16th, 2016, 11:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik
 
User avatar
Cuchulainn
Posts: 60470
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

circle-ellipse inheritance problem

February 24th, 2016, 7:29 am

If we ignore the OOP/CS approach (which leads to inheritance), we can ask the more general question "What is the relation between an ellipse and a circle?" None, really, but an ellipse can be mapped to a circle as inRiemann Mapping This approach is similar to transforming Black Scholes PDE with mixed derivatives to one without (the so-called canonical form). Ellipses and circles are _distinct_ well-defined mathematical concepts and redefining them to fit into a software paradigm leads to issues (IMO). Circle ~ Laplace PDEEllipse ~ Black Scholes PDE
Last edited by Cuchulainn on February 23rd, 2016, 11:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik
 
User avatar
Traden4Alpha
Posts: 23951
Joined: September 20th, 2002, 8:30 pm

circle-ellipse inheritance problem

February 24th, 2016, 1:52 pm

Hmmm..I'd say that any time one ignores relationships between objects, one has issues, too.Each individual ellipse is also a _distinct_ well-defined mathematical concept. Yet we intentionally ignore that distinctness in order to manage the many as a one. It's then a matter of taste and the particulars of the application that lets one say circles might also belong in the set of ellipses because mathematically, the set of all circles is a subset of the set of all ellipses.And within the set of all possible ellipses, there exist subsets of ellipses with special properties. Circles might be one subset. Isometric projections of circles might be another subset. Ellipses defining gears of pitch, P, might be a third. Mathematically, all those shapes are ellipses in that they are defined by a second order equation. Yet in some ways they are not ellipses.At issue is the set of "admissible transformations" for each of these subsets. A generalized ellipse can be rotated, scaled, and squashed (change in aspect ratio) arbitrarily. Circles can be scaled but not squashed and rotation does not make any sense. Elliptical gears can be squashed or rotated but arbitrary scaling is impossible (only very specific values constrained by the gear pitch are valid). Isometric projections of circles can be scaled but cannot be not squashed arbitrarily nor freely rotated.Yet even if one considers circles, isometric projections of circles, and elliptical gears to be distinct from general ellipses, they can all use the same graphics software routines for drawing them on the screen even if they can't all share the same input widgets for creating and changing them.
 
User avatar
dd3
Posts: 246
Joined: June 8th, 2010, 9:02 am

circle-ellipse inheritance problem

February 24th, 2016, 2:53 pm

QuoteOriginally posted by: billyx524hi,i was recently asked during an interview if a circle class can inherit from an ellipse class. my thinking was that since a circle is a special case of an ellipse, then it should be allowed. but the interviewer said no. I find this to be subjective. Is there a right/wrong answer to this question?I hope you demonstrated the similarities between circles and eclipses to the interviewer by roundhouse kicking them in the head repeatedly.
 
User avatar
Cuchulainn
Posts: 60470
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

circle-ellipse inheritance problem

February 24th, 2016, 3:05 pm

QuoteOriginally posted by: outrunA line can be mapped into a 3d spherical volume, a square into a circle, a circle into the nostril of Rodin's Thinker. This mapability is not something that implies a special relation between a circle and an ellipse.Well, no. how do you map a square onto a circle? I bet it can't be done using elementary functions. There is a special relationship, but you don't think there is? The very fact that there is a mapping implies there is a relationship between ellipse and circle. The key issue wait the kind of mapping. I leave the nostril to you.
Last edited by Cuchulainn on February 23rd, 2016, 11:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik
 
User avatar
Cuchulainn
Posts: 60470
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

circle-ellipse inheritance problem

February 24th, 2016, 3:22 pm

QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: outrunA line can be mapped into a 3d spherical volume, a square into a circle, a circle into the nostril of Rodin's Thinker. This mapability is not something that implies a special relation between a circle and an ellipse.Well, no ? how do you map a square onto a circle? I bet it can't be done using elementary functions. There is a special relationship, but you don't think there is? The very fact that there is a mapping implies there is a relationship between ellipse and circle. The key issue wait the kind of mapping. I leave the nostril to you.google the circle<->square mapping. it's easy. other keywords are "space filling curves" I think you are confusing fractal geometry with the problem at hand. The topic is not about space filling.
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik
 
User avatar
Cuchulainn
Posts: 60470
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

circle-ellipse inheritance problem

February 24th, 2016, 3:44 pm

QuoteOriginally posted by: dd3QuoteOriginally posted by: billyx524hi,i was recently asked during an interview if a circle class can inherit from an ellipse class. my thinking was that since a circle is a special case of an ellipse, then it should be allowed. but the interviewer said no. I find this to be subjective. Is there a right/wrong answer to this question?I hope you demonstrated the similarities between circles and eclipses to the interviewer by roundhouse kicking them in the head repeatedly.Of course, don't flatten it too much (b = 0).
http://www.datasimfinancial.com
http://www.datasim.nl

Approach your problem from the right end and begin with the answers. Then one day, perhaps you will find the final question..
R. van Gulik
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On