Talk:Average loop length: Difference between revisions

From Rosetta Code
Content added Content deleted
(Ill Specified)
 
(5 intermediate revisions by 3 users not shown)
Line 2: Line 2:
Hi, the task needs the analytical formula to be stated as part of the task description rather than leaving it to be discovered. --[[User:Paddy3118|Paddy3118]] 15:53, 4 January 2013 (UTC)
Hi, the task needs the analytical formula to be stated as part of the task description rather than leaving it to be discovered. --[[User:Paddy3118|Paddy3118]] 15:53, 4 January 2013 (UTC)
: I've watched the lecture; the problem in question is in the last 10 minutes and is only mentioned in passing. IIRC, it is at about 1:32:00 (and I forgot to note it down). If you've got the time though, it's ''well'' worth watching the whole thing, and the mathematics involved is extremely simple (yet talks about some very interesting properties of sequences). –[[User:Dkf|Donal Fellows]] 10:54, 9 January 2013 (UTC)
: I've watched the lecture; the problem in question is in the last 10 minutes and is only mentioned in passing. IIRC, it is at about 1:32:00 (and I forgot to note it down). If you've got the time though, it's ''well'' worth watching the whole thing, and the mathematics involved is extremely simple (yet talks about some very interesting properties of sequences). –[[User:Dkf|Donal Fellows]] 10:54, 9 January 2013 (UTC)

==Ill Specified==
== Is there an relation to 100 prisoners? ==
The task, as written (and I have not studied the link) is completely ambiguous. If we had a specific f, there would be no problem. But because we cannot assume the simplest case (that each number in 1..N maps to only one other number), we cannot know how many numbers (on average) a number maps to. And, this is critical information. For example, we could have a mapping where most numbers map to most other numbers, or we could have a mapping where most numbers do not map to most other numbers - and either of these could be built using a uniformly random process. --[[User:Rdm|Rdm]] 14:05, 25 January 2013 (UTC)

[[http://rosettacode.org/wiki/100_prisoners 100 prisoners]]<BR>
Here is the the task, to calculate the propability of finding a cycle/reoccurence of n?
In 100 prisoners you start with number n and hope to find n again.
--[[user Horst.h|Horst.h]] [[User:Horst.h|Horst.h]] ([[User talk:Horst.h|talk]]) 08:26, 6 February 2020 (UTC)
: Sure, in the sense that they share features -- both tasks deal with permutations (and permutations of length 100, at that). But they are also different tasks, and the solutions are different. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 17:40, 6 February 2020 (UTC)

== Syntax errors: regarding "as" at lines 39 and 43 ==

Hi;

wren_cli average_loop_length.wren
[./average_loop_length line 39] Error at 'as': Expect variable name.
[./average_loop_length line 43] Error at 'as': Expected expression.

Thanks,
Retired_Build_Engineer

:Yeah, the problem there is that, when I wrote this example, Wren was only at version 0.2.0 and I hadn't yet added the C-like Fmt.print statement. 'as' became a keyword in version 0.4.0 and so can no longer be used as an ordinary variable name, hence the error message. Anyway I've changed it now though note that, as the output is random, you'll get a different table each time you run it. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 07:01, 2 September 2023 (UTC)

Latest revision as of 07:01, 2 September 2023

Analytical formula?

Hi, the task needs the analytical formula to be stated as part of the task description rather than leaving it to be discovered. --Paddy3118 15:53, 4 January 2013 (UTC)

I've watched the lecture; the problem in question is in the last 10 minutes and is only mentioned in passing. IIRC, it is at about 1:32:00 (and I forgot to note it down). If you've got the time though, it's well worth watching the whole thing, and the mathematics involved is extremely simple (yet talks about some very interesting properties of sequences). –Donal Fellows 10:54, 9 January 2013 (UTC)

Is there an relation to 100 prisoners?

[100 prisoners]
Here is the the task, to calculate the propability of finding a cycle/reoccurence of n? In 100 prisoners you start with number n and hope to find n again. --Horst.h Horst.h (talk) 08:26, 6 February 2020 (UTC)

Sure, in the sense that they share features -- both tasks deal with permutations (and permutations of length 100, at that). But they are also different tasks, and the solutions are different. --Rdm (talk) 17:40, 6 February 2020 (UTC)

Syntax errors: regarding "as" at lines 39 and 43

Hi;

wren_cli average_loop_length.wren [./average_loop_length line 39] Error at 'as': Expect variable name. [./average_loop_length line 43] Error at 'as': Expected expression.

Thanks, Retired_Build_Engineer

Yeah, the problem there is that, when I wrote this example, Wren was only at version 0.2.0 and I hadn't yet added the C-like Fmt.print statement. 'as' became a keyword in version 0.4.0 and so can no longer be used as an ordinary variable name, hence the error message. Anyway I've changed it now though note that, as the output is random, you'll get a different table each time you run it. --PureFox (talk) 07:01, 2 September 2023 (UTC)