Minimum number of lines to draw 111 squares7 Trees, 6 Rows, 3 Per Row?The Erasmus dissection of a squareMinimum cells to fill grid without consecutive neighboursFitting the piecesBigger board with the least squaresTurn on all squaresRemoving matchsticks to remove all squaresColoring the Chess BoardRed and White Squares
Talk about Grandpa's weird talk: Who are these folks?
How far away from you does grass spread?
How can I create folders in folders in terminal
Account creation and log-in system
Is Zack Morris's 'time stop' ability in "Saved By the Bell" a supernatural ability?
Unpredictability of Stock Market
How is underwater propagation of sound possible?
As an employer, can I compel my employees to vote?
What is the maximum viable speed for a projectile within earth's atmosphere?
Statistical tests for benchmark comparison
Inquiry answerer
Plot irregular circle in latex
We suspect colleague is stealing company code - what do we do?
(How long) Should I indulge my new co-workers?
Why would a fighter use the afterburner and air brakes at the same time?
Persuading players to be less attached to a pre-session 0 character concept
Minimum number of lines to draw 111 squares
Which version of the Pigeonhole principle is correct? One is far stronger than the other
Social Encounters in a West Marches Campaign
Who are the people reviewing far more papers than they're submitting for review?
What's the purpose of autocorrelation?
Hobby function generators
How would you design and build an American Civil War Steam Gun?
Could the Orion project pusher plate model be used for asteroid deflection?
Minimum number of lines to draw 111 squares
7 Trees, 6 Rows, 3 Per Row?The Erasmus dissection of a squareMinimum cells to fill grid without consecutive neighboursFitting the piecesBigger board with the least squaresTurn on all squaresRemoving matchsticks to remove all squaresColoring the Chess BoardRed and White Squares
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
Find the minimum number of lines to draw 111 squares.
For example you can draw a single square using 4 lines i.e 2 vertical and 2 horizontal.
Similar, you can draw a 2 square grid using 5 lines, and so on.
The solution totally depends on how you smartly draw lines because the same number of squares can be drawn with more or less lines.
geometry optimization
$endgroup$
add a comment
|
$begingroup$
Find the minimum number of lines to draw 111 squares.
For example you can draw a single square using 4 lines i.e 2 vertical and 2 horizontal.
Similar, you can draw a 2 square grid using 5 lines, and so on.
The solution totally depends on how you smartly draw lines because the same number of squares can be drawn with more or less lines.
geometry optimization
$endgroup$
1
$begingroup$
How many squares in 2x2 grid (6 lines)? 4 or 5 squares?
$endgroup$
– npkllr
9 hours ago
$begingroup$
Is it a requirement that the lines are infinite or can I use line segment?
$endgroup$
– Helena
5 hours ago
$begingroup$
Do the lines have to be on an ordinary plane? I can do it with two lines on a mobius strip. :P
$endgroup$
– Spitemaster
5 hours ago
add a comment
|
$begingroup$
Find the minimum number of lines to draw 111 squares.
For example you can draw a single square using 4 lines i.e 2 vertical and 2 horizontal.
Similar, you can draw a 2 square grid using 5 lines, and so on.
The solution totally depends on how you smartly draw lines because the same number of squares can be drawn with more or less lines.
geometry optimization
$endgroup$
Find the minimum number of lines to draw 111 squares.
For example you can draw a single square using 4 lines i.e 2 vertical and 2 horizontal.
Similar, you can draw a 2 square grid using 5 lines, and so on.
The solution totally depends on how you smartly draw lines because the same number of squares can be drawn with more or less lines.
geometry optimization
geometry optimization
edited 8 hours ago
npkllr
5612 silver badges8 bronze badges
5612 silver badges8 bronze badges
asked 9 hours ago
Sayed Mohd AliSayed Mohd Ali
47814 bronze badges
47814 bronze badges
1
$begingroup$
How many squares in 2x2 grid (6 lines)? 4 or 5 squares?
$endgroup$
– npkllr
9 hours ago
$begingroup$
Is it a requirement that the lines are infinite or can I use line segment?
$endgroup$
– Helena
5 hours ago
$begingroup$
Do the lines have to be on an ordinary plane? I can do it with two lines on a mobius strip. :P
$endgroup$
– Spitemaster
5 hours ago
add a comment
|
1
$begingroup$
How many squares in 2x2 grid (6 lines)? 4 or 5 squares?
$endgroup$
– npkllr
9 hours ago
$begingroup$
Is it a requirement that the lines are infinite or can I use line segment?
$endgroup$
– Helena
5 hours ago
$begingroup$
Do the lines have to be on an ordinary plane? I can do it with two lines on a mobius strip. :P
$endgroup$
– Spitemaster
5 hours ago
1
1
$begingroup$
How many squares in 2x2 grid (6 lines)? 4 or 5 squares?
$endgroup$
– npkllr
9 hours ago
$begingroup$
How many squares in 2x2 grid (6 lines)? 4 or 5 squares?
$endgroup$
– npkllr
9 hours ago
$begingroup$
Is it a requirement that the lines are infinite or can I use line segment?
$endgroup$
– Helena
5 hours ago
$begingroup$
Is it a requirement that the lines are infinite or can I use line segment?
$endgroup$
– Helena
5 hours ago
$begingroup$
Do the lines have to be on an ordinary plane? I can do it with two lines on a mobius strip. :P
$endgroup$
– Spitemaster
5 hours ago
$begingroup$
Do the lines have to be on an ordinary plane? I can do it with two lines on a mobius strip. :P
$endgroup$
– Spitemaster
5 hours ago
add a comment
|
5 Answers
5
active
oldest
votes
$begingroup$
EDIT: Some have suggested that the question might be to find exactly 111 squares. In this case,
From the table below, one can see that a $6times 6$ grid and a $3times 4$ grid (with a different angle and with a set of intersections located far away from the first one) make a total of $$91+20=111$$
squares, for a total of $7+7+4+5=23$ lines.
Thanks to @Helena in the comments, you can save one line like this:
The gap between lines in the second grid is not a rational multiple of the gap in the first grid, and the small gap between the two grids is a rational multiple of neither. Then the only squares are found within the coloured borders. Total: $23-1=22$ lines
ORIGINAL ANSWER
Let's count
the number of squares in a regular $ptimes q$ grid (that is, with $p+1$ vertical lines and $q+1$ horizontal lines).
There are $p times q$ squares of area 1.
$(p-1)(q-1)$ squares of area 4.
In general, $(p-k)(q-k)$ squares of area $(k+1)^2$ as soon as $p-k$ and $q-k$ are positive.
You see that in general, for the same amount of lines, it is better to have something close to $p=q$ (a big square is better than a long and thin rectangle), because if there are more horizontal lines than vertical lines, then taking a horizontal line to make it vertical will increase the amount of squares of every size.
Indeed,$$(p-k)(q-k)=[pq-(p+q)k+k^2]$$ compared to $$(p+1-k)(q-1-k)=[pq-(p+q)k+k^2]-p+q-1$$ shows that it is worth transferring vertical to horizontal as soon as the difference is bigger than $1$ (and when the difference is $1$ it changes nothing).
The following picture shows you the first values for a $ptimes p$ grid and for a $ptimes (p+1)$ grid.
The smallest amount of lines is therefore $(6+1)+(7+1)=15$ lines.
$endgroup$
1
$begingroup$
You can safe at least one line by reusing a line of the first grid for your second grid. You can make your squares in the second grid a different size, to not make sure that you are not accidentally creating a new square. E.g. if your grid size is 1 in the first grid, can make it sqrt(2) in the second grid.
$endgroup$
– Helena
5 hours ago
$begingroup$
@Helena Agreed and edited. Thanks!
$endgroup$
– Arnaud Mortier
4 hours ago
add a comment
|
$begingroup$
I think the best you can do is
$15$ lines
As follows
Counting
42 squares of side length 1
30 squares of side length 2
20 squares of side length 3
12 squares of side length 4
6 squares of side length 5
2 squares of side length 6
42+30+20+12+6+2 = 112
$endgroup$
3
$begingroup$
How about exactly 111 squares? :P
$endgroup$
– Conifers
8 hours ago
add a comment
|
$begingroup$
I got:
16
By having horizontal and vertical lines on a square grid in rows [0, 1, 2, 3, 4, 5, 6] and columns [0, 1, 2, 3, 4, 6, 7, 8, 10]
Counting:
36 squares of size 1
30 squares of size 2
20 squares of size 3
15 squares of size 4
16 squares of size 5
04 squares of size 6
total: 111 squares
As a picture
$endgroup$
$begingroup$
Nice one! Just 1 short of the optimal number for the $geq 111$ version.
$endgroup$
– Arnaud Mortier
4 hours ago
$begingroup$
Thanks, I'd give some more explanation and share my source code. But I haven't figured out how to maintain proper formatting while using the spoiler tag
$endgroup$
– Helena
4 hours ago
$begingroup$
@ArnaudMortier maybe if we combine our approaches we can that number too
$endgroup$
– Helena
4 hours ago
add a comment
|
$begingroup$
I assume we have to draw exactly 111 squares.
My answer:
We have to draw a 1x111 grid, so the count is 111+2 = 114 lines. --> Changed my answer to 19 lines.
How I find that:
class Program
static void Main(string[] args)
Console.WriteLine("***********");
printGrids(111);
Console.WriteLine("***********");
printGrids(112);
Console.WriteLine("***********");
Console.ReadLine();
private static void printGrids(int target)
Console.WriteLine(string.Format("Target: 0", target));
for (int minDiff = 0; minDiff <= target; minDiff++)
bool found = false;
for (int x = 1; x <= target; x++)
for (int y = x; y <= target; y++)
int val = calc(x, y);
int diff = Math.Abs(val - target);
if (diff == minDiff)
Console.WriteLine(string.Format("0x1: 2", x, y, val));
found = true;
if (found)
break;
private static int calc(int x, int y)
int sum = 0;
for (int val = 0; val < Math.Min(x, y); val++)
sum += (x - val) * (y - val);
return sum;
Prints:
***********
Target: 110
1x110: 110
2x37: 110
3x19: 110
4x12: 110
***********
Target: 111
1x111: 111
***********
Target: 112
1x112: 112
6x7: 112
***********
So if 112 is acceptable, using a 6x7 grid (15 lines) would be OK. But if we want exactly 111 squares, 1x111 grid (114 lines) is the only answer.
Edit:
4x12 (18 lines) - is the best answer for 110.
We can add 1 more square to that with 1 line so the answer is 19 lines.
(I cannot see this, I hope you can)
$endgroup$
$begingroup$
@Arnaud Mortier the "calc" method is what I could formulate to calculate the problem. I've tried it on some cases that I could count and it seems working. And when we try all the cases, there is no solution for 111 except 1x111. This is what I could find, I may be wrong. If you find a mistake for the formulation, it is appreciated.
$endgroup$
– Koray
6 hours ago
$begingroup$
I think that your "mistake" comes from the fact that all your lines are either horizontal or vertical, but that is not a requirement from the problem. It is only something you would do if you want to pass 111 as fast as you can, but not if you want to exactly reach it.
$endgroup$
– Arnaud Mortier
6 hours ago
$begingroup$
@Arnaud Mortier yes, my solution only uses vertical and horizontal lines. I would love to see other than that, if there is.
$endgroup$
– Koray
6 hours ago
$begingroup$
@Arnaud Mortier my country does not allow i.stack.imgur.com so I cannot see your picture.. Opera VPN also not working.. I couldn't visualized your answer :(
$endgroup$
– Koray
6 hours ago
$begingroup$
That's too bad. I didn't choose the site, it's automatic in StackExchange sites.
$endgroup$
– Arnaud Mortier
6 hours ago
|
show 2 more comments
$begingroup$
The answer is:
24
For 110 squares I would draw a 10x11 grid, that requires 11+12=23 lines.
Therefore I need 24 lines for the additional 111th square.
$endgroup$
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "559"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f89178%2fminimum-number-of-lines-to-draw-111-squares%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
EDIT: Some have suggested that the question might be to find exactly 111 squares. In this case,
From the table below, one can see that a $6times 6$ grid and a $3times 4$ grid (with a different angle and with a set of intersections located far away from the first one) make a total of $$91+20=111$$
squares, for a total of $7+7+4+5=23$ lines.
Thanks to @Helena in the comments, you can save one line like this:
The gap between lines in the second grid is not a rational multiple of the gap in the first grid, and the small gap between the two grids is a rational multiple of neither. Then the only squares are found within the coloured borders. Total: $23-1=22$ lines
ORIGINAL ANSWER
Let's count
the number of squares in a regular $ptimes q$ grid (that is, with $p+1$ vertical lines and $q+1$ horizontal lines).
There are $p times q$ squares of area 1.
$(p-1)(q-1)$ squares of area 4.
In general, $(p-k)(q-k)$ squares of area $(k+1)^2$ as soon as $p-k$ and $q-k$ are positive.
You see that in general, for the same amount of lines, it is better to have something close to $p=q$ (a big square is better than a long and thin rectangle), because if there are more horizontal lines than vertical lines, then taking a horizontal line to make it vertical will increase the amount of squares of every size.
Indeed,$$(p-k)(q-k)=[pq-(p+q)k+k^2]$$ compared to $$(p+1-k)(q-1-k)=[pq-(p+q)k+k^2]-p+q-1$$ shows that it is worth transferring vertical to horizontal as soon as the difference is bigger than $1$ (and when the difference is $1$ it changes nothing).
The following picture shows you the first values for a $ptimes p$ grid and for a $ptimes (p+1)$ grid.
The smallest amount of lines is therefore $(6+1)+(7+1)=15$ lines.
$endgroup$
1
$begingroup$
You can safe at least one line by reusing a line of the first grid for your second grid. You can make your squares in the second grid a different size, to not make sure that you are not accidentally creating a new square. E.g. if your grid size is 1 in the first grid, can make it sqrt(2) in the second grid.
$endgroup$
– Helena
5 hours ago
$begingroup$
@Helena Agreed and edited. Thanks!
$endgroup$
– Arnaud Mortier
4 hours ago
add a comment
|
$begingroup$
EDIT: Some have suggested that the question might be to find exactly 111 squares. In this case,
From the table below, one can see that a $6times 6$ grid and a $3times 4$ grid (with a different angle and with a set of intersections located far away from the first one) make a total of $$91+20=111$$
squares, for a total of $7+7+4+5=23$ lines.
Thanks to @Helena in the comments, you can save one line like this:
The gap between lines in the second grid is not a rational multiple of the gap in the first grid, and the small gap between the two grids is a rational multiple of neither. Then the only squares are found within the coloured borders. Total: $23-1=22$ lines
ORIGINAL ANSWER
Let's count
the number of squares in a regular $ptimes q$ grid (that is, with $p+1$ vertical lines and $q+1$ horizontal lines).
There are $p times q$ squares of area 1.
$(p-1)(q-1)$ squares of area 4.
In general, $(p-k)(q-k)$ squares of area $(k+1)^2$ as soon as $p-k$ and $q-k$ are positive.
You see that in general, for the same amount of lines, it is better to have something close to $p=q$ (a big square is better than a long and thin rectangle), because if there are more horizontal lines than vertical lines, then taking a horizontal line to make it vertical will increase the amount of squares of every size.
Indeed,$$(p-k)(q-k)=[pq-(p+q)k+k^2]$$ compared to $$(p+1-k)(q-1-k)=[pq-(p+q)k+k^2]-p+q-1$$ shows that it is worth transferring vertical to horizontal as soon as the difference is bigger than $1$ (and when the difference is $1$ it changes nothing).
The following picture shows you the first values for a $ptimes p$ grid and for a $ptimes (p+1)$ grid.
The smallest amount of lines is therefore $(6+1)+(7+1)=15$ lines.
$endgroup$
1
$begingroup$
You can safe at least one line by reusing a line of the first grid for your second grid. You can make your squares in the second grid a different size, to not make sure that you are not accidentally creating a new square. E.g. if your grid size is 1 in the first grid, can make it sqrt(2) in the second grid.
$endgroup$
– Helena
5 hours ago
$begingroup$
@Helena Agreed and edited. Thanks!
$endgroup$
– Arnaud Mortier
4 hours ago
add a comment
|
$begingroup$
EDIT: Some have suggested that the question might be to find exactly 111 squares. In this case,
From the table below, one can see that a $6times 6$ grid and a $3times 4$ grid (with a different angle and with a set of intersections located far away from the first one) make a total of $$91+20=111$$
squares, for a total of $7+7+4+5=23$ lines.
Thanks to @Helena in the comments, you can save one line like this:
The gap between lines in the second grid is not a rational multiple of the gap in the first grid, and the small gap between the two grids is a rational multiple of neither. Then the only squares are found within the coloured borders. Total: $23-1=22$ lines
ORIGINAL ANSWER
Let's count
the number of squares in a regular $ptimes q$ grid (that is, with $p+1$ vertical lines and $q+1$ horizontal lines).
There are $p times q$ squares of area 1.
$(p-1)(q-1)$ squares of area 4.
In general, $(p-k)(q-k)$ squares of area $(k+1)^2$ as soon as $p-k$ and $q-k$ are positive.
You see that in general, for the same amount of lines, it is better to have something close to $p=q$ (a big square is better than a long and thin rectangle), because if there are more horizontal lines than vertical lines, then taking a horizontal line to make it vertical will increase the amount of squares of every size.
Indeed,$$(p-k)(q-k)=[pq-(p+q)k+k^2]$$ compared to $$(p+1-k)(q-1-k)=[pq-(p+q)k+k^2]-p+q-1$$ shows that it is worth transferring vertical to horizontal as soon as the difference is bigger than $1$ (and when the difference is $1$ it changes nothing).
The following picture shows you the first values for a $ptimes p$ grid and for a $ptimes (p+1)$ grid.
The smallest amount of lines is therefore $(6+1)+(7+1)=15$ lines.
$endgroup$
EDIT: Some have suggested that the question might be to find exactly 111 squares. In this case,
From the table below, one can see that a $6times 6$ grid and a $3times 4$ grid (with a different angle and with a set of intersections located far away from the first one) make a total of $$91+20=111$$
squares, for a total of $7+7+4+5=23$ lines.
Thanks to @Helena in the comments, you can save one line like this:
The gap between lines in the second grid is not a rational multiple of the gap in the first grid, and the small gap between the two grids is a rational multiple of neither. Then the only squares are found within the coloured borders. Total: $23-1=22$ lines
ORIGINAL ANSWER
Let's count
the number of squares in a regular $ptimes q$ grid (that is, with $p+1$ vertical lines and $q+1$ horizontal lines).
There are $p times q$ squares of area 1.
$(p-1)(q-1)$ squares of area 4.
In general, $(p-k)(q-k)$ squares of area $(k+1)^2$ as soon as $p-k$ and $q-k$ are positive.
You see that in general, for the same amount of lines, it is better to have something close to $p=q$ (a big square is better than a long and thin rectangle), because if there are more horizontal lines than vertical lines, then taking a horizontal line to make it vertical will increase the amount of squares of every size.
Indeed,$$(p-k)(q-k)=[pq-(p+q)k+k^2]$$ compared to $$(p+1-k)(q-1-k)=[pq-(p+q)k+k^2]-p+q-1$$ shows that it is worth transferring vertical to horizontal as soon as the difference is bigger than $1$ (and when the difference is $1$ it changes nothing).
The following picture shows you the first values for a $ptimes p$ grid and for a $ptimes (p+1)$ grid.
The smallest amount of lines is therefore $(6+1)+(7+1)=15$ lines.
edited 4 hours ago
answered 8 hours ago
Arnaud MortierArnaud Mortier
5,61913 silver badges48 bronze badges
5,61913 silver badges48 bronze badges
1
$begingroup$
You can safe at least one line by reusing a line of the first grid for your second grid. You can make your squares in the second grid a different size, to not make sure that you are not accidentally creating a new square. E.g. if your grid size is 1 in the first grid, can make it sqrt(2) in the second grid.
$endgroup$
– Helena
5 hours ago
$begingroup$
@Helena Agreed and edited. Thanks!
$endgroup$
– Arnaud Mortier
4 hours ago
add a comment
|
1
$begingroup$
You can safe at least one line by reusing a line of the first grid for your second grid. You can make your squares in the second grid a different size, to not make sure that you are not accidentally creating a new square. E.g. if your grid size is 1 in the first grid, can make it sqrt(2) in the second grid.
$endgroup$
– Helena
5 hours ago
$begingroup$
@Helena Agreed and edited. Thanks!
$endgroup$
– Arnaud Mortier
4 hours ago
1
1
$begingroup$
You can safe at least one line by reusing a line of the first grid for your second grid. You can make your squares in the second grid a different size, to not make sure that you are not accidentally creating a new square. E.g. if your grid size is 1 in the first grid, can make it sqrt(2) in the second grid.
$endgroup$
– Helena
5 hours ago
$begingroup$
You can safe at least one line by reusing a line of the first grid for your second grid. You can make your squares in the second grid a different size, to not make sure that you are not accidentally creating a new square. E.g. if your grid size is 1 in the first grid, can make it sqrt(2) in the second grid.
$endgroup$
– Helena
5 hours ago
$begingroup$
@Helena Agreed and edited. Thanks!
$endgroup$
– Arnaud Mortier
4 hours ago
$begingroup$
@Helena Agreed and edited. Thanks!
$endgroup$
– Arnaud Mortier
4 hours ago
add a comment
|
$begingroup$
I think the best you can do is
$15$ lines
As follows
Counting
42 squares of side length 1
30 squares of side length 2
20 squares of side length 3
12 squares of side length 4
6 squares of side length 5
2 squares of side length 6
42+30+20+12+6+2 = 112
$endgroup$
3
$begingroup$
How about exactly 111 squares? :P
$endgroup$
– Conifers
8 hours ago
add a comment
|
$begingroup$
I think the best you can do is
$15$ lines
As follows
Counting
42 squares of side length 1
30 squares of side length 2
20 squares of side length 3
12 squares of side length 4
6 squares of side length 5
2 squares of side length 6
42+30+20+12+6+2 = 112
$endgroup$
3
$begingroup$
How about exactly 111 squares? :P
$endgroup$
– Conifers
8 hours ago
add a comment
|
$begingroup$
I think the best you can do is
$15$ lines
As follows
Counting
42 squares of side length 1
30 squares of side length 2
20 squares of side length 3
12 squares of side length 4
6 squares of side length 5
2 squares of side length 6
42+30+20+12+6+2 = 112
$endgroup$
I think the best you can do is
$15$ lines
As follows
Counting
42 squares of side length 1
30 squares of side length 2
20 squares of side length 3
12 squares of side length 4
6 squares of side length 5
2 squares of side length 6
42+30+20+12+6+2 = 112
answered 9 hours ago
hexominohexomino
61.8k5 gold badges177 silver badges277 bronze badges
61.8k5 gold badges177 silver badges277 bronze badges
3
$begingroup$
How about exactly 111 squares? :P
$endgroup$
– Conifers
8 hours ago
add a comment
|
3
$begingroup$
How about exactly 111 squares? :P
$endgroup$
– Conifers
8 hours ago
3
3
$begingroup$
How about exactly 111 squares? :P
$endgroup$
– Conifers
8 hours ago
$begingroup$
How about exactly 111 squares? :P
$endgroup$
– Conifers
8 hours ago
add a comment
|
$begingroup$
I got:
16
By having horizontal and vertical lines on a square grid in rows [0, 1, 2, 3, 4, 5, 6] and columns [0, 1, 2, 3, 4, 6, 7, 8, 10]
Counting:
36 squares of size 1
30 squares of size 2
20 squares of size 3
15 squares of size 4
16 squares of size 5
04 squares of size 6
total: 111 squares
As a picture
$endgroup$
$begingroup$
Nice one! Just 1 short of the optimal number for the $geq 111$ version.
$endgroup$
– Arnaud Mortier
4 hours ago
$begingroup$
Thanks, I'd give some more explanation and share my source code. But I haven't figured out how to maintain proper formatting while using the spoiler tag
$endgroup$
– Helena
4 hours ago
$begingroup$
@ArnaudMortier maybe if we combine our approaches we can that number too
$endgroup$
– Helena
4 hours ago
add a comment
|
$begingroup$
I got:
16
By having horizontal and vertical lines on a square grid in rows [0, 1, 2, 3, 4, 5, 6] and columns [0, 1, 2, 3, 4, 6, 7, 8, 10]
Counting:
36 squares of size 1
30 squares of size 2
20 squares of size 3
15 squares of size 4
16 squares of size 5
04 squares of size 6
total: 111 squares
As a picture
$endgroup$
$begingroup$
Nice one! Just 1 short of the optimal number for the $geq 111$ version.
$endgroup$
– Arnaud Mortier
4 hours ago
$begingroup$
Thanks, I'd give some more explanation and share my source code. But I haven't figured out how to maintain proper formatting while using the spoiler tag
$endgroup$
– Helena
4 hours ago
$begingroup$
@ArnaudMortier maybe if we combine our approaches we can that number too
$endgroup$
– Helena
4 hours ago
add a comment
|
$begingroup$
I got:
16
By having horizontal and vertical lines on a square grid in rows [0, 1, 2, 3, 4, 5, 6] and columns [0, 1, 2, 3, 4, 6, 7, 8, 10]
Counting:
36 squares of size 1
30 squares of size 2
20 squares of size 3
15 squares of size 4
16 squares of size 5
04 squares of size 6
total: 111 squares
As a picture
$endgroup$
I got:
16
By having horizontal and vertical lines on a square grid in rows [0, 1, 2, 3, 4, 5, 6] and columns [0, 1, 2, 3, 4, 6, 7, 8, 10]
Counting:
36 squares of size 1
30 squares of size 2
20 squares of size 3
15 squares of size 4
16 squares of size 5
04 squares of size 6
total: 111 squares
As a picture
edited 3 hours ago
answered 4 hours ago
HelenaHelena
8863 silver badges8 bronze badges
8863 silver badges8 bronze badges
$begingroup$
Nice one! Just 1 short of the optimal number for the $geq 111$ version.
$endgroup$
– Arnaud Mortier
4 hours ago
$begingroup$
Thanks, I'd give some more explanation and share my source code. But I haven't figured out how to maintain proper formatting while using the spoiler tag
$endgroup$
– Helena
4 hours ago
$begingroup$
@ArnaudMortier maybe if we combine our approaches we can that number too
$endgroup$
– Helena
4 hours ago
add a comment
|
$begingroup$
Nice one! Just 1 short of the optimal number for the $geq 111$ version.
$endgroup$
– Arnaud Mortier
4 hours ago
$begingroup$
Thanks, I'd give some more explanation and share my source code. But I haven't figured out how to maintain proper formatting while using the spoiler tag
$endgroup$
– Helena
4 hours ago
$begingroup$
@ArnaudMortier maybe if we combine our approaches we can that number too
$endgroup$
– Helena
4 hours ago
$begingroup$
Nice one! Just 1 short of the optimal number for the $geq 111$ version.
$endgroup$
– Arnaud Mortier
4 hours ago
$begingroup$
Nice one! Just 1 short of the optimal number for the $geq 111$ version.
$endgroup$
– Arnaud Mortier
4 hours ago
$begingroup$
Thanks, I'd give some more explanation and share my source code. But I haven't figured out how to maintain proper formatting while using the spoiler tag
$endgroup$
– Helena
4 hours ago
$begingroup$
Thanks, I'd give some more explanation and share my source code. But I haven't figured out how to maintain proper formatting while using the spoiler tag
$endgroup$
– Helena
4 hours ago
$begingroup$
@ArnaudMortier maybe if we combine our approaches we can that number too
$endgroup$
– Helena
4 hours ago
$begingroup$
@ArnaudMortier maybe if we combine our approaches we can that number too
$endgroup$
– Helena
4 hours ago
add a comment
|
$begingroup$
I assume we have to draw exactly 111 squares.
My answer:
We have to draw a 1x111 grid, so the count is 111+2 = 114 lines. --> Changed my answer to 19 lines.
How I find that:
class Program
static void Main(string[] args)
Console.WriteLine("***********");
printGrids(111);
Console.WriteLine("***********");
printGrids(112);
Console.WriteLine("***********");
Console.ReadLine();
private static void printGrids(int target)
Console.WriteLine(string.Format("Target: 0", target));
for (int minDiff = 0; minDiff <= target; minDiff++)
bool found = false;
for (int x = 1; x <= target; x++)
for (int y = x; y <= target; y++)
int val = calc(x, y);
int diff = Math.Abs(val - target);
if (diff == minDiff)
Console.WriteLine(string.Format("0x1: 2", x, y, val));
found = true;
if (found)
break;
private static int calc(int x, int y)
int sum = 0;
for (int val = 0; val < Math.Min(x, y); val++)
sum += (x - val) * (y - val);
return sum;
Prints:
***********
Target: 110
1x110: 110
2x37: 110
3x19: 110
4x12: 110
***********
Target: 111
1x111: 111
***********
Target: 112
1x112: 112
6x7: 112
***********
So if 112 is acceptable, using a 6x7 grid (15 lines) would be OK. But if we want exactly 111 squares, 1x111 grid (114 lines) is the only answer.
Edit:
4x12 (18 lines) - is the best answer for 110.
We can add 1 more square to that with 1 line so the answer is 19 lines.
(I cannot see this, I hope you can)
$endgroup$
$begingroup$
@Arnaud Mortier the "calc" method is what I could formulate to calculate the problem. I've tried it on some cases that I could count and it seems working. And when we try all the cases, there is no solution for 111 except 1x111. This is what I could find, I may be wrong. If you find a mistake for the formulation, it is appreciated.
$endgroup$
– Koray
6 hours ago
$begingroup$
I think that your "mistake" comes from the fact that all your lines are either horizontal or vertical, but that is not a requirement from the problem. It is only something you would do if you want to pass 111 as fast as you can, but not if you want to exactly reach it.
$endgroup$
– Arnaud Mortier
6 hours ago
$begingroup$
@Arnaud Mortier yes, my solution only uses vertical and horizontal lines. I would love to see other than that, if there is.
$endgroup$
– Koray
6 hours ago
$begingroup$
@Arnaud Mortier my country does not allow i.stack.imgur.com so I cannot see your picture.. Opera VPN also not working.. I couldn't visualized your answer :(
$endgroup$
– Koray
6 hours ago
$begingroup$
That's too bad. I didn't choose the site, it's automatic in StackExchange sites.
$endgroup$
– Arnaud Mortier
6 hours ago
|
show 2 more comments
$begingroup$
I assume we have to draw exactly 111 squares.
My answer:
We have to draw a 1x111 grid, so the count is 111+2 = 114 lines. --> Changed my answer to 19 lines.
How I find that:
class Program
static void Main(string[] args)
Console.WriteLine("***********");
printGrids(111);
Console.WriteLine("***********");
printGrids(112);
Console.WriteLine("***********");
Console.ReadLine();
private static void printGrids(int target)
Console.WriteLine(string.Format("Target: 0", target));
for (int minDiff = 0; minDiff <= target; minDiff++)
bool found = false;
for (int x = 1; x <= target; x++)
for (int y = x; y <= target; y++)
int val = calc(x, y);
int diff = Math.Abs(val - target);
if (diff == minDiff)
Console.WriteLine(string.Format("0x1: 2", x, y, val));
found = true;
if (found)
break;
private static int calc(int x, int y)
int sum = 0;
for (int val = 0; val < Math.Min(x, y); val++)
sum += (x - val) * (y - val);
return sum;
Prints:
***********
Target: 110
1x110: 110
2x37: 110
3x19: 110
4x12: 110
***********
Target: 111
1x111: 111
***********
Target: 112
1x112: 112
6x7: 112
***********
So if 112 is acceptable, using a 6x7 grid (15 lines) would be OK. But if we want exactly 111 squares, 1x111 grid (114 lines) is the only answer.
Edit:
4x12 (18 lines) - is the best answer for 110.
We can add 1 more square to that with 1 line so the answer is 19 lines.
(I cannot see this, I hope you can)
$endgroup$
$begingroup$
@Arnaud Mortier the "calc" method is what I could formulate to calculate the problem. I've tried it on some cases that I could count and it seems working. And when we try all the cases, there is no solution for 111 except 1x111. This is what I could find, I may be wrong. If you find a mistake for the formulation, it is appreciated.
$endgroup$
– Koray
6 hours ago
$begingroup$
I think that your "mistake" comes from the fact that all your lines are either horizontal or vertical, but that is not a requirement from the problem. It is only something you would do if you want to pass 111 as fast as you can, but not if you want to exactly reach it.
$endgroup$
– Arnaud Mortier
6 hours ago
$begingroup$
@Arnaud Mortier yes, my solution only uses vertical and horizontal lines. I would love to see other than that, if there is.
$endgroup$
– Koray
6 hours ago
$begingroup$
@Arnaud Mortier my country does not allow i.stack.imgur.com so I cannot see your picture.. Opera VPN also not working.. I couldn't visualized your answer :(
$endgroup$
– Koray
6 hours ago
$begingroup$
That's too bad. I didn't choose the site, it's automatic in StackExchange sites.
$endgroup$
– Arnaud Mortier
6 hours ago
|
show 2 more comments
$begingroup$
I assume we have to draw exactly 111 squares.
My answer:
We have to draw a 1x111 grid, so the count is 111+2 = 114 lines. --> Changed my answer to 19 lines.
How I find that:
class Program
static void Main(string[] args)
Console.WriteLine("***********");
printGrids(111);
Console.WriteLine("***********");
printGrids(112);
Console.WriteLine("***********");
Console.ReadLine();
private static void printGrids(int target)
Console.WriteLine(string.Format("Target: 0", target));
for (int minDiff = 0; minDiff <= target; minDiff++)
bool found = false;
for (int x = 1; x <= target; x++)
for (int y = x; y <= target; y++)
int val = calc(x, y);
int diff = Math.Abs(val - target);
if (diff == minDiff)
Console.WriteLine(string.Format("0x1: 2", x, y, val));
found = true;
if (found)
break;
private static int calc(int x, int y)
int sum = 0;
for (int val = 0; val < Math.Min(x, y); val++)
sum += (x - val) * (y - val);
return sum;
Prints:
***********
Target: 110
1x110: 110
2x37: 110
3x19: 110
4x12: 110
***********
Target: 111
1x111: 111
***********
Target: 112
1x112: 112
6x7: 112
***********
So if 112 is acceptable, using a 6x7 grid (15 lines) would be OK. But if we want exactly 111 squares, 1x111 grid (114 lines) is the only answer.
Edit:
4x12 (18 lines) - is the best answer for 110.
We can add 1 more square to that with 1 line so the answer is 19 lines.
(I cannot see this, I hope you can)
$endgroup$
I assume we have to draw exactly 111 squares.
My answer:
We have to draw a 1x111 grid, so the count is 111+2 = 114 lines. --> Changed my answer to 19 lines.
How I find that:
class Program
static void Main(string[] args)
Console.WriteLine("***********");
printGrids(111);
Console.WriteLine("***********");
printGrids(112);
Console.WriteLine("***********");
Console.ReadLine();
private static void printGrids(int target)
Console.WriteLine(string.Format("Target: 0", target));
for (int minDiff = 0; minDiff <= target; minDiff++)
bool found = false;
for (int x = 1; x <= target; x++)
for (int y = x; y <= target; y++)
int val = calc(x, y);
int diff = Math.Abs(val - target);
if (diff == minDiff)
Console.WriteLine(string.Format("0x1: 2", x, y, val));
found = true;
if (found)
break;
private static int calc(int x, int y)
int sum = 0;
for (int val = 0; val < Math.Min(x, y); val++)
sum += (x - val) * (y - val);
return sum;
Prints:
***********
Target: 110
1x110: 110
2x37: 110
3x19: 110
4x12: 110
***********
Target: 111
1x111: 111
***********
Target: 112
1x112: 112
6x7: 112
***********
So if 112 is acceptable, using a 6x7 grid (15 lines) would be OK. But if we want exactly 111 squares, 1x111 grid (114 lines) is the only answer.
Edit:
4x12 (18 lines) - is the best answer for 110.
We can add 1 more square to that with 1 line so the answer is 19 lines.
(I cannot see this, I hope you can)
edited 6 hours ago
answered 6 hours ago
KorayKoray
1186 bronze badges
1186 bronze badges
$begingroup$
@Arnaud Mortier the "calc" method is what I could formulate to calculate the problem. I've tried it on some cases that I could count and it seems working. And when we try all the cases, there is no solution for 111 except 1x111. This is what I could find, I may be wrong. If you find a mistake for the formulation, it is appreciated.
$endgroup$
– Koray
6 hours ago
$begingroup$
I think that your "mistake" comes from the fact that all your lines are either horizontal or vertical, but that is not a requirement from the problem. It is only something you would do if you want to pass 111 as fast as you can, but not if you want to exactly reach it.
$endgroup$
– Arnaud Mortier
6 hours ago
$begingroup$
@Arnaud Mortier yes, my solution only uses vertical and horizontal lines. I would love to see other than that, if there is.
$endgroup$
– Koray
6 hours ago
$begingroup$
@Arnaud Mortier my country does not allow i.stack.imgur.com so I cannot see your picture.. Opera VPN also not working.. I couldn't visualized your answer :(
$endgroup$
– Koray
6 hours ago
$begingroup$
That's too bad. I didn't choose the site, it's automatic in StackExchange sites.
$endgroup$
– Arnaud Mortier
6 hours ago
|
show 2 more comments
$begingroup$
@Arnaud Mortier the "calc" method is what I could formulate to calculate the problem. I've tried it on some cases that I could count and it seems working. And when we try all the cases, there is no solution for 111 except 1x111. This is what I could find, I may be wrong. If you find a mistake for the formulation, it is appreciated.
$endgroup$
– Koray
6 hours ago
$begingroup$
I think that your "mistake" comes from the fact that all your lines are either horizontal or vertical, but that is not a requirement from the problem. It is only something you would do if you want to pass 111 as fast as you can, but not if you want to exactly reach it.
$endgroup$
– Arnaud Mortier
6 hours ago
$begingroup$
@Arnaud Mortier yes, my solution only uses vertical and horizontal lines. I would love to see other than that, if there is.
$endgroup$
– Koray
6 hours ago
$begingroup$
@Arnaud Mortier my country does not allow i.stack.imgur.com so I cannot see your picture.. Opera VPN also not working.. I couldn't visualized your answer :(
$endgroup$
– Koray
6 hours ago
$begingroup$
That's too bad. I didn't choose the site, it's automatic in StackExchange sites.
$endgroup$
– Arnaud Mortier
6 hours ago
$begingroup$
@Arnaud Mortier the "calc" method is what I could formulate to calculate the problem. I've tried it on some cases that I could count and it seems working. And when we try all the cases, there is no solution for 111 except 1x111. This is what I could find, I may be wrong. If you find a mistake for the formulation, it is appreciated.
$endgroup$
– Koray
6 hours ago
$begingroup$
@Arnaud Mortier the "calc" method is what I could formulate to calculate the problem. I've tried it on some cases that I could count and it seems working. And when we try all the cases, there is no solution for 111 except 1x111. This is what I could find, I may be wrong. If you find a mistake for the formulation, it is appreciated.
$endgroup$
– Koray
6 hours ago
$begingroup$
I think that your "mistake" comes from the fact that all your lines are either horizontal or vertical, but that is not a requirement from the problem. It is only something you would do if you want to pass 111 as fast as you can, but not if you want to exactly reach it.
$endgroup$
– Arnaud Mortier
6 hours ago
$begingroup$
I think that your "mistake" comes from the fact that all your lines are either horizontal or vertical, but that is not a requirement from the problem. It is only something you would do if you want to pass 111 as fast as you can, but not if you want to exactly reach it.
$endgroup$
– Arnaud Mortier
6 hours ago
$begingroup$
@Arnaud Mortier yes, my solution only uses vertical and horizontal lines. I would love to see other than that, if there is.
$endgroup$
– Koray
6 hours ago
$begingroup$
@Arnaud Mortier yes, my solution only uses vertical and horizontal lines. I would love to see other than that, if there is.
$endgroup$
– Koray
6 hours ago
$begingroup$
@Arnaud Mortier my country does not allow i.stack.imgur.com so I cannot see your picture.. Opera VPN also not working.. I couldn't visualized your answer :(
$endgroup$
– Koray
6 hours ago
$begingroup$
@Arnaud Mortier my country does not allow i.stack.imgur.com so I cannot see your picture.. Opera VPN also not working.. I couldn't visualized your answer :(
$endgroup$
– Koray
6 hours ago
$begingroup$
That's too bad. I didn't choose the site, it's automatic in StackExchange sites.
$endgroup$
– Arnaud Mortier
6 hours ago
$begingroup$
That's too bad. I didn't choose the site, it's automatic in StackExchange sites.
$endgroup$
– Arnaud Mortier
6 hours ago
|
show 2 more comments
$begingroup$
The answer is:
24
For 110 squares I would draw a 10x11 grid, that requires 11+12=23 lines.
Therefore I need 24 lines for the additional 111th square.
$endgroup$
add a comment
|
$begingroup$
The answer is:
24
For 110 squares I would draw a 10x11 grid, that requires 11+12=23 lines.
Therefore I need 24 lines for the additional 111th square.
$endgroup$
add a comment
|
$begingroup$
The answer is:
24
For 110 squares I would draw a 10x11 grid, that requires 11+12=23 lines.
Therefore I need 24 lines for the additional 111th square.
$endgroup$
The answer is:
24
For 110 squares I would draw a 10x11 grid, that requires 11+12=23 lines.
Therefore I need 24 lines for the additional 111th square.
answered 9 hours ago
npkllrnpkllr
5612 silver badges8 bronze badges
5612 silver badges8 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Puzzling Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f89178%2fminimum-number-of-lines-to-draw-111-squares%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$begingroup$
How many squares in 2x2 grid (6 lines)? 4 or 5 squares?
$endgroup$
– npkllr
9 hours ago
$begingroup$
Is it a requirement that the lines are infinite or can I use line segment?
$endgroup$
– Helena
5 hours ago
$begingroup$
Do the lines have to be on an ordinary plane? I can do it with two lines on a mobius strip. :P
$endgroup$
– Spitemaster
5 hours ago