File Exchange

image thumbnail

MathExample(N person standing in a circle with only 1 sword)

version 1.0.0 (1.22 KB) by Arpan Gayen
N people standing in a circle. 1st person has a sword. He kills the next person (i.e. No. 2) and gives the sword to the next person ........

1 Download

Updated 11 May 2020

View License

N people standing in a circle. 1st person has a sword. He kills the next person (i.e. No. 2) and gives the sword to the next (i.e. No. 3). All people do the same until only one of them survives. Which number survives at the last?

Two alternative solutions are provided here.

Cite As

Arpan Gayen (2020). MathExample(N person standing in a circle with only 1 sword) (https://www.mathworks.com/matlabcentral/fileexchange/75475-mathexample-n-person-standing-in-a-circle-with-only-1-sword), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Kinkar Das

Manu Mandal

MATLAB Release Compatibility
Created with R2020a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags