يوضح هذا اللغز مدى تقدم ماجستير إدارة الأعمال في ما يزيد قليلاً عن عام

أن قدرات حاملي شهادة LLM قد تطورت بشكل كبير في السنوات القليلة الماضية، ولكن من الصعب تحديد مدى جودتها.
لقد جعلني ذلك أفكر مرة أخرى في مشكلة هندسية صادفتها على قناة على YouTube العام الماضي. كان ذلك في يونيو 2024، وحاولت الحصول على نموذج اللغة الكبيرة الرائد في ذلك الوقت (GPT-4o) لحل اللغز. لم يسير الأمر على ما يرام وكان مطلوبًا كثيراً من الجهد لإيجاد حل، وتساءلت كيف يمكن لأحدث حاملي شهادة الماجستير في القانون أن يتعاملوا مع نفس اللغز.
اللغز
إليك تذكير سريع بما كنت أطلب من LLM حله في ذلك الوقت. افترض أن لدينا الشبكة التالية من النقاط/العقد. في المستويين x وy، تكون كل عقدة على بعد وحدة واحدة بالضبط من جارتها المجاورة. يبدو مثل هذا،
والآن، السؤال الذي أردت الإجابة عليه هو هذا،
How many distinct squares can be drawn on this diagram?
وسرعان ما أصبح من الواضح أن GPT-4o لم يكن يعرف الإجابة، لذلك غيرت وجهة نظري قليلاً وطرحت عليه هذا السؤال بدلاً من ذلك.
I would like a Python program that plots out all the squares we can
draw on the attached diagram, assuming that the corners of any square
must lie on one of the spots on the diagram. Assume each adjacent spot is
1 unit apart in both the x and y directions. Also print out a summary of
the number of squares of the same size and what their side lengths are
القصة الطويلة باختصار، أنا مؤخراً حصلت على GPT-4o للتوصل إلى حل صحيح يعتمد على Python. ومع ذلك، استغرق الأمر مني حوالي ساعتين وأكثر من 40 تكرارًا للنموذج ذهابًا وإيابًا لتحسين إجابته حتى توصل إلى شيء ناجح.
ملحوظة: هل توصلت إلى الإجابة حتى الآن؟ حتى الآن، ما زلت لا أصدق أنه يمكنك رسم 21 مربعًا على هذا الرسم البياني.
التفاعل مع السوناتة 4.5
يعيدنا هذا إلى يومنا هذا وإلى إصدار Anthropic الأخير لما يعتبر أفضل نموذج ترميز متاح اليوم، وهو Claude Sonnet 4.5. لقد مر حوالي 16 شهرًا منذ آخر مرة نظرت فيها إلى هذا، فما مدى تحسن ماجستير إدارة الأعمال في الفترة الفاصلة؟ دعونا نرى كيف يتعامل Sonnet 4.5 مع اللغز.
لاستخدام Sonnet 4.5، قمت بزيارة الصفحة الرئيسية لـ Anthropic.
https://www.anthropic.com
يجب أن تشاهد صفحة مثل هذه.

انقر فوق الأسود الكبير ”جرب كلود“ الزر الموجود بالقرب من أعلى يمين الشاشة. سيُطلب منك تسجيل الدخول في هذه المرحلة. إذا لم يكن لديك حساب بالفعل مع Anthropic، فيرجى إنشاء حساب الآن. إنه مجاني تمامًا للقيام بذلك.
بمجرد تسجيل الدخول، سيتم نقلك إلى شاشة تعرض نافذة مألوفة قائمة على الدردشة تتيح لك التفاعل مع Sonnet 4.5 وطرح الأسئلة عليها.
قبل أن أطلب من النموذج تقديم برنامج بايثون لحل اللغز، طرحت عليه سؤالاً مباشراً لمعرفة ما إذا كان يعرف الإجابة بالفعل.

