|
A hint on the procedure.
You should maximize the sum of the rectangle areas with some constraint (hence the use of Lagrange multipliers).
You requirements give the following constants (supposing all rectangles have the same size):
N the total number of rectanglesw and h , giving the ratio of each rectangle, i.e. ratio w:h W and H , the width and the height of the bounding rectangle
and the following variables
r the number of rows of the rectangle gridc the number of columns of the rectangle gridx defined so that x*w = rectangle width and x*h =rectangle height
You should maximize the total area, i.e. N*h*w*x , while obeying to the following constraints:
N = r*c W >= c * w * x H >= r * h * x
Using (generalized ?) Lagrange multipliers you may write the function L :
L(x,r,c,j,k,l) = N*h*w*x - (r*c - N)*j - (c*w*x - W)*l - (r*h*x -H)*k
where j,l,k are the Lagrange multipliers.
Now you've to find an extreme of it (i.e. all first derivatives with respect the parameters x,r,c,j,k,l should be zero) and verify it's a solution for your problem.
I hope I didn't make silly mistakes.
Good luck.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
No mistakes. This should give him what he wants!
|
|
|
|
|
Thank you for revising it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I thought I'd do the math myself. This is a useful problem for rectangle packing.
(Haven't had time to do it just yet)
|
|
|
|
|
How about if the rectangle is 750x325? Assume the material is uniform so that a 3x4 and 4x3 rectangle are equivalent. What's the optimal way to get 32 rectangles then?
|
|
|
|
|
You're a friend of skelet0n, aren't you? Given the algo [^], you can easily figure out the result (you've just to change N from constant to variable).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You're a friend of skelet0n, aren't you? Given the algo [^], you can easily figure out the result (you've just to change N from constant to variable).
No, I'm just me. If rotation is allowed, however, the algorithm given won't take optimal advantage of it. For example, the dimensions I gave allow 30 rectangles of size 100x75 or 75x100 to be placed, but only if some are rotated 90 degrees relative to others. What would be the optimal algorithm to deal with that?
|
|
|
|
|
Hi I am doing my final year B.Sc.,(Computer Science)
I am doing "Search Engine" as project.
Please any one help me how to get search results of some popular search engine in my own page(ASP.NET)
Thanks in Advance...
|
|
|
|
|
SaravananXSC wrote: Please any one help me how to get search results of some popular search engine in my own page(ASP.NET)
the details are left for the genius to figure it out.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
You're displaying the results of some application in your own page?
What school?
I are troll
|
|
|
|
|
Hi Eddy.. Thank's for your reply..
I am doing my degree in St.Xavier's College, Palayamkottai, India.
I am developing a web based application in which i have to display results from popular search engines according to the keyword entered by the user... The number of results to be displayed must be user's choice..
|
|
|
|
|
Founded in 1923, as it reads. So you're going to use an existing search-engine? Google would seem the be the obvious choice there. They've got extensive documentation on how to do these kind of things here[^].
Your part lies in making the call to the site for the correct searchquery, reading back the results, and displaying those that you want - I don't expect you to have any problems as it's a rather basic task.
Good luck
I are troll
|
|
|
|
|
Well, you could always host google in an iframe.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
I don't get it. You are doing project "Search engine", so I guess you should build your own (prolly simple) engine, right? Some web crawler that would index data etc. And what you want to do is host 1 search engine in your page? Dude..., that's bravery .
|
|
|
|
|
I am doing my degree in St.Xavier's College, Palayamkottai, India.
I am developing a web based application in which i have to display results from popular search engines according to the keyword entered by the user... The number of results to be displayed must be user's choice..
|
|
|
|
|
|
It is really needed me to proof my little cryptographic scheme because of i have used an own created cryptographic scheme to make secure for the mobile data transaction in a database system, and our lectures, who are professional on this cryptography, said "If it is used any created cryptographic algorithm to make secure for something then it would be done for proper cryptanalysis to prove that the algorithm is not hackable and to proof strength of algorithm first then it is possible to say as secure model. Otherwise it is not considered as secure.
I have heard about that cryptographic scheme is built after the mathematic justification is done but it is already done for programing implementation before the mathematic justification on the scheme/algorithm is done because of that time i had no idea about that all. If it is needed to rebuilt the scheme/algorithm again, it really hard for me to restart new one.
Cryptographic algorithm metric literature (1997), I've found, suggested about a few important metrics such as type, functions, key size, rounds, complexity, attack and strength but If it is new modern metric came out ready, i have not found it yet.
It is really needed justification on the proper cryptanalysis to prove that the scheme/algorithm is not hackable and to proof strength of algorithm as well
General detail of the algorithm follows as listed below.
Type: Symmetric
Functions: Confidentiality and authentication
Key size: 256 bit
Round: 3
Complexity: encryption, decryption and key setup include the expansion, bit operations, modular multiplications and modular exponentiations.
Attack: have not started to test it yet.
Strength: not started.
Additional info
encryption and decryption schemes work on numbers only because of data transaction in the database system uses numbers (not text and any other symbols)
Encryption
Input: 32 bits
Output: 128 bits
what need to do is better? If Any body, who are Phd, Prof and experts on the cryptography and were doing this before, please advice me?
Thank you
|
|
|
|
|
Probably easier to prove its broken. Encrypt some plaintext with your scheme and then feed the results into the NIST random number test suite. If your results aren't random then the scheme is probably weak.
|
|
|
|
|
A little bit clarify about NIST random test suite please?
If the scheme used it for generator as a random generator function in class of java programming language then what need to do? It is already proven random generator?
|
|
|
|
|
Take some text, like an ebook or something, and encrypt it with your scheme. If the encryption is strong, then the encrypted text should look random and come close to passing the NIST test suite. If your encryption scheme is weak, it will leave entropy in the output, which the NIST test may pick up on.
|
|
|
|
|
If the encryption scheme works on only numbers, especially limited inside 32 bits input, then how to test it properly?
|
|
|
|
|
Then you encode the data. Pack 4 8bit ascii characters into each word. Normally you'd compress data before encryption too, but in this case its important that you don't.
If your algorithm takes non-random data, encrypts it, and the result doesn't look random (it has things like high autocorrelation), then the algorithm is most likely seriously broken.
|
|
|
|
|
What you said over can be satisfied as proper test?
|
|
|
|
|
No, not at all. If this test fails, then its a very strong sign that your algorithm is weak. If this test passes then it definitely doesnt prove the algorithm in any way...
|
|
|
|
|
Probably easier to prove its broken. Encrypt some plaintext with your scheme and then feed the results into the NIST random number test suite. If your results aren't random then the scheme is probably weak.
A consistent failure to pass randomness tests would imply cryptographic weaknesses, which would likely be exploitable. On the other hand, it's possible for a scheme to pass any randomness test one might care to throw at it but nonetheless be cryptographically very weak. Given the availability of strong cryptographic methods, I don't see much point to using weak ones unless one is operating under severe hardware constraints.
Of course, it may well be that the application requirements don't quite match any existing security protocol. If that is the case, I would suggest building a protocol using existing encryption algorithms. Under that scenario, you may be able to prove that the only way to crack the protocol is to crack one of the underlying algorithms. Developing a secure protocol will often be tricky, even given secure algorithms, but with care you may be able to produce a protocol that can be shown to be as secure as the algorithms at its core.
|
|
|
|
|