رفتن به مطلب

حل سوالات سایت پروژه اویلر با متلب


ehsan_faal

ارسال های توصیه شده

سلام دوست عزیز. پروژه اویلر یه سایته که فکر میکنم توی پست اول لینکش رو گذاشتم و مجموعه ای از سوالات رو شامل میشه که هر کس بسته به زبان مورد استفادش سعی به حل و اپتیمایز کردن راه حل های قبلی برای اون سوال داره. در کل میتونم بگم به شما فکر کردن برای حل مسائل پیچیده رو یاد میده.

فقط کافیه بعد از وارد شدن به سایت توش رجیستر کنید و به قسمت مسائل برید.

 

 

موفق باشید.

لینک به دیدگاه

سوال 15:

 

Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.

p015.gif

How many such routes are there through a 20×20 grid?

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

 

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

لینک به دیدگاه
  • 4 هفته بعد...

سوال16:

مجموع ارقام عدد 2 به توان 1000 رو میخواد.

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

و جواب:

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

لینک به دیدگاه

و اما یه مسئله سخت!

مسئله 17:

 

If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?

 

NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with

British usage.

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

الگوریتمش رو به یه زبان دیگه دیده بودم،فقط تو متلب پیاده سازیش کردم.

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

لینک به دیدگاه

سوال 18:

راه حل عادی ای که به ذهن میرسه امتحان تمام حالاته، ولی روش حل مسئله ای به اسم برنامه نویسیه پویا هست که واقعا آدم از نحوه برخورد این روش با حل مسئله شاخ درمیاره.نمونش تو همین مسئله.

 

By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.

 

 

3

7 4

2 4 6

8 5 9 3

 

 

That is, 3 + 7 + 4 + 9 = 23.

 

 

Find the maximum total from top to bottom of the triangle below:

 

75

95 64

17 47 82

18 35 87 10

20 04 82 47 65

19 01 23 75 03 34

88 02 77 73 07 63 67

99 65 04 28 06 16 70 92

41 41 26 56 83 40 80 70 33

41 48 72 33 47 32 37 16 94 29

53 71 44 65 25 43 91 52 97 51 14

70 11 33 28 77 73 17 78 39 68 17 57

91 71 52 38 17 14 91 43 58 50 27 29 48

63 66 04 68 89 53 67 30 73 16 69 87 40 31

04 62 98 27 23 09 70 98 73 93 38 53 60 04 23

 

 

NOTE: As there are only 16384 routes, it is possible to solve this problem by trying every route. However, Problem 67, is the same challenge with a triangle containing one-hundred rows; it cannot be solved by brute force, and requires a clever method! ;o)

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

لینک به دیدگاه

سوال 19 رو هنوز راه حل مناسبی واسش پیدا نکردم.

و اما سوال 20:

سعی کردم توی این سوال چند تا ترفند با حال رو نشون بدم.

یکیش عبارات با قاعده و یکیش هم محاسبات سمبولیک:

 

n! means n × (n − 1) × ... × 3 × 2 × 1For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800,

and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.Find the sum of the digits in the number 100!

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

لینک به دیدگاه

سوال 21:

 

 

Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).

If d(a) = b and d(b) = a, where ab, then a and b are an amicable pair and each of a and b are called amicable numbers.For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.Evaluate the sum of all the amicable numbers under 10000.

 


[/font][/color]function Sum=Problem21(n)
Interval=1:n;
Interval=Interval(isprime(Interval)==0);
Sum=0;
for Counter=Interval
S1=GetSumOfDividers(Counter);
if(S1~=Counter && S1~=1)
if ((S1~=Counter)&&(GetSumOfDividers(S1)==Counter))
Sum=Sum+Counter;
end
end
end
end


function DL=GetSumOfDividers(n)
DL=1;
for i=2:floor(sqrt(n))
if mod(n,i)==0
DL=DL+i+(n/i);
end
end
end
[color=#000000][font=Trebuchet MS]
برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

لینک به دیدگاه

سوال 23:

A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.

A number n is called deficient if the sum of its proper divisors is less than n and it is called abundant if this sum exceeds n.

As 12 is the smallest abundant number, 1 + 2 + 3 + 4 + 6 = 16, the smallest number that can be written as the sum of two abundant numbers is 24. By mathematical analysis, it can be shown that all integers greater than 28123 can be written as the sum of two abundant numbers. However, this upper limit cannot be reduced any further by analysis even though it is known that the greatest number that cannot be expressed as the sum of two abundant numbers is less than this limit.

Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers.

 

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

لینک به دیدگاه

سوال 24:

A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:

012 021 102 120 201 210

What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?

راه حل عادی با استفاده از توابع متلب:


برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 


برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

راه حل ارائه شده با استفاده از کمی ریاضیات::ws52:

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

لینک به دیدگاه

سوال 25:

The Fibonacci sequence is defined by the recurrence relation:

F
n
= F
n
−1
+ F
n
−2
, where F
1
= 1 and F
2
= 1.

Hence the first 12 terms will be:

F
1
= 1

F
2
= 1

F
3
= 2

F
4
= 3

F
5
= 5

F
6
= 8

F
7
= 13

F
8
= 21

F
9
= 34

F
10
= 55

F
11
= 89

F
12
= 144

The 12th term, F12, is the first term to contain three digits.

What is the index of the first term in the Fibonacci sequence to contain 1000 digits?

 

 

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

برای مشاهده این محتوا لطفاً ثبت نام کنید یا وارد شوید.

 

 

لینک به دیدگاه
  • 3 ماه بعد...

سلام دوستان کسی در مورد کدنویسی با متلب برای بدست آوردن قابلیت اطمینان شاخص SAidi مطلبی نداره به من کمک کنه ازش ممنون میشم اگه کسی بتونه این کمک رو به من کنه

لینک به دیدگاه

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...