ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Square Division Coding Challenge

Given a square having side length n(where n is positive integer). Write a program to find the smallest number of sub-squares having also positive integer side length, in which the given square can be divided.
Examples:
- n = 2, 4 squares of side 1;
- n = 3, 6 squares (1 of side 2 + 5 of side 1);
- n = 5, 8 squares (1 of side 3 + 3 of side 2 + 4 of side 1)

Regards,
Giridhar Rajan
0 Kudos
Message 1 of 10
(6,821 Views)
I assume you want to revise this challenge to exclude the obvious answer. Every square of side length n can be divided into one square of side n. That is the smallest number isn't it?

Message Edited by Jarrod S. on 10-26-2006 11:56 AM

Jarrod S.
National Instruments
Message 2 of 10
(6,805 Views)


@Giridhar_Rajan wrote:
Given a square having side length n(where n is positive integer).



Actually, I'm more interested in seeing a square with a side length that's a negative number. Now that would be interesting! Smiley Very Happy

Message Edited by smercurio_fc on 10-26-2006 12:37 PM

0 Kudos
Message 3 of 10
(6,789 Views)
Hmmm... Given the rating somebody gave to my post, guess somebody out there doesn't have a sense of humor.
Message 4 of 10
(6,777 Views)


@jarrod S. wrote:
Every square of side length n can be divided into one square of side n.
But... would you still call it a sub-square? 😄
Message 5 of 10
(6,748 Views)
I'm a math major, and we learned first and foremost that there's no conflict of having a set be a subset of itself. Only being a proper subset indicates that the inclusion doesn't work the other way.

Another part of being a math major was looking for the most trivial answers like this to avoid "real" thinking. 🙂
Jarrod S.
National Instruments
Message 6 of 10
(6,735 Views)


@jarrod S. wrote:
Another part of being a math major was looking for the most trivial answers like this to avoid "real" thinking. 🙂

A trivial answer deserves trivial code. I was able to significantly simplify your overly complex program. 😄 Just wrap it into a subVI.

I guess somebody will now complain that I allow negative numbers. 😞 Just change the representation to U64 for the most versatile code.



Anyway, back to the problem at hand. Basically, we are looking at a program to compute sequence 018835:

http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=018835

There are a few web sites that deal with this problem and writing a solver in LabVIEW seems like a nice challenge.

Here's one I found:

http://www.stetson.edu/~efriedma/mathmagic/1298.html

We are looking for g(n).

Message Edited by altenbach on 10-26-2006 03:18 PM

Message 7 of 10
(6,730 Views)
Guys,

I would like to see a solution in the form of a VI rather than links. Thank You. The Challenge is still open,

Regards,
Giridhar Rajan
0 Kudos
Message 8 of 10
(6,656 Views)
Typically, a LabVIEW coding challenge is an open contest with a submission mechanism, rules, and deadlines, and prizes.
 
 
This is not an easy problems and would require significant effort, especially if a grapical display of the solution is desired. If you just want us to do your homework, I guess you're out of luck. What exaclty are you looking for?
Message 9 of 10
(6,624 Views)

hi giri

falgandha here.

i am also in labview and working on dsc module for data aquasition. Where are u and what r u doing?

i want to know more about application control vi which are used in labview in briefly like open vi reference, call library node etc. Can u help me?

 

falgandha mohire

0 Kudos
Message 10 of 10
(6,433 Views)