لقد عاد مع،
Looking at this grid, I need to count all possible squares of different
sizes that can be formed by connecting the dots.
Let me first identify the grid structure. The dots form:
2 dots in the top row
2 dots in the second row
6 dots in the third row
6 dots in the fourth row
2 dots in the fifth row
2 dots in the sixth row
This appears to be a cross or plus-sign shaped grid pattern.
Now I'll count squares by size:
1×1 squares: These are formed by any 4 dots that make a unit square.
In the horizontal middle section (rows 3-4): 5 squares per row × 1 = 5 squares
In the vertical middle section (columns where the cross intersects): counting
the vertical segments gives us 5 more squares
Total: 10 small squares
2×2 squares: These need 4×4 arrangements of dots.
In the horizontal section: 4 squares
In the vertical section: 4 squares
Overlap in center: -1 (counted twice)
Total: 7 squares of size 2×2
3×3 squares and larger: The grid pattern is only 6 dots wide at its maximum, but the cross shape limits where larger squares can fit. Checking the geometry:
One 3×3 square can fit in the center where the arms of the cross overlap
Total: 1 square of size 3×3
Total: 10 + 7 + 1 = 18 squares
لذلك، غير صحيح بثقة. كنت فضوليًا ومفتونًا بشأن إشارة النموذج إلى مربع 3 × 3 (وهو أمر مستحيل في هذه الشبكة)، طلبت منه أن يريني المربع في الرسم التخطيطي. فأجاب بهذا.
Looking at the grid more carefully, I need to reconsider whether a 3×3 square
actually exists.
For a 3×3 square to exist, I would need a 4×4 arrangement of dots
(since a 3×3 square requires 4 dots on each side). Let me check the grid
structure:
The grid appears to be:
Rows 1-2: only 2 dots each (centered)
Rows 3-4: 6 dots each (full width)
Rows 5-6: only 2 dots each (centered)
For a 3×3 square, I would need 4 consecutive rows and 4 consecutive columns all with dots at the intersection points. However, looking at the cross/plus pattern:
The top only has 2 columns of dots
The middle has 6 columns of dots
The bottom only has 2 columns of dots
Since rows 1-2 and rows 5-6 only have 2 dots each (not spanning the full width)
, there isn't actually a 4×4 block of dots anywhere on this grid.
I need to correct my answer: There is NO 3×3 square possible on this grid.
The total should be: 10 (1×1 squares) + 7 (2×2 squares) = 17 squares
I apologize for the error in my initial count. The cross-shaped pattern
prevents any square larger than 2×2 from being formed.
حسنًا، لقد استردت نفسها بهذه الإجابة، لكنها في الأساس لم تذكر بشكل صحيح أن هناك 21 مربعًا إجمالاً.
الجواب النهائي
لإبقاء الأمور عادلة مع مقارنة النماذج على مدار 16 شهرًا، سألت Sonnet 4.5 نفس السؤال الذي طرحته على GPT-4o، والذي كان، على سبيل التذكير، هو هذا.
I would like a Python program that plots out all the squares we can draw on
the attached diagram, assuming that the corners of any square must lie on one
of the spots on the diagram. Assume each adjacent spot is 1 unit apart in
both the x and y directions. Also print out a summary of the number of
squares of the same size and what their side lengths are
فكر Sonnet 4.5 لمدة 5 ثوانٍ كاملة قبل إنشاء كود Python الخاص به.
import matplotlib.pyplot as plt
import numpy as np
from itertools import combinations
from collections import defaultdict
# Define the grid points based on the image
points = [
# Top two rows (2 dots each, centered)
(3, 6), (4, 6),
(3, 5), (4, 5),
# Middle two rows (6 dots each, full width)
(1, 4), (2, 4), (3, 4), (4, 4), (5, 4), (6, 4),
(1, 3), (2, 3), (3, 3), (4, 3), (5, 3), (6, 3),
# Bottom two rows (2 dots each, centered)
(3, 2), (4, 2),
(3, 1), (4, 1),
]
def is_square(p1, p2, p3, p4):
"""Check if four points form a square and return side length if true."""
points = [p1, p2, p3, p4]
# Calculate all pairwise distances
distances = []
for i in range(len(points)):
for j in range(i + 1, len(points)):
dist = np.sqrt((points[i][0] - points[j][0])**2 +
(points[i][1] - points[j][1])**2)
distances.append(dist)
distances.sort()
# For a square: 4 equal sides and 2 equal diagonals
# Diagonals should be sqrt(2) times the side length
if len(distances) == 6:
sides = distances[:4]
diagonals = distances[4:]
# Check if all sides are equal
if np.allclose(sides, [sides[0]] * 4, atol=1e-6):
# Check if diagonals are equal
if np.allclose(diagonals, [diagonals[0]] * 2, atol=1e-6):
# Check if diagonal = side * sqrt(2)
if np.allclose(diagonals[0], sides[0] * np.sqrt(2), atol=1e-6):
return True, sides[0]
return False, 0
def order_square_points(p1, p2, p3, p4):
"""Order points of a square in counterclockwise order starting from bottom-left."""
points = [p1, p2, p3, p4]
# Find centroid
cx = sum(p[0] for p in points) / 4
cy = sum(p[1] for p in points) / 4
# Sort by angle from centroid
def angle(p):
return np.arctan2(p[1] - cy, p[0] - cx)
points.sort(key=angle)
return points
# Find all squares
squares = []
squares_by_size = defaultdict(list)
for combo in combinations(points, 4):
is_sq, side_length = is_square(*combo)
if is_sq:
ordered = order_square_points(*combo)
squares.append(ordered)
squares_by_size[round(side_length, 2)].append(ordered)
# Print summary
print("=" * 50)
print("SUMMARY OF SQUARES FOUND")
print("=" * 50)
total_squares = 0
for side_length in sorted(squares_by_size.keys()):
count = len(squares_by_size[side_length])
total_squares += count
print(f"Side length {side_length}: {count} square(s)")
print(f"\nTotal squares: {total_squares}")
print("=" * 50)
# Create visualization
fig, axes = plt.subplots(2, 2, figsize=(14, 14))
axes = axes.flatten()
# Plot 1: All dots
ax = axes[0]
x_coords = [p[0] for p in points]
y_coords = [p[1] for p in points]
ax.scatter(x_coords, y_coords, c="black", s=100, zorder=3)
ax.set_xlim(0, 7)
ax.set_ylim(0, 7)
ax.set_aspect('equal')
ax.grid(True, alpha=0.3)
ax.set_title('Original Grid', fontsize=14, fontweight="bold")
ax.set_xlabel('X')
ax.set_ylabel('Y')
# Plot 2: All squares overlaid
ax = axes[1]
ax.scatter(x_coords, y_coords, c="black", s=100, zorder=3)
colors = plt.cm.rainbow(np.linspace(0, 1, len(squares)))
for square, color in zip(squares, colors):
square_closed = square + [square[0]]
xs = [p[0] for p in square_closed]
ys = [p[1] for p in square_closed]
ax.plot(xs, ys, c=color, linewidth=2, alpha=0.6)
ax.set_xlim(0, 7)
ax.set_ylim(0, 7)
ax.set_aspect('equal')
ax.grid(True, alpha=0.3)
ax.set_title(f'All {total_squares} Squares Overlaid', fontsize=14, fontweight="bold")
ax.set_xlabel('X')
ax.set_ylabel('Y')
# Plot 3 & 4: Squares by size
plot_idx = 2
for side_length in sorted(squares_by_size.keys()):
if plot_idx >= len(axes):
break
ax = axes[plot_idx]
ax.scatter(x_coords, y_coords, c="lightgray", s=100, zorder=2)
squares_of_size = squares_by_size[side_length]
colors = plt.cm.viridis(np.linspace(0, 1, len(squares_of_size)))
for square, color in zip(squares_of_size, colors):
square_closed = square + [square[0]]
xs = [p[0] for p in square_closed]
ys = [p[1] for p in square_closed]
ax.plot(xs, ys, c=color, linewidth=2.5, marker="o", markersize=8)
ax.set_xlim(0, 7)
ax.set_ylim(0, 7)
ax.set_aspect('equal')
ax.grid(True, alpha=0.3)
ax.set_title(f'Squares with side length {side_length} ({len(squares_of_size)} total)',
fontsize=14, fontweight="bold")
ax.set_xlabel('X')
ax.set_ylabel('Y')
plot_idx += 1
plt.tight_layout()
plt.show()
للوهلة الأولى، اعتقدت أنه من المستحيل أن يتوصل Sonnet إلى الحل الصحيح بهذه السرعة. جي بي تي-4o ملك استغرق ساعات. ومع ذلك، فقد قمت بتثبيت جميع المكتبات المطلوبة للكود المطلوب ونسخه ولصقه في خلية Jupyter Notebook، وتشغيله والحصول على الإخراج التالي. لقد حذفت الرسوم البيانية في الوقت الحالي، والتي تم إخراجها أيضًا.
==================================================
SUMMARY OF SQUARES FOUND
==================================================
Side length 1.0: 9 square(s)
Side length 1.41: 4 square(s)
Side length 2.24: 2 square(s)
Side length 2.83: 4 square(s)
Side length 3.61: 2 square(s)
Total squares: 21
==================================================
#
# Plus some graphs that I'm not showing here
#
لقد صدمني ذلك. وكان الجواب على الفور على الاطلاق.
الشيء البسيط الوحيد الذي لم ينجح النموذج فيه تمامًا هو أنه لم يُخرج مخططًا لكل مجموعة من المربعات ذات الأحجام المختلفة. لقد فعلت للتو التسعة 1×1 والأربعة √2x√2. لقد قمت بحل هذه المشكلة من خلال مطالبة Sonnet بتضمينها أيضًا.
Can you print the graphs in square side order. Also can you have two graphs
side by side on each "line"
وهذا ما أنتجته.



جميل.
ملخص
لتوضيح مدى التقدم الكبير الذي حققته LLMs خلال عام تقريبًا، قررت إعادة النظر في لغز هندسي صعب حاولت حله لأول مرة باستخدام GPT-4o في يونيو 2024. كان اللغز هو كتابة برنامج Python الذي يبحث عن جميع المربعات الممكنة ويرسمها على شبكة محددة من النقاط ذات الشكل المتقاطع.
كانت تجربتي منذ أكثر من عام بقليل عبارة عن صراع؛ لقد استغرق الأمر ساعتين تقريبًا وأكثر من 40 مطالبة لتوجيه GPT-4o إلى حل Python الصحيح.
تقدم سريعًا إلى اليوم، وقمت باختبار Claude Sonnet 4.5 الجديد. عندما طرحت السؤال مباشرة على النموذج لأول مرة، فشل في حساب العدد الصحيح من المربعات. لم تكن البداية رائعة، لكن الاختبار الحقيقي كان منحها الفرصة نفس المطالبة بالضبط اعتدت على GPT-4o.
لدهشتي، أنتجت حلاً كاملاً وصحيحًا لبايثون طلقة واحدة. لم يعثر الكود الذي تم إنشاؤه على جميع المربعات الـ 21 فحسب، بل قام أيضًا بتصنيفها بشكل صحيح حسب أطوال جوانبها الفريدة وإنشاء مخططات تفصيلية لتصورها. بينما كنت بحاجة إلى متابعة سريعة واحدة لإتقان الحبكات، تم حل المشكلة الأساسية على الفور.
هل من الممكن أن محاولتي لحل هذا اللغز في العام الماضي ونشر النتائج التي توصلت إليها قد أدخلته إلى عالم الويب، مما يعني أن الأنثروبيك قد زحفت إليه ببساطة وأدرجته في قاعدة معارفهم النموذجية؟ نعم، أفترض أن هذا قد يكون هو الحال، ولكن لماذا لم يتمكن النموذج من الإجابة على السؤال المباشر الأول الذي طرحته حول إجمالي عدد المربعات بشكل صحيح؟
بالنسبة لي، توضح هذه التجربة بشكل صارخ القفزة المذهلة في قدرات LLM. ما كان في السابق صراعًا متكررًا لمدة ساعتين مع النموذج الرائد في عصره قبل 16 شهرًا، أصبح الآن نجاحًا مدته خمس ثوانٍ مع النموذج الرائد اليوم